Results 1 to 9 of 9
  1. #1
    Join Date
    Oct 2008
    Location
    Seattle
    Posts
    9
    Plugin Contributions
    0

    Default How to add a custom cart icon to nav?

    Hi there,

    I'm working on tweaking a store design and would like to know how I can add my own little cart icon to the main/top nav like in this example:

    Cart Icon Mockup

    Any tips on how I can do this easily? -I don't need it clickable, just the icon.

    Thanks heaps!

  2. #2
    Join Date
    Aug 2005
    Location
    Arizona
    Posts
    27,761
    Plugin Contributions
    9

    Default Re: How to add a custom cart icon to nav?

    ldonohue,
    Any tips on how I can do this easily? -I don't need it clickable, just the icon.
    Just add the image to your header background image - you have one right?? No Link to what you have so am guessing....

    Don't know why you only want the image with no function???
    Have a look at several of the free templates that have a cart icon HERE, you can download any of them and see how they have implemented this with functionality
    Zen-Venom Get Bitten

  3. #3
    Join Date
    Nov 2006
    Posts
    69
    Plugin Contributions
    0

    Default Re: How to add a custom cart icon to nav?

    This is easily done in

    /includes/templates/template_default/common/header.php

    find

    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>
    insert the red bit

    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; ?><img src="/path to image/cart.gif" height="10" width = "10" /></a></li>
    It even makes it clickable remember to copy it to /includes/templates/yourtemplate/common/header.php
    Last edited by Mickyelta; 21 Mar 2009 at 05:18 AM. Reason: add more

  4. #4
    Join Date
    Oct 2008
    Location
    Seattle
    Posts
    9
    Plugin Contributions
    0

    Default Re: How to add a custom cart icon to nav?

    Thanks so much Mickyelta,

    That worked perfectly! --I really appreciate your help!

    awesome community here..

    Lisa

  5. #5
    Join Date
    Dec 2004
    Posts
    1,031
    Plugin Contributions
    0

    Default Re: How to add a custom cart icon to nav?

    Quote Originally Posted by Mickyelta View Post
    This is easily done in

    /includes/templates/template_default/common/header.php

    find

    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>
    insert the red bit

    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; ?><img src="/path to image/cart.gif" height="10" width = "10" /></a></li>
    It even makes it clickable remember to copy it to /includes/templates/yourtemplate/common/header.php

    I put this in my tpl_header.php but the header_cart.gif is not showing.
    Live and learn... the Zen way.

  6. #6
    Join Date
    Dec 2004
    Posts
    1,031
    Plugin Contributions
    0

    Default Re: How to add a custom cart icon to nav?

    Code:
    <?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>
        <li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?><img src="/images/header_cart.gif" height="10" width="10"/></a></li>
    <?php }?>
    Not sure what I do wrong. Would the image have to be put somewhere else than my root/image folder? I have tried with png, jpg and now gif. Still not showing.
    Live and learn... the Zen way.

  7. #7
    Join Date
    Dec 2004
    Posts
    1,031
    Plugin Contributions
    0

    Default Re: How to add a custom cart icon to nav?

    Found my mistake,

    <img src="/images/header_cart.gif" height="20" width="20"/>

    / in front of my path had to be removed.

    Thank you for the solution posted here.
    Live and learn... the Zen way.

  8. #8
    Join Date
    May 2009
    Location
    The West Coast
    Posts
    25
    Plugin Contributions
    0

    Default Re: How to add a custom cart icon to nav?

    Instead of hard coding the images directory, make use of Zen Cart directory constants. This way if you change your template, the directory changes for you!

    I put the cart image before the "View Shopping Cart" text, but within the link.
    The Red text has been added to '/includes/templates/yourtemplate/common/tpl_header.php':
    Code:
    <?php if ($_SESSION['cart']->count_contents() != 0) { ?>
        <li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . 'cart.png', 'alt text here'); ?><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>

  9. #9
    Join Date
    Aug 2006
    Location
    Singapore
    Posts
    167
    Plugin Contributions
    1

    Default Re: How to add a custom cart icon to nav?

    Quote Originally Posted by anap View Post
    Instead of hard coding the images directory, make use of Zen Cart directory constants. This way if you change your template, the directory changes for you!

    I put the cart image before the "View Shopping Cart" text, but within the link.
    The Red text has been added to '/includes/templates/yourtemplate/common/tpl_header.php':
    Code:
    <?php if ($_SESSION['cart']->count_contents() != 0) { ?>
        <li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . 'cart.png', 'alt text here'); ?><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
    This is correct ..

 

 

Similar Threads

  1. v151 How to pass in custom price from remote add to cart?
    By joeydev in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 1 Mar 2014, 07:34 PM
  2. Add to cart icon - can I remove box?
    By redsky in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 25 Mar 2009, 12:34 PM
  3. How add PayPal icon?
    By alma1 in forum PayPal Express Checkout support
    Replies: 1
    Last Post: 12 Sep 2008, 12:09 AM
  4. Adding an icon on the categories nav
    By Orchard_Direct in forum Basic Configuration
    Replies: 17
    Last Post: 14 Feb 2008, 08:05 AM
  5. How to place a Add To Cart icon in product
    By visionarygodess in forum Basic Configuration
    Replies: 13
    Last Post: 21 Apr 2007, 02:56 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