Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Having problems with buttons


quantrum

Recommended Posts

Posted

Hi,

 

I'm trying to place a help button onto a product page, but at the bottom, below the product attributes, I can get it to do this fine, however it displays on every page, i only need it on one page, the page has the product id of 63,

 

I didn't know if there was an IF statement that I could use to state that if its on this page, then to display this button.

 

I was thinking something along the lines of

 

if ($products['id'] == 63) {

<a href="help-63.html" rel="facebox"><img src="helpbutton63.png" border="0"></a>

}

 

can anybody help ?

 

Thanks in advance

Posted

Yes, and if is a perfect solution.

 

But, where is that file help-63.html? If it's in your catalog, better use tep_href_link. It's good for the session. Find samples in the php files

Posted

Thanks for the reply,

 

I think i did the tep_href_link bit right, but i'm not sure. I've saved and uploaded what I've tried and nothing is loading up, it just remains blank on product 63.

 

below is the code i'm using

 

<?php

if ($products['id'] == 63) {

echo '<tr><td class="main" colspan="2"><a href="' . tep_href_link('help-63.html') . '" rel="facebox"><img src="images/helpbutton63.png" border="0"></a></td></tr>' ;}

?>

 

if anyone has any ideas it'd be hugely appreciated.

 

thanks in advance

Posted
<?php
if ( $product_info['products_id'] == '63' ) {
 echo '<tr><td class="main" colspan="2"><a href="' . tep_href_link('help-63.html') . '" rel="facebox"><img src="images/helpbutton63.png" border="0"></a></td></tr>' ;
}
?>

Also, I don't know that tep_href_link would help you with a static HTML page. However, if this only shows through a popup and has no links, it shouldn't really matter. I might add target="_blank" for the non-javascript case.

Always back up before making changes.

Archived

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

×
×
  • Create New...