Forums / General Questions / Adding a permanent shopping cart link to header

Adding a permanent shopping cart link to header

Locked

Views: 782

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
19 May 2010, 4:02 PM
#1
jthurman avatar

jthurman

New Zenner

Join Date:
May 2010
Posts:
7
Plugin Contributions:
0

Adding a permanent shopping cart link to 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.

19 May 2010, 4:21 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Adding a permanent shopping cart link to 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.

19 May 2010, 4:24 PM
#3
jthurman avatar

jthurman

New Zenner

Join Date:
May 2010
Posts:
7
Plugin Contributions:
0

Re: Adding a permanent shopping cart link to header

gjh42:

You can edit /includes/templates/your_template/common/tpl_header.php and remove the logic that limits its display.

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>
19 May 2010, 4:30 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Adding a permanent shopping cart link to header

The best thing to do would be to go back to the original file and move the line you mention instead of deleting it.

19 May 2010, 4:41 PM
#5
jthurman avatar

jthurman

New Zenner

Join Date:
May 2010
Posts:
7
Plugin Contributions:
0

Re: Adding a permanent shopping cart link to header

Thanks!