Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Changing a text link to a button


luckyhuckster

Recommended Posts

I have a mod that displays a text link to a pdf (demo) file on product_info.php and I want to change it to show a custom button.

 

My site is live and I am wary or screwing it up, so I hope someone may be able to help me through it. The code in product_info.php that creates the text link is

 

  <?php
//pdf upload STARTS  
if ($product_info['products_pdfupload'] == '') {
 echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_pdfupload']) . '">' . TEXT_CLICK_TO_PDFUPLOAD2 . '</a>';
 } else {
 echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_pdfupload']) . '">' . TEXT_CLICK_TO_PDFUPLOAD . '</a>';
 }
//pdf upload ENDS
 ?>

 

I'm guessing I need to define the button attributes elsewhere and then alter the href details in the above code to reference the button.

 

Am I on the right lines? Can anyone guide me?

 

Thanks very much.

 

Simon

Link to comment
Share on other sites

I have a mod that displays a text link to a pdf (demo) file on product_info.php and I want to change it to show a custom button.

 

My site is live and I am wary or screwing it up, so I hope someone may be able to help me through it. The code in product_info.php that creates the text link is

 

 ?<?php
//pdf upload STARTS ?
if ($product_info['products_pdfupload'] == '') {
?echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_pdfupload']) . '">' . TEXT_CLICK_TO_PDFUPLOAD2 . '</a>';
?} else {
?echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_pdfupload']) . '">' . TEXT_CLICK_TO_PDFUPLOAD . '</a>';
?}
//pdf upload ENDS
??>

 

I'm guessing I need to define the button attributes elsewhere and then alter the href details in the above code to reference the button.

 

Am I on the right lines? Can anyone guide me?

 

Thanks very much.

 

Simon

 

 

yep exactly ... define the attribute in english.php and your other language files ... create buttons and put them in the buttons folders for each language ...

 

echo '<a href="' . tep_href_link(FILENAME_ALL_PRODUCTS) . '">' . tep_image_button('button_all_products.gif', IMAGE_BUTTON_ALL_PRODUCTS) . '</a>';

 

:-)

Monika

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

yep exactly ... define the attribute in english.php and your other language files ... create buttons and put them in the buttons folders for each language ...

 

echo '<a href="' . tep_href_link(FILENAME_ALL_PRODUCTS) . '">' . tep_image_button('button_all_products.gif', IMAGE_BUTTON_ALL_PRODUCTS) . '</a>';

 

:-)

Monika

 

 

Wow! Thanks Monika. That was really easy. I just needed a bit of help. Thanks again!

 

Simon

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...