Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2008
    Posts
    11
    Plugin Contributions
    0

    Default 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.

  2. #2
    Join Date
    Jun 2003
    Posts
    33,715
    Plugin Contributions
    0

    Default 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.

  3. #3
    Join Date
    Sep 2008
    Posts
    11
    Plugin Contributions
    0

    Default 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:

    Code:
    <?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:

    Code:
    <?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.
    Last edited by sandstoner; 17 Sep 2008 at 03:42 PM.

  4. #4
    Join Date
    Sep 2008
    Posts
    11
    Plugin Contributions
    0

    Default Re: Need shopping cart link to always show in header

    Ha! I think I figured it out with this:

    Code:
    <?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?

 

 

Similar Threads

  1. Show number of products in cart by shopping cart in header
    By robertwhitis in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 27 Mar 2011, 07:15 PM
  2. View cart link in ezpage links header to SHOW ALWAYS
    By jami1955 in forum Customization from the Admin
    Replies: 7
    Last Post: 8 Jun 2009, 02:01 PM
  3. Always show shopping cart sidebox
    By numinix in forum Customization from the Admin
    Replies: 3
    Last Post: 9 Mar 2009, 05:39 PM
  4. need to make 'checkout' link in shopping cart side box, not in header
    By jamesdavid in forum Templates, Stylesheets, Page Layout
    Replies: 13
    Last Post: 29 May 2008, 03:33 PM
  5. Shopping Cart/Customer Info Always on in Header
    By Radish in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 18 Sep 2006, 06:38 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR