Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Include $variable in description ?


Guest

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...