aghc Posted April 26, 2011 Share Posted April 26, 2011 Simple question: How do I make my header image a link back to my website? There is no good way to get back to my site once a customer gets to the store. Thanks! Link to comment Share on other sites More sharing options...
Guest Posted April 26, 2011 Share Posted April 26, 2011 Molly, Perhaps this will help: http://www.oscommerce.com/forums/topic/342643-how-can-i-link-to-external-homepage/page__p__1428966__hl__$breadcrumb-__fromsearch__1entry1428966 Chris Link to comment Share on other sites More sharing options...
Guest Posted April 26, 2011 Share Posted April 26, 2011 Are you talking about your logo image or the "Top" TAB? Link to comment Share on other sites More sharing options...
aghc Posted April 27, 2011 Author Share Posted April 27, 2011 Are you talking about your logo image or the "Top" TAB? I'm talking about my logo image. Thanks! Link to comment Share on other sites More sharing options...
NodsDorf Posted April 27, 2011 Share Posted April 27, 2011 I'm talking about my logo image. Thanks! Your logo in default 2.2 and 2.3 shops will take you to the index page already. The only reason this wouldn't work is if you're using a template or something custom, or your FILENAME_DEFAULT is not set correctly. This is the code used to display the store header logo: <div id="storeLogo"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME) . '</a>'; ?></div> Link to comment Share on other sites More sharing options...
♥toyicebear Posted April 28, 2011 Share Posted April 28, 2011 If your shop is not in the root of your website and you want the logo to send a customer to your root website and not your shop index, then you can change: <div id="storeLogo"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME) . '</a>'; ?></div> to <div id="storeLogo"><?php echo '<a href="' . HTTP_SERVER . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME) . '</a>'; ?></div> Basics for osC 2.2 Design - Basics for Design V2.3+ - Seo & Sef Url's - Meta Tags for Your osC Shop - Steps to prevent Fraud... - MS3 and Team News... - SEO, Meta Tags, SEF Urls and osCommerce - Commercial Support Inquiries - OSC 2.3+ How To To see what more i can do for you check out my profile [click here] Link to comment Share on other sites More sharing options...
aghc Posted April 29, 2011 Author Share Posted April 29, 2011 If your shop is not in the root of your website and you want the logo to send a customer to your root website and not your shop index, then you can change: to My shop is not in the root of my website, but I don't want to send them to the root either. (If I did I could have just left the breadcrumb that way, right?) I want to be able to click on my logo image and link to a different site which is also mine. Can I change the code you suggested to do this? What file is that code in? Thanks for your help so far! Link to comment Share on other sites More sharing options...
aghc Posted May 3, 2011 Author Share Posted May 3, 2011 Anyone? Link to comment Share on other sites More sharing options...
NodsDorf Posted May 3, 2011 Share Posted May 3, 2011 You can do that... You should note that if you send somebody from OSC to another site the user can lose their session and shopping cart. It would not be good web practice to send somebody to a different site by clicking your store logo. It is fairly common for users to expect to go to the Home Page on Logo Click. catalog/includes/header.php Quick way: Find <div id="storeLogo"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME) . '</a>'; ?></div> Change to: <div id="storeLogo"><?php echo '<a href="'http://www.yourothersite.com'">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME) . '</a>'; ?></div> Osc way: Change to: <div id="storeLogo"><?php echo '<a href="' . FILENAME_OTHER_SITE . '">' . tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME) . '</a>'; ?></div> AND Open catalog/includes/filenames.php Add this before the last ?> define('FILENAME_OTHER_SITE', 'http://www.yourOtherSite.com'); Link to comment Share on other sites More sharing options...
multimixer Posted May 3, 2011 Share Posted May 3, 2011 If the link goes to an external site and not a page inside the osCommerce file structure, ten there is no "osC way". You don't need to define a constant for each url you want to link too. In this case the only correct way is what is called "quick way" above. "osC" way is necessary only for internal files. My community profile | Template system for osCommerce - New: Responsive | Feedback channel Link to comment Share on other sites More sharing options...
NodsDorf Posted May 4, 2011 Share Posted May 4, 2011 If the link goes to an external site and not a page inside the osCommerce file structure, ten there is no "osC way". You don't need to define a constant for each url you want to link too. In this case the only correct way is what is called "quick way" above. "osC" way is necessary only for internal files. Good point, OSC way was poorly phrazed, I was meaning more like for coding continuity. I hope I got that point across in my first paragraph. Link to comment Share on other sites More sharing options...
aghc Posted May 4, 2011 Author Share Posted May 4, 2011 Thank you! Following your advice, I decided to change the top of my breadcrumb to lead to the other site instead of my logo. Now I'm wondering if I can add some sort of pop-up warning that tells customers if they navigate away from this page they'll lose their carts? Link to comment Share on other sites More sharing options...
NodsDorf Posted May 4, 2011 Share Posted May 4, 2011 Thank you! Following your advice, I decided to change the top of my breadcrumb to lead to the other site instead of my logo. Now I'm wondering if I can add some sort of pop-up warning that tells customers if they navigate away from this page they'll lose their carts? Several ways to do that. Javascript function onclick is one way. Another option would be to not open the link in the same window but new tab / window so they don't leave the shop. Add the html target="_blank" attribute to link. You can create a timed redirection php file that says you are leaving our Shop and entering our Main Site and explains what that means. In this you'd want to give them the option to stop the redirection. Those are just some thoughts. To give you the code I'd have to understand the purpose of this sort of link and test the code to make sure it works towards your purpose. Anyway, those suggestions should lead you to the best solution for your needs. Good luck Link to comment Share on other sites More sharing options...
aghc Posted May 4, 2011 Author Share Posted May 4, 2011 I would like to open in a new tab. My code looks like this: includes/applicationtop.php $breadcrumb->add(HEADER_TITLE_TOP, FILENAME_AGHC_HOME); includes/filename.php define('FILENAME_AGHC_HOME', 'http://www.mysite.org'); I'm not sure where to add the html target="_blank" attribute Link to comment Share on other sites More sharing options...
NodsDorf Posted May 4, 2011 Share Posted May 4, 2011 define('FILENAME_AGHC_HOME', 'http://www.mysite.org target="blank" '); Should do it Link to comment Share on other sites More sharing options...
aghc Posted May 5, 2011 Author Share Posted May 5, 2011 I tried that--when clicked, the link doesn't open in a new window and I get the "Oops! This link appears to be broken." message. I know the address is correct, so now what? Link to comment Share on other sites More sharing options...
Xpajun Posted May 5, 2011 Share Posted May 5, 2011 I tried that--when clicked, the link doesn't open in a new window and I get the "Oops! This link appears to be broken." message. I know the address is correct, so now what? did you do target="_blank" or target="blank"? My store is currently running Phoenix 1.0.3.0 I'm currently working on 1.0.7.2 and hope to get it live before 1.0.8.0 arrives (maybe 🙄 ) I used to have a list of add-ons here but I've found that with the ones that supporters of Phoenix get any other add-ons are not really neccessary Link to comment Share on other sites More sharing options...
aghc Posted May 5, 2011 Author Share Posted May 5, 2011 target="blank" Link to comment Share on other sites More sharing options...
aghc Posted May 5, 2011 Author Share Posted May 5, 2011 I tried that--when clicked, the link doesn't open in a new window and I get the "Oops! This link appears to be broken." message. I know the address is correct, so now what? I tried both. Same result. Link to comment Share on other sites More sharing options...
germ Posted May 5, 2011 Share Posted May 5, 2011 Change the define back to: define('FILENAME_AGHC_HOME', 'http://www.mysite.org'); Then in /catalog/includes/classes/breadrumb.php change $trail_string .= '<a href="' . $this->_trail[$i]['link'] . '" class="headerNavigation">' . $this->_trail[$i]['title'] . '</a>'; to: if ( $i == 0 ) $trail_string .= '<a target="_blank" href="' . $this->_trail[$i]['link'] . '" class="headerNavigation">' . $this->_trail[$i]['title'] . '</a>'; else $trail_string .= '<a href="' . $this->_trail[$i]['link'] . '" class="headerNavigation">' . $this->_trail[$i]['title'] . '</a>'; (Note: This code works only because the "Top" link is always first in the breadcrumb.) This change worked for me. :thumbsup: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
aghc Posted May 9, 2011 Author Share Posted May 9, 2011 Awesome! It works perfectly. Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.