Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Sep 2011
    Posts
    43
    Plugin Contributions
    0

    Default How to Change "Home" to a different URL?

    V 1.39

    I've searched and searched the forums and tutoirals, but still need help.

    How do you change the "home" on the top left corner of the zencart store to a different URL?
    Of course this would also change the "home" in the footer?

    I would like the header and footer "home" to go to my main site and not the home of the store.

    I have a logo in the top and bottom of the middle section of the store that takes you to the home of the store.

    I really do not need 4 links on every page to go to the home page of the store.

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: How to Change "Home" to a different URL

    Actually, you would need to change the header and footer Home links individually. They use Zen Cart's HTTP_SERVER and DIR_WS_CATALOG constants which you cannot alter without breaking the store. You can easily change the link code to use just HTTP_SERVER which will point to the base domain URL.

    Edit /includes/templates/your_template/common/tpl_header.php and tpl_footer.php.
    PHP Code:
        <li><?php echo '<a href="' HTTP_SERVER DIR_WS_CATALOG '">'?><?php echo HEADER_TITLE_CATALOG?></a></li>
    PHP Code:
        <li><?php echo '<a href="' HTTP_SERVER '">'?><?php echo HEADER_TITLE_MAIN_SITE?></a></li>
    Then add a define to /includes/languages/your_template/english.php like
    PHP Code:
    define('HEADER_TITLE_MAIN_SITE''Main Home'); 

  3. #3
    Join Date
    Jan 2012
    Posts
    15
    Plugin Contributions
    0

    Default Re: How to Change "Home" to a different URL?

    So just to clarify: I should replace the first PHP code (in your reply) to read like the second PHP code, doing this in both the tpl_header.php and tpl_footer.php files? And then I should add the 'HEADER_TITLE_MAIN_SITE' PHP code to the english.php file?? Two questions:
    (1) *Exactly* where within the english.php file would I add the new define line?
    (2) My includes/languages only includes one template folder called classic, and it only contains an empty.txt file. Does that mean that I can't make the change to the home link URL described in this thread?

    Please advise. Thank you! :)

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: How to Change "Home" to a different URL?

    Yes.
    1) Add the define anywhere convenient, as long as it's between <?php ?> tags and not inside another define or a comment.
    2) Any place you see a /classic/ folder, you can make a /your_template/ folder next to it. Copy the file (in this case /includes/languages/english.php) to /includes/languages/your_template/english.php and make your edits.

  5. #5
    Join Date
    Feb 2011
    Posts
    73
    Plugin Contributions
    0

    Default Re: How to Change "Home" to a different URL?

    Hi
    I having trouble with a simple transfer of a site into another domain. I want to have two sites work on the same server. the old site domain is www.flproducts.gr which I dont want to delete offcourse. Now the new one is www.pelagosmarine.gr.
    I'm writing all the steps that I have been doing until now.
    1) I downloaded the www.flproducts.gr site contents with the database as a backup.
    2) I changed the configuration files both in admin/includes and includes.
    3) Then I changed the sql file the SQL command to
    DROP DATABASE `pelagos`;
    CREATE DATABASE `pelagos` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
    USE `pelagos`;
    by simply changing the name of the database name because they cannot have the same db_name as they both are in the same server.
    4) then I transfered the backup into the new dir and then I import the sql file through phpmyadmin. And the new site does not seems to work properly please see www.pelagosmarine.gr.

    Please tell me what am I doing wrong here? It seems to be something wrong with the database but I cannot trace it.

  6. #6
    Join Date
    Jan 2012
    Posts
    15
    Plugin Contributions
    0

    Default Re: How to Change "Home" to a different URL?

    The thing that's confusing me is that the only template I've ever used is classic (I've not dared to incorporate a different template into my site settings). I'm using the original green default template that's standard for all new Zen Cart users. So I don't know why this folder only contains an empty text file when it apparently should already contain this english.php file. Hmmm...

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: How to Change "Home" to a different URL?

    The stock default template and /template_default/ are two different things. Classic (the /classic/ folders) is an example of a custom template, which is enabled by default. It only contains files that it needs to be different from /template_default/. You can never select /template_default/ to be operational directly, but most of its files will be used by most custom templates. If your template needs to modify a file that is not already in its folders, copy it from the /template_default/ or basic version into your template folder and edit that.

    Also, even if you don't want to mess with site settings, you need to use a different template folder than /classic/, because that will be erased and replaced every time you upgrade to a new version of Zen Cart.
    Copy all of the /classic/ folders and their files to a new foldername, and edit the new template_info.php to reflect that foldername.
    Last edited by gjh42; 13 Feb 2012 at 06:52 PM.

  8. #8
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: How to Change "Home" to a different URL?

    Quote Originally Posted by EmJayNaturalBeautiqu View Post
    The thing that's confusing me is that the only template I've ever used is classic (I've not dared to incorporate a different template into my site settings).
    This saddens me. I'm sure you feel you have good reason to 'not dare to incorporate a different template' into your site, but whatever the reason is, it is invalid. If you continue to use (and modify) the 'classic' template you will cause yourself far more hassles and problems with upgrades than whatever it is/was that causes you to fear using a different template in the first place.

    Furthermore, by adding another template (whilst still keeping the original 'classic' template untouched) will give you the ability to switch between your custom template and the original classic template if you ever need to solve problems or issues. One of the first things we tell people with template issues is 'does it work ok with the default template'. Knowing the answer to this goes a long way in determining whether any given issue is template related, or whether it has some other cause.

    Cheers
    Rod

  9. #9
    Join Date
    Jan 2012
    Posts
    15
    Plugin Contributions
    0

    Default Re: How to Change "Home" to a different URL?

    Don't be saddened, RodG. I've only been using Zen Cart for a few weeks and haven't had time to delve into the world of changing templates. When I feel confident that making small adjustments to my website won't cause major issues like the one I had last week, and once I have time to find a new template that I want to use and learn how to incorporate it, I'll do it!

    One of my concerns is that I don't have access to a person who can walk me through the process in a "live" setting or provide technical support if/when I err, so I must rely upon reading and correctly interpreting the instructions I find on this forum. This will take quite a bit of concentration for me to get it right. For now, I just need to remember how to properly back up my current files and database! LOL
    Last edited by EmJayNaturalBeautiqu; 15 Feb 2012 at 07:41 PM.

  10. #10
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: How to Change "Home" to a different URL?

    The basics of creating a custom template are very simple, like this: How do I create a new Custom Template?

    Installing a template which you can then modify is usually even simpler; usually all you need to do is follow the directions in the template's readme file.
    Last edited by gjh42; 15 Feb 2012 at 07:55 PM.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. How do you change the breadcrumb from "Home" to "Storefront"
    By alterego55 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 5 Oct 2010, 09:06 PM
  2. How to change "Submit" button Properties to different url?
    By actorxfactor in forum Templates, Stylesheets, Page Layout
    Replies: 27
    Last Post: 2 Jun 2009, 06:21 PM
  3. Point breadcrumbs "Home" link to different URL
    By DivaVocals in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 20 Oct 2008, 08:24 PM
  4. How do I change the url for the "Home" links?
    By Phooie in forum General Questions
    Replies: 2
    Last Post: 9 Jul 2008, 09:46 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