Results 1 to 9 of 9
  1. #1
    Join Date
    Mar 2014
    Posts
    32
    Plugin Contributions
    0

    Default Changing URL link of image with logo from Home Page

    I have my shopping cart under directory. So, when someone clicks on the logo, I want MySite.com page to open instead of MySite.com/NameofShoppingCart at present. Thanks in advance!

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Changing URL link of image with logo from Home Page

    Please read through the Similar Threads linked below.

  3. #3
    Join Date
    Mar 2014
    Posts
    32
    Plugin Contributions
    0

    Default Re: Changing URL link of image with logo from Home Page

    I tried the following way but failed.

    Under /includes/templates/template_default/common in tpl_header.php file, I added the third line: <li><a href="http://your_main_page_url">Main Site</a></li>



    <div id="navMain">
    <ul class="back">
    <li><a href="http://your_main_page_url">Main Site</a></li>
    <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
    <?php if ($_SESSION['customer_id']) { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>
    <li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>


    On clicking the logo, I still get the shopping cart page (directory) instead of home page.

  4. #4
    Join Date
    Apr 2014
    Posts
    154
    Plugin Contributions
    0

    Default Re: Changing URL link of image with logo from Home Page

    Quote Originally Posted by Sachin1008 View Post
    I tried the following way but failed.

    Under /includes/templates/template_default/common in tpl_header.php file, I added the third line: <li><a href="http://your_main_page_url">Main Site</a></li>



    <div id="navMain">
    <ul class="back">
    <li><a href="http://your_main_page_url">Main Site</a></li>
    <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
    <?php if ($_SESSION['customer_id']) { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li>
    <li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>


    On clicking the logo, I still get the shopping cart page (directory) instead of home page.
    The part you added is not for your logo. Instead what you did was add a home page link in your navigation bar.

    The part you want to edit is below that. Look for the div id of logo. In that line you will see a reference to a href which is what you want to change.
    Last edited by yaritai; 14 Apr 2014 at 03:50 PM.

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

    Default Re: Changing URL link of image with logo from Home Page

    Correct. You will need to find the "logo" section of your template's /includes/templates/your_template_name/common/tpl_header.php file (copy it from /includes/templates/template_default/common/tpl_header.php if you don't already have a custom template copy).
    Change the link for the logo to your domain root:
    <a href="http://your_main_page_url">

    Note that you should never edit files in /template_default/, but first copy them to the same location under /your_template/, whatever that is, then edit the file. This will save you headaches next time you upgrade to a new version of Zen Cart.

  6. #6
    Join Date
    Mar 2014
    Posts
    32
    Plugin Contributions
    0

    Default Re: Changing URL link of image with logo from Home Page

    I have copied file to /includes/templates/classic as tpl.header.php and edited as follow: txt<div id="logo"><?php echo '<a href="http://www.MySiteName.com" . HTTP_SERVER . DIR_WS_CATALOG . '">' .

    I do not think I did the right way as the link is still opening the shopping portal home page instead of main site.

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

    Default Re: Changing URL link of image with logo from Home Page

    HTTP_SERVER has the value of http://www.MySiteName.com, so that is all you need in the link code:
    PHP Code:
    <div id="logo"><?php echo '<a href="' HTTP_SERVER '">'?>

  8. #8
    Join Date
    Mar 2014
    Posts
    32
    Plugin Contributions
    0

    Default Re: Changing URL link of image with logo from Home Page

    Under includes/templates/classic, the following code is posted:

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

    Still getting the link taking to home page of shopping portal instead of main site.

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

    Default Re: Changing URL link of image with logo from Home Page

    Seeing the whole section shows several errors. Most importantly, you do not want to have DIR_WS_CATALOG in the output at all, as that points to your Zen Cart. The leading < before <div looks wrong, and knowing that the PHP code continues past the link output means that you do not want the ?> after HTTP_SERVER . '">'
    PHP Code:
    <div id="logo"><?php echo '<a href="' HTTP_SERVER '">' zen_image($template->get_template_dir(HEADER_LOGO_IMAGEDIR_WS_TEMPLATE$current_page_base,'images'). '/' HEADER_LOGO_IMAGEHEADER_ALT_TEXT) . '</a>'?></div>

 

 

Similar Threads

  1. Incorrect Home page link url
    By JFlinn in forum General Questions
    Replies: 1
    Last Post: 6 Nov 2010, 01:48 AM
  2. Home Link image (logo.gif)
    By ThomasT in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 1 Jul 2010, 09:02 PM
  3. Remove / Hide category link from category image on home page
    By Sushigal in forum Templates, Stylesheets, Page Layout
    Replies: 11
    Last Post: 15 Mar 2010, 11:50 PM
  4. Changing URL on Home Page
    By linda408 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 24 Nov 2009, 04:53 PM
  5. Turn off HOME link in Logo Image
    By IDW in forum Templates, Stylesheets, Page Layout
    Replies: 40
    Last Post: 6 Jul 2008, 09:55 AM

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