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!
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!
Please read through the Similar Threads linked below.
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.
Last edited by yaritai; 14 Apr 2014 at 03:50 PM.
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.
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.
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 . '">'?>
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.
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_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
Bookmarks