Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13
  1. #11
    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 Ajeh View Post
    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>
    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 ...
    Thank you for this information! using relative links as you say makes sense and the link works perfect too, I would love to understand though how exactly it is linking back to my main website? I am guessing the HTTP_SERVER is the part that furnishes the information of where to link back to? How does it do this? I understand how Keneso's resolve form of linking works but I don't quite understand how this works!?

  2. #12
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,713
    Plugin Contributions
    6

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

    If you peek at the file:
    /includes/configure.php

    it knows the information for your site, where HTTP_SERVER is defined to be your domain name ...

    In this instance, you know you want to go to your domain and not the secure page, just because you might be on a secure page ...

    Had you wanted to maintain that relationship, of switching between secure and non-secure, there is a function for that as well ...
    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.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  3. #13
    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 Ajeh View Post
    If you peek at the file:
    /includes/configure.php

    it knows the information for your site, where HTTP_SERVER is defined to be your domain name ...

    In this instance, you know you want to go to your domain and not the secure page, just because you might be on a secure page ...

    Had you wanted to maintain that relationship, of switching between secure and non-secure, there is a function for that as well ...
    Thank you again! much appreciated !

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Adding product to shopping cart from another website
    By badarac in forum General Questions
    Replies: 2
    Last Post: 19 Aug 2010, 04:11 PM
  2. Create a Link from Zencart back to Website
    By theresajb in forum General Questions
    Replies: 7
    Last Post: 9 Apr 2010, 05:18 PM
  3. Add to cart button from my main domain name to my shopping cart
    By uwinme in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 7 Mar 2010, 01:15 AM
  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
  •