Hello, I would like to reset the cart (0 item) immediately after payment. On the website, there is a bar that shows how many items you have on your card. When you purchase something and pay for it, and you go to aMember's member page, the bar still shows the items that you purchased. If you come back to the cart, it will say that the cart is empty and everything is fine (but you have to go to the cart first). Is there a way that I can do that after successful payment? Appreciate any help.
The code shows and hides a Shopping Cart bar on the header. Here is the piece of code that I'm having problems with: <?php $cart = Am_Di::getInstance()->session->cart; if($cart && $cart->getItems()){ // Cart has items; echo count($cart->getItems()) . ' item(s) </a>'; } ?>
Modify your code a little: PHP: <?php$cart = Am_Di::getInstance()->session->cart;if($cart->getInvoice()->isCompleted()) $cart = null;if($cart && $cart->getItems()){// Cart has items;echo count($cart->getItems()) . ' item(s) </a>';}?>