New Zenner
- Join Date:
- Jan 2011
- Posts:
- 44
- Plugin Contributions:
- 0
Basket Total in Top Navigation
Hi All,
Just thought I'd share this and try to give something back and in case anyone else wanted to do it...I couldn't see exactly what I wanted posted anywhere.
Very simple addition one line mod to the tpl_header.php
This is to place the Total Qty of items in the Basket and total Spend in the Top navigation bar right next to your Home, Login, Shopping Cart and Checkout text.
I used the example in this post to get what I needed:
http://www.zen-cart.com/forum/showthread.php?t=59136&highlight=items+basket&page=2
So copy your tpl_header.php from: includes\templates\template_default\common\
To:
includes\templates\YOUR_TEMPLATE\common\
Change code between:
<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
<li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<?php }?>
To:
<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
<li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo ' Items: ' . $_SESSION['cart']->count_contents() . ' Total: ' . $currencies->format($_SESSION['cart']->show_total()); ?></li>
<?php }?>
It just uses the same CSS class as the existing text.
Hope this is right :wacko:
Trevor