Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Linking banner to _self (same window)


Guest

Recommended Posts

Searched for long and hard, but ended up trying my basic html knowledge.

 

open includes/functions/banner.php in your favourite editor

 

Find line

 

$banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>';

 

change to:

$banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_self">' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>';

 

Tried and tested. Works well thus far.

 

Dont forget to backup before making changes to your code!

Link to comment
Share on other sites

Good and simple mod... but have a problem.

 

I lost the session id if i click in any banner.

 

If any person know how to solvent this problem i be happy... lol

 

Thnks a lot!

 

 

 

 

 

 

P.D.: Sorry my bad english, im spanish :blush:

Link to comment
Share on other sites

Good and simple mod... but have a problem.

 

I lost the session id if i click in any banner.

 

If any person know how to solvent this problem i be happy... lol

 

Thnks a lot!

P.D.: Sorry my bad english, im spanish :blush:

 

 

No need to make any other changes unless you have some customizing that is being done. Just remove target="_blank from around line 87 of banner.php in the url line. _blank means new window, _self means same frame, _top means whole page. It's same code as with standard html links, just sliced for usage in php.

Link to comment
Share on other sites

No need to make any other changes unless you have some customizing that is being done. Just remove target="_blank from around line 87 of banner.php in the url line. _blank means new window, _self means same frame, _top means whole page. It's same code as with standard html links, just sliced for usage in php.

 

Test in your shop:

 

If you have any product in a basquet, and you click in any banner... your basquet change to busy.

 

My comment: its necessary some modification plus to no lost the basquet in the same session.

 

Something know the mod necessary to no lost the session?

 

Thnks a lot!!!

Link to comment
Share on other sites

  • 3 years later...

Chane the line no 86

$banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" >' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>';

TO

 

$banner_string = '<a href="' . tep_href_link(FILENAME_DEFAULT) . '" >' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>';

This will work for header banners and will redirect to index page

Link to comment
Share on other sites

  • 2 months later...

Chane the line no 86

$banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" >' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>';

TO

 

$banner_string = '<a href="' . tep_href_link(FILENAME_DEFAULT) . '" >' . tep_image(DIR_WS_IMAGES . $banner['banners_image'], $banner['banners_title']) . '</a>';

This will work for header banners and will redirect to index page

 

How would I change this is my line looks like this....

 

$banner_string = '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=banner&goto=' . $banner['banners_id']) . '" target="_blank">' . mm_output_flash_movie( $banner['banners_title'], DIR_WS_IMAGES . $banner['banners_image'] , $size[0] , $size[1]) . '</a>';

 

-------------

 

I added the flash banner mod so don't know how to mod it with out breaking it

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...