Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with Links Please!


aghc

Recommended Posts

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

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>
Link to comment
Share on other sites

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

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

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.

Link to comment
Share on other sites

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

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

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

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

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...