Forum

Thread tagged as: Question, Shop

Display Cart Static on Order Confirmation Page - Perch Shop

Hi!

Here's what I'm trying to do: Display the static cart on my post-payment order confirm page.

Why not use order items? I haven't been able to use the items.html template or items page functions to bring in cart properties that I want to display (as they don't seem to work with the <perch:orderitem> tags, and their <perch:shop> and <perch:cartitem> tags don't seem to work with the items function).

Problem: I can plop cart_static onto my order confirm page just fine....but....I need the cart to empty after the order confirm page is navigated away from. So I empty the cart. If I refresh the page with an empty cart, the bones of the static cart remain, but without any items in the cart. I don't want to see the bones.

The simplest thing I've thought to do is just test for an empty cart and display cart_static only if there are items in the cart.

I don't know how to test for an empty cart using page functions in the php...?

I've tried these (among others) to no avail:

<?php if (perch_shop_cart_has_property('shipping_method_set')) { perch_layout('cart_static'); } else { echo 'WAAAAAAA';} ?>


 <?php if (perch_shop_cart_item_count()>0) { perch_layout('cart_static'); } else { echo 'WAAAAAAA';} ?>

Thank you!! :)

Olympia Kyriakides

Olympia Kyriakides 1 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

if (perch_shop_cart_item_count([], true) > 0) {
...
}

:) thankyou