Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Aug 2006
    Location
    Aberdeen,wa
    Posts
    11
    Plugin Contributions
    0

    Default Changing home link in breadcrumb

    Hello,
    I am having trouble editing the home link next to the breadcrumb trail. Can some one tell me where I can find the page to edit?

    Example
    home: product1 product 2 etc.. I want to change the url on the home link.


    Thanks
    Chris

  2. #2
    Join Date
    Feb 2006
    Location
    Chicago
    Posts
    1,162
    Plugin Contributions
    0

    Default Re: Changing home link in breadcrumb

    Its in zencart\includes\classes\breadcrumb.php

    See these lines

    if (isset($this->_trail[$i]['link']) && zen_not_null($this->_trail[$i]['link']) && !$skip_link ) {
    // this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
    if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
    $trail_string .= ' <a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . $this->_trail[$i]['title'] . '</a>';
    } else {
    $trail_string .= ' <a href="' . $this->_trail[$i]['link'] . '">' . $this->_trail[$i]['title'] . '</a>';
    }
    } else {
    $trail_string .= $this->_trail[$i]['title'];
    Here value of
    HTTP_SERVER . DIR_WS_CATALOG
    is coming from config.php
    Dont change the value of HTTP_SERVER or DIR_WS_CATALOG as it might create problems
    So just hard code whatever value you want your cart to use

    Test it and let me know if it works
    San

  3. #3
    Join Date
    Aug 2006
    Location
    Aberdeen,wa
    Posts
    11
    Plugin Contributions
    0

    Default Re: Changing home link in breadcrumb

    Thank you very much it worked great!

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

    Default Re: Changing home link in breadcrumb

    Question- If you change the Home link, how are your customers going to get to the store's index?

  5. #5
    Join Date
    Aug 2006
    Location
    Aberdeen,wa
    Posts
    11
    Plugin Contributions
    0

    Default Re: Changing home link in breadcrumb

    Quote Originally Posted by Kim
    Question- If you change the Home link, how are your customers going to get to the store's index?
    This would really depend on the website in my opinion. Our site uses Mambo for the main content and then we switch to ZenCart for the purchasing. So in our case the customer could click on sign up now and be taken back to the storefront index. Otherwise most of our content is in the Mambo. So to sumerize I think it really depends on the website.

  6. #6
    Join Date
    Aug 2005
    Location
    Pisgah Forest, NC
    Posts
    31
    Plugin Contributions
    0

    Default Re: Changing home link in breadcrumb

    Quote Originally Posted by Kim
    Question- If you change the Home link, how are your customers going to get to the store's index?
    I think it is mainly an SEO issue, as the default "Home" link goes to main_page.php=index while the true home page is the domain itself. Google punishes people a LOT for making two different URLs lead to the same page [esp. when it is the home page!]. My main_page.php had a 5/10 rating, but the 'normal' home page had a 0/10 [finally moving up to 1/10 after applying this change, and i am sure it will be up to 5 eventually].

    You can see what I mean at http://abasales.com/ [which is an SEO safe 302 to http://www.abasales.com/ ].

    /vjl/

  7. #7
    Join Date
    Apr 2007
    Posts
    4
    Plugin Contributions
    0

    Default Re: Changing home link in breadcrumb

    From the original Post:
    "Its in zencart\includes\classes\breadcrumb.php

    See these lines

    if (isset($this->_trail[$i]['link']) && zen_not_null($this->_trail[$i]['link']) && !$skip_link ) {
    // this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
    if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
    $trail_string .= ' <a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . $this->_trail[$i]['title'] ."

    To be clear:
    Do I replace . HTTP_SERVER . DIR_WS_CATALOG . within the single quotes with a specific IP Address?

    In other words, from this:
    <a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">

    To this?
    <a href="'http://***.***.***.**/index.html'"> ?

  8. #8
    Join Date
    Aug 2004
    Location
    New York City
    Posts
    7,174
    Plugin Contributions
    0

    Default Re: Changing home link in breadcrumb

    Quote Originally Posted by chrisp8756 View Post
    This would really depend on the website in my opinion. Our site uses Mambo for the main content and then we switch to ZenCart for the purchasing. So in our case the customer could click on sign up now and be taken back to the storefront index. Otherwise most of our content is in the Mambo. So to sumerize I think it really depends on the website.
    I disagree. If someone is browsing your products and wants to go back to the storefront, you're sending them back to the main page of the site which is not what the customer wanted.
    Mary Ellen
    I came; I saw; I Zenned
    Taking over the world... one website at a time
    Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

    Holzheimer
    Fan Odyssey

  9. #9
    Join Date
    Mar 2007
    Posts
    20
    Plugin Contributions
    0

    Default Re: Changing home link in breadcrumb

    I'm looking to do the same thing as chrisp8756. We are using Wordpress to post our products and then Add to Cart takes them to the Zen Cart. But, if they hit Home, we want them to go back to the Wordpress site, which is our storefront in this case.

    So, how do I edit the breadcrumb file correctly as to not break the cart?

    Thanks!

  10. #10
    Join Date
    Dec 2005
    Posts
    1,509
    Plugin Contributions
    6

    Default Re: Changing home link in breadcrumb

    Quote Originally Posted by gshibs View Post

    So, how do I edit the breadcrumb file correctly as to not break the cart?

    Thanks!
    You can edit the link by hard coding it in the following file:
    /includes/classes/breadcrumb.php

    Find this line:
    PHP Code:
    $trail_string .= '  <a href="' HTTP_SERVER DIR_WS_CATALOG '">' $this->_trail[$i]['title'] . '</a>'
    And replace with something like this:

    PHP Code:
              //$trail_string .= '  <a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . $this->_trail[$i]['title'] . '</a>';
              //Custom code for new "Home Link" url
              
    $trail_string .= '  <a href="' HTTP_SERVER '">' $this->_trail[$i]['title'] . '</a>';
              
    //End Custom code for new "Home Link" 
    This would take the user back to the DOMAIN home page. If you have another url that you want the "home" link to go to (let's say Wordpress is in another directory other than the root) then you would replace " . HTTP_SERVER . " with your url of choice.

    I had to do this for one site we ran and it worked perfectly. The store ran under one directory, but the actual home page of the site was under the root.
    Eric
    20 Ways to Increase Sales Using Zen Cart
    Zen Cart contribs: Simple Google Analytics, Export Shipping Information

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Define text for Breadcrumb Home link?
    By kirkbross in forum Basic Configuration
    Replies: 4
    Last Post: 24 Mar 2010, 03:09 PM
  2. Changing the Home Breadcrumb
    By Lawbird123 in forum General Questions
    Replies: 9
    Last Post: 6 Sep 2009, 01:13 PM
  3. Changing a breadcrumb link
    By Joanna in forum Templates, Stylesheets, Page Layout
    Replies: 14
    Last Post: 22 May 2008, 05:13 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