Zen Cart Logo
Forums / General Questions / Changing home link in breadcrumb

Changing home link in breadcrumb

Locked

Views: 3,468

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
10 Aug 2006, 5:47 PM
#1
chrisp8756 avatar

chrisp8756

New Zenner

Join Date:
Aug 2006
Location:
Aberdeen,wa
Posts:
4
Plugin Contributions:
0

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
:wacko:

10 Aug 2006, 7:50 PM
#2
superprg avatar

superprg

Totally Zenned

Join Date:
Feb 2006
Location:
Chicago
Posts:
1,349
Plugin Contributions:
0

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

10 Aug 2006, 8:33 PM
#3
chrisp8756 avatar

chrisp8756

New Zenner

Join Date:
Aug 2006
Location:
Aberdeen,wa
Posts:
4
Plugin Contributions:
0

Re: Changing home link in breadcrumb

Thank you very much it worked great!

10 Aug 2006, 10:24 PM
#4
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,616
Plugin Contributions:
0

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?

12 Aug 2006, 2:59 AM
#5
chrisp8756 avatar

chrisp8756

New Zenner

Join Date:
Aug 2006
Location:
Aberdeen,wa
Posts:
4
Plugin Contributions:
0

Re: Changing home link in breadcrumb

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. :D

24 Aug 2006, 10:16 PM
#6
vjl avatar

vjl

New Zenner

Join Date:
Aug 2005
Location:
Pisgah Forest, NC
Posts:
30
Plugin Contributions:
0

Re: Changing home link in breadcrumb

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/

3 Apr 2007, 7:09 PM
#7
imani avatar

imani

New Zenner

Join Date:
Apr 2007
Posts:
4
Plugin Contributions:
0

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'"> ?

3 Apr 2007, 7:44 PM
#8
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Changing home link in breadcrumb

chrisp8756:

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. :D

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.

4 Apr 2007, 1:28 AM
#9
gshibs avatar

gshibs

New Zenner

Join Date:
Mar 2007
Posts:
20
Plugin Contributions:
0

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!

5 Apr 2007, 2:22 AM
#10
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: Changing home link in breadcrumb

gshibs:

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:

$trail_string .= '  <a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . $this->_trail[$i]['title'] . '</a>';

And replace with something like this:

          //$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.

5 Apr 2007, 2:32 AM
#11
econcepts avatar

econcepts

Totally Zenned

Join Date:
Dec 2005
Posts:
1,505
Plugin Contributions:
2

Re: Changing home link in breadcrumb

afo:

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.

Can be true if the storefront is under the root of the website. By nature of what users have determined the "home page" of a website to be (defined widely by users as the page one comes to first when visiting a site ... i.e. the "root") taking a user to the storefront home page (if running in a directly other than the root) rather than the actual site's home page can really be confusing and will almost certainly decrease conversion.

If you want to direct a user to the store front "home page" and it is under a directly other than the root, then I would suggest re-wording the TEXT of the hyperlink (that which the user sees visually) to something other than "Home".

A better term to indicate where the user would be taken in that case would be something like "Storefront"; "Category Listing"; or something like that. These are just examples, but the word "Home" has proven to be defined as the page under the root (index). If your store is not installed in the root, then you will see greater success by using hyperlink text that is relevant to where the user will be taken.

Relevancy is the key here.