Results 1 to 5 of 5
  1. #1
    Join Date
    May 2010
    Posts
    7
    Plugin Contributions
    0

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

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

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

  3. #3
    Join Date
    May 2010
    Posts
    7
    Plugin Contributions
    0

    Default Re: Adding a permanent shopping cart link to header

    Quote Originally Posted by gjh42 View Post
    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>
    Last edited by jthurman; 19 May 2010 at 05:27 PM. Reason: Added entire div to code

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

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

  5. #5
    Join Date
    May 2010
    Posts
    7
    Plugin Contributions
    0

    Default Re: Adding a permanent shopping cart link to header

    Thanks!

 

 

Similar Threads

  1. v139h Permanent Shopping Cart on different browsers/computers
    By AvaAdorn in forum General Questions
    Replies: 9
    Last Post: 24 Jun 2015, 09:40 PM
  2. v150 Add a View Cart link to my shopping cart header, in 12leaves template?
    By Serg in forum All Other Contributions/Addons
    Replies: 10
    Last Post: 22 Aug 2012, 02:49 AM
  3. adding a link to shopping cart
    By ScootaMan in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 8 Nov 2007, 06:05 PM
  4. Permanent Shopping Cart Question
    By momopopo in forum General Questions
    Replies: 3
    Last Post: 6 Jul 2006, 04:35 PM

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