Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to change the page link in product_info.php...


royalfunk

Recommended Posts

Always the same button? Around line 181 of product_info.php, change

echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false));

to something like

echo '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false) . '"' target="_blank">' . tep_image_button('button_more_info.png') . '</a>';

Assumes that you have the button file in the appropriate places: includes/languages/language/images/buttons/button_more_info.png. Change the button name and extension appropriately. Replace language with the actual name of the language (e.g. english).

 

If you want the button to be different for each product/manufacturer, then you will have to store the image name in the database somewhere. If it is pure graphics without text, you can put it in images/ instead of in the languages tree and use tep_image instead of tep_image_button.

 

Hth,

Matt

Link to comment
Share on other sites

Thanks for the reply but there appears to be something wrong with the code you suggested. I am doing my coding in DreamWeaver because it makes things much easier with color coding text. In DreamWeaver I can tell there is something not right in that code string. Sure enough when I uploaded the modified file it didn't work and I got an error message. Any other suggestions?? I'm willing to try anything here! Thanks.

Link to comment
Share on other sites

How about this?

echo '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false) . '" target="_blank">' . tep_image_button('button_more_info.png') . '</a>';

Hth,

Matt

Link to comment
Share on other sites

The following code did exactly what I want...except now it is adding a string at the end of the link which looks like it may be an osCommerce session ID or something. How can I get rid of that, or what causes it, does anyone know? Thanks!

 

 

HERE's THE CODE:

 

<?php echo '<a href="' . tep_href_link($product_info_values['products_url']) . '">' . tep_image_button('button_datasheet.gif') . '</a>'; ?>

 

 

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

 

HERE's WHAT THE LINK ENDS UP AS:

http://mydomain.com/pdf/PRODUCTNAME.pdf?os...c8486e3c1111707

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...