Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How do I change the URL for the Home link on my custom template?

How do I change the URL for the Home link on my custom template?

Locked

Views: 2,688

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
25 Aug 2009, 5:09 PM
#1
derpe2 avatar

derpe2

New Zenner

Join Date:
Jul 2009
Posts:
2
Plugin Contributions:
0

How do I change the URL for the Home link on my custom template?

I set my store up as a link within my site, so the home page isn't the Zencart home page. This means I need to change the "Home" link in the header from mysite/zentcart to just mysite.com? Any help? The only post I've seen relating to this suggests adding links to that section, but those go to mysite.com/zencart/mysite.com and error out.

25 Aug 2009, 5:59 PM
#2
afo avatar

afo

Totally Zenned

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

Re: How do I change the URL for the Home link on my custom template?

If someone is shopping in your Zen Cart, clicks the home link and returns to the other part of your site, he/she will likely lose his/her session and any items in shopping cart.

25 Aug 2009, 6:46 PM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How do I change the URL for the Home link on my custom template?

If you have a link that goes to mysite.com/zencart/mysite.com, you have built it wrong. We would need to see the code you have used to tell how best to correct it.

And having just one Home link that points out of your store is a poor idea, IMO. If you want that basic organization of a separate store within a site, make clear links for Store Home and Site Home, or the like.

25 Aug 2009, 8:47 PM
#4
derpe2 avatar

derpe2

New Zenner

Join Date:
Jul 2009
Posts:
2
Plugin Contributions:
0

Re: How do I change the URL for the Home link on my custom template?

Just to be clear, my site is set up with Zencart as a sub folder in my site. So to get to zencart it's mysite.com/zencart/. I set it up that way so you can click on "Product Store" to get to zencart. So when I'm in zencart I want the home link to go back to my site home. I understand what you are both saying about people losign what's in their cart if they leave zencart, so I've like to add do 2 things:
a. add a "site home" link. (I tried to do this using another thread for adding links to the tpl_header.php file, but adding the coding just add my url to the backend of zencarts url...like this "mysite.com/zencart/myaddedurl/...
b. change the "Home" link name currently on there to "Product Store Home".

Thanks again for everyones help.

26 Aug 2009, 8:00 AM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How do I change the URL for the Home link on my custom template?

To get the text "Product Store Home", edit
/includes/languages/english/your_template/header.php
Line #15 :
define('HEADER_TITLE_CATALOG', 'Home');

to read

define('HEADER_TITLE_CATALOG', 'Product Store Home');

and add a line

define('HEADER_TITLE_SITE', 'Site Home');

    <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
```The DIR_WS_CATALOG adds  the subfolder name to the base URL, so stripping that will get your site home link. Add this above the previous code:
```php
    <li><?php echo '<a href="' . HTTP_SERVER . '">'; ?><?php echo HEADER_TITLE_SITE; ?></a></li>
31 Aug 2009, 9:03 PM
#6
renorock avatar

renorock

New Zenner

Join Date:
Aug 2009
Posts:
4
Plugin Contributions:
0

Re: How do I change the URL for the Home link on my custom template?

Thanks Glenn,
But where does the php code go for this change?

31 Aug 2009, 9:11 PM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: How do I change the URL for the Home link on my custom template?

/includes/templates/your_template/common/tpl_header.php.

Copy from /includes/templates/template_default/common/tpl_header.php and edit in your template folder.