Forums / Templates, Stylesheets, Page Layout / Shopping cart subtotal in header

Shopping cart subtotal in header

Locked

Views: 2,555

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
12 Jun 2006, 3:08 PM
#1
businesstoweb avatar

businesstoweb

New Zenner

Join Date:
Jun 2006
Posts:
39
Plugin Contributions:
0

Shopping cart subtotal in header

Hello,

I am in the process of modifying zen-cart, but need help with showing the shopping cart total in the header. I only want to show the total value, not the items in the cart. Also I would like a £0.00 to be shown when there are no products in the cart, not for the cart to disappear.

Thanks in advance,

Regards,

Stuart :thumbsup:

13 Jun 2006, 12:32 AM
#2
hbtrading avatar

hbtrading

New Zenner

Join Date:
Jan 2006
Posts:
82
Plugin Contributions:
0

Re: Shopping cart subtotal in header

Hi!

When using version 1.2.6, you would have to configure file tpl_header.php (I dont know about 1.3)

I used the following PHP code to get it to display the shopping cart in the header:

$cart_quantity = $_SESSION['cart']->count_contents();
if ($cart_quantity == 1){ ?>
<?php echo "1 Item in cart<br>Total: " . $currencies->format($_SESSION['cart']->show_total()); ?></font>

<?php } else { ?> <?php echo $cart_quantity . " Items in cart<br>Total: " . $currencies->format($_SESSION['cart']->show_total()); ?></font> <?php } ?>

you can see it in action here
hbwatches.com
hope this helps!

Watches
Powered by Zen Cart