Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Include $variable in description ?


Guest

Recommended Posts

Posted

Has anyone done this - can it be done ?

 

I'd like to include a php $variable in a product description - so that my product descriptions can include certian dynamic information.

 

I've tried every combination of quotes etc ... that I know - nothing works, all I get is the $variable being printed.

 

e.g. this product description was given a '.$rating.' rating by everyone....

 

outputs....

 

this product description was given a $rating rating by everyone ....

 

Any ideas?

 

BrianD

Posted

Ummm.... this forum is for *giving* tips and tricks... not asking for them :shock: (read the sticky)

Posted

replace

 

 

<?php echo stripslashes($product_info['products_description']); ?>

 

 

with something like

 

 

<?php 

$product_description = $product_info['products_description']); 

eval ("$evaluated_product_description = "$product_description";"); 

echo stripslashes($evaluated_product_info); 

?>

 

that should work

Archived

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

×
×
  • Create New...