Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can I include a $variable in a product description?


Guest

Recommended Posts

Posted

Originally posted in Tips and tricks forum .....

 

I'm trying to find a way to include a $variable within my product descriptions.

 

I've tried every combination of quotes I know - but nothing seems to work.

 

I'm now thinking of parsing each description, to look for something like <-- $variable --> and pull the variable out, then echo it ..... in a similar way that PHP Nuke picks up page breaks within articles.

 

Has anyone found an easier way of including variables ?

 

BrianD

Posted

have you tried doing an eval on it before it gets displayed

Posted

to elaborate on that a little ....

 

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);

?>

Archived

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

×
×
  • Create New...