Zen Cart Logo

Cart Item Count

Locked

Views: 1,568

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
4 Dec 2006, 7:23 PM
#1
brotherhud avatar

brotherhud

New Zenner

Join Date:
Sep 2006
Location:
Chicago
Posts:
51
Plugin Contributions:
0

Cart Item Count

I have a link on my site for my shopping cart. I changed the php a little it says how many items are in my cart right next to the link. The only problem is when there are no items in the cart it doesn't say anything. I want it to produce a 0 when there are no items or the word "no" Here is my code that produces item count located in cartSummary.php:

$totalsDisplay = '';
switch (true) {
case (SHOW_TOTALS_IN_CART == '1'):
$totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents();
break;
case (SHOW_TOTALS_IN_CART == '2'):
$totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents();
break;
case (SHOW_TOTALS_IN_CART == '3'):
$totalsDisplay = TEXT_TOTAL_ITEMS . $_SESSION['cart']->count_contents();
break;

}

I think this is where I would make my edits. I am still pretty new to php and zen cart. any help would be awesome.