I'm trying to figure out how to add a link to the shopping cart in the header (next to home, login...), is this possible? Right now it only shows up when there is an item in cart, but I want it to always be an active link in the header.
I'm trying to figure out how to add a link to the shopping cart in the header (next to home, login...), is this possible? Right now it only shows up when there is an item in cart, but I want it to always be an active link in the header.
You can edit /includes/templates/your_template/common/tpl_header.php and remove the logic that limits its display.
That logic also controls the checkout link, so if you don't want that always on, you need to move the control logic so it encloses only that link.
I've played around with that a little and I got it to work. I just deleted "if ($_SESSION['cart']->count_contents() != 0)" but I want to keep that there for the "Checkout" link.
Would the following work to keep the shopping cart link active and have the checkout link active only when there are items in the cart?
<div id="navMain">
<ul class="back">
<li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
<?php if ($_SESSION['customer_id']) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>
<li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>
<?php
} else {
if (STORE_STATUS == '0') {
?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
<?php } } ?>
<a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a>
<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<?php }?>
</ul>
</div>
Last edited by jthurman; 19 May 2010 at 05:27 PM. Reason: Added entire div to code
The best thing to do would be to go back to the original file and move the line you mention instead of deleting it.
Thanks!
Bookmarks