Sunday, 15 November 2009

How to show number of items in shopping cart in Zen Cart

Here's a useful snippet of code if you need to show just the total of items in a Zen Cart shopping cart.


echo "Items in cart: ". $_SESSION['cart']->count_contents();


I'm using it in a discrete header including a link to the shopping cart page.
I think it looks cleaner than the default Zen Cart shopping cart side box.

(I'll add link to the live shopping site - when I've finished it. Watch this space!)

0 comments:

Post a Comment