Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Link back to main site

Link back to main site

Locked

Views: 1,025

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
10 Mar 2009, 2:22 AM
#1
endl avatar

endl

New Zenner

Join Date:
May 2008
Posts:
58
Plugin Contributions:
0

Link back to main site

Trying to get a solid link back to the main site that calls zencart in the first place.

I have a "banner" in the header that has a link attached to it that goes back to the main zencart page. Is there a way to change the link? If so, I can't find it.

Seems to me there is a file to edit for the header, I know about header.php but is that where to change (or override with hard code) it? It just does not seem so.

Otherwise, any ideas how to easily link back to the main site?

Ideas appreciated as always. thank you.

10 Mar 2009, 4:31 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Link back to main site

Too many uses of "main"

What url are you wanting the link to be and what is the link to your cart?

10 Mar 2009, 5:00 AM
#3
endl avatar

endl

New Zenner

Join Date:
May 2008
Posts:
58
Plugin Contributions:
0

Re: Link back to main site

Thanks cobra

I want the URL to be https://www.site.com

and it is https://www.site.com/cart

At one time I had a bunch of my own html defining the header design but converted it to a graphic and now I can't remember where the php is that controls that part.

10 Mar 2009, 5:16 AM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Link back to main site

Withoutseeing you cart site I have to assume that you have not broken the default code.

Look at a copy for your templsate of /common/tpl_header.php and the highlighted code is the constant used that you will replace with your anchor href text

<div id="logoWrapper">
    <div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
10 Mar 2009, 5:57 AM
#5
endl avatar

endl

New Zenner

Join Date:
May 2008
Posts:
58
Plugin Contributions:
0

Re: Link back to main site

Yes. Thank you so very much!

Hoping to pass it on someday.

10 Mar 2009, 6:39 AM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: Link back to main site

In the specific case of linking back to the home page of a main site in the domain root, you could leave the HTTP_SERVER and just remove the . DIR_WS_CATALOG:```php

<div id="logoWrapper"> <div id="logo"><?php echo '<a href="' . HTTP_SERVER . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div> ```
10 Mar 2009, 1:00 PM
#7
afo avatar

afo

Totally Zenned

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

Re: Link back to main site

Just keep in mind that if someone has been shopping on your site and goes back to the "main" site before completing the transaction (i.e. actually buying anything), his/her session and shopping cart contents could be lost.

10 Mar 2009, 1:01 PM
#8
stxmona avatar

stxmona

Zen Follower

Join Date:
Aug 2008
Posts:
103
Plugin Contributions:
0

Re: Link back to main site

Hello
I just moved my site from a folder to become the main site. So the original path to my zen cart was https://www.QuiltsOnBroadway.com/zen/

Now when you type in https://www.QuiltsOnBroadway.com you get the correct main page.....however when you continue into the site and then click on the logo to go back to the main page...you go back to the main page in the zen folder (I have not removed these files yet until I am certain everything is working correctly) and actually so do all of my links........please help.

Any help is appreciated!

Mona
A totally new zenner and new to php but is liking it

10 Mar 2009, 1:05 PM
#9
afo avatar

afo

Totally Zenned

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

Re: Link back to main site

Make sure you've followed all the steps in https://www.zen-cart.com/tutorials/index.php?article=122 particularly editing the config files.

10 Mar 2009, 1:08 PM
#10
stxmona avatar

stxmona

Zen Follower

Join Date:
Aug 2008
Posts:
103
Plugin Contributions:
0

Re: Link back to main site

I thought I had but will double check again
Thanks
Mona