Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Jun 2012
    Posts
    42
    Plugin Contributions
    0

    Default creating a link from shopping cart back to main website

    Hello everyone,

    I have created a tab called 'back to main website' at the top menu bar of my page. (www.ishafairtrade.com.au/zencart) I would like this to link DIRECTLY back to my main website (www.ishafairtrade.com) when it is clicked.

    I have been told to

    'define the constant and create the FILENAME_MAIN_WEBSITE?'

    I have no idea how to go about this and would really really appreciate some instructions!

    Thankyou!

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: creating a link from shopping cart back to main website

    I'm not sure why you would want any kind of define there. Just set the <a href ... to the desired URL.

  3. #3
    Join Date
    Jun 2012
    Posts
    42
    Plugin Contributions
    0

    Default Re: creating a link from shopping cart back to main website

    Quote Originally Posted by stevesh View Post
    I'm not sure why you would want any kind of define there. Just set the <a href ... to the desired URL.
    Where exactly do I put this link? Thankyou for your help?

  4. #4
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: creating a link from shopping cart back to main website

    In the same file you put this
    <a href="http://ishafairtrade.com.au/zencart/index.php?main_page=FILENAME_MAIN_WEBSITE">Main Website</a>

    Just do it like this
    <a href="http://ishafairtrade.com.au/>Main Website</a>

  5. #5
    Join Date
    Jun 2012
    Posts
    42
    Plugin Contributions
    0

    Default Re: creating a link from shopping cart back to main website

    Quote Originally Posted by keneso View Post
    In the same file you put this
    <a href="http://ishafairtrade.com.au/zencart/index.php?main_page=FILENAME_MAIN_WEBSITE">Main Website</a>

    Just do it like this
    <a href="http://ishafairtrade.com.au/>Main Website</a>
    This is what I have on that line

    <li><?php echo '<a href="' . zen_href_link(FILENAME_MAIN_WEBSITE) . '">'; ?><?php echo HEADER_TITLE_MAIN_WEBSITE; ?></a> | </li>

    where exactly do I put the link into this? as when I tried a few weeks ago my whole cart went blank...

  6. #6
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: creating a link from shopping cart back to main website

    Change this
    <li><?php echo '<a href="' . zen_href_link(FILENAME_MAIN_WEBSITE) . '">'; ?><?php echo HEADER_TITLE_MAIN_WEBSITE; ?></a> | </li>
    to
    <li><a href="http://ishafairtrade.com.au/>Main Website</a> | </li>

  7. #7
    Join Date
    Jun 2012
    Posts
    42
    Plugin Contributions
    0

    Default Re: creating a link from shopping cart back to main website

    Quote Originally Posted by keneso View Post
    Change this
    <li><?php echo '<a href="' . zen_href_link(FILENAME_MAIN_WEBSITE) . '">'; ?><?php echo HEADER_TITLE_MAIN_WEBSITE; ?></a> | </li>
    to
    <li><a href="http://ishafairtrade.com.au/>Main Website</a> | </li>
    This does not work. It basically made the 'log in' tab (normally next to the 'main website' tab) into a link back to the mail website saying 'page not found'. It does not create a 'main website' tab? I am not sure why, when I try and put it in anywhere else in the existing code I loose my whole cart again....

    here is the existing code from that area in my tpl_header.php


    <!--bof-navigation display-->
    <div id="navMainWrapper">
    <div id="navMain">
    <ul class="back">
    <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a> | </li>
    <li><?php echo '<a href="' . zen_href_link(FILENAME_MAIN_WEBSITE) . '">'; ?><?php echo HEADER_TITLE_MAIN_WEBSITE; ?></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 } } ?>
    <li><img src="includes/templates/alysa_rounded/images/cart.jpg" class="cart-image" alt="the shopping cart" /><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?> - <?php echo $_SESSION['cart']->count_contents();?> item(s) - <?php echo $currencies->format($_SESSION['cart']->show_total());?></a> | </li>
    <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
    <?php if ($_SESSION['cart']->count_contents() != 0) { ?>
    <?php }?>

    </ul>
    </div>

  8. #8
    Join Date
    May 2009
    Posts
    1,219
    Plugin Contributions
    2

    Default Re: creating a link from shopping cart back to main website

    Sorry, a typo, I missed closing " after au/
    Try this

    <li><a href="http://ishafairtrade.com.au/">Main Website</a> | </li>

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: creating a link from shopping cart back to main website

    If you look in the tpl_header.php in the default template, you will see how the link for the Home page uses:
    Code:
    <?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a>
    If your link is to go to your address:
    http://your_domain_name.com

    or in your case .com.au

    You really are better using a relative link than a specific link, as it is a good coding habit ...

    For your domain, you could use:
    Code:
    <?php echo '<a href="' . HTTP_SERVER . '">'; ?>Main Website</a>
    and if you mean for a subdirectory on your server, such as:
    /my_fav_directory

    such as:
    http://your_domain_name.com/my_fav_directory

    you could use:
    Code:
    <?php echo '<a href="' . HTTP_SERVER . '/my_fav_directory/' . '">'; ?><?php echo Main Website; ?></a>
    and if you mean for the subdirectory that your store is in, and your store is in:
    /shop

    such as:
    http://your_domain_name.com/shop

    you could use:
    Code:
    <?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo Main Website; ?></a>

    Relative links are always a better idea than hard coded links, as a rule, for secure vs non-secure pages and for moves to root or sub-directories on the same site or moves to other domains ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  10. #10
    Join Date
    Jun 2012
    Posts
    42
    Plugin Contributions
    0

    Default Re: creating a link from shopping cart back to main website

    Quote Originally Posted by keneso View Post
    Sorry, a typo, I missed closing " after au/
    Try this

    <li><a href="http://ishafairtrade.com.au/">Main Website</a> | </li>
    This works perfect now Thankyou!

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 return back to website from shopping cart
    By rdsbaker in forum General Questions
    Replies: 4
    Last Post: 6 Feb 2014, 01:25 AM
  2. Adding product to shopping cart from another website
    By badarac in forum General Questions
    Replies: 2
    Last Post: 19 Aug 2010, 04:11 PM
  3. Create a Link from Zencart back to Website
    By theresajb in forum General Questions
    Replies: 7
    Last Post: 9 Apr 2010, 05:18 PM
  4. Creating link back to top of page
    By ctcentralinfo in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 12 Jul 2008, 11:48 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