Forums / Templates, Stylesheets, Page Layout / Need shopping cart link to always show in header

Need shopping cart link to always show in header

Locked

Views: 2,165

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
17 Sep 2008, 1:58 PM
#1
sandstoner avatar

sandstoner

New Zenner

Join Date:
Sep 2008
Posts:
11
Plugin Contributions:
0

Need shopping cart link to always show in header

Hi,
I am trying to get the shopping cart link to always show in the header, even if the shopping cart is empty. Currently in my store, if the cart is empty, the header only has links for Home and Log In. If I add something to the cart, the Shopping Cart and Checkout links show in the header.

How can I get the Shopping Cart & Checkout links to always show in the header? I found the Shopping Cart Box Status setting in admin --> configuration --> layout settings, but that doesn't do anything; I'm guessing it's for the shopping cart sidebox, not the shopping cart link in the header? I don't use the shopping cart sidebox.

Is there some code that I should change, and if so, which file and what should I change it to?

Any help would be much appreciated. I'm still learning my way around Zen Cart.

17 Sep 2008, 2:02 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,684
Plugin Contributions:
0

Re: Need shopping cart link to always show in header

You will need to edit your tpl_header.php and remove the php "switch" that controls the shopping cart link.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

17 Sep 2008, 2:38 PM
#3
sandstoner avatar

sandstoner

New Zenner

Join Date:
Sep 2008
Posts:
11
Plugin Contributions:
0

Re: Need shopping cart link to always show in header

I found the section of code in tpl_header.php that I think needs to be changed:

<?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 }?>

However, I'm having trouble with the basic syntax. When I tried this:

<?php /***pkl*** updated block below to always show shopping cart link, even if cart is empty. Continues to only show checkout link if there is something in shopping cart */
	<li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
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 } ?>
/***pkl*** end of update */

my site only loads the background container and appears to be getting hungup on some syntax error. I'm having trouble figuring out where I can put comments too.

Thanks for your patience with me. Still learning the basics of php.

17 Sep 2008, 2:42 PM
#4
sandstoner avatar

sandstoner

New Zenner

Join Date:
Sep 2008
Posts:
11
Plugin Contributions:
0

Re: Need shopping cart link to always show in header

Ha! I think I figured it out with this:

<?php /***pkl*** updated block below to always show shopping cart link, even if cart is empty. Continues to only show checkout link if there is something in shopping cart */ ?>
	<li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
<?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 } ?>
<?php /***pkl*** end of update */ ?>

So basically, all of my comments have to be within php tags?