otacon221 Posted June 28, 2005 Share Posted June 28, 2005 When adding a new product why doesn't php work in it? How can i go around this so that i can put PHP in there? Link to comment Share on other sites More sharing options...
user99999999 Posted June 28, 2005 Share Posted June 28, 2005 You can use the eval function in products_info.php but be careful what your doin. <?php $product_info['products_description'] = " <table border=0 width=100% cellspacing=0 cellpadding=0><tr><td width=100%> <?php include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); ?> </td></tr></table> "; ?> <?php eval (' ?> ' . $product_info['products_description'] . ' <?php '); ?> Link to comment Share on other sites More sharing options...
Eurcynia Posted July 26, 2005 Share Posted July 26, 2005 I have BTS installed, would I add the exact code you posted to the product_info.tpl.php or do I replace something? Thanks in advance! Link to comment Share on other sites More sharing options...
Ender-DI Posted August 31, 2005 Share Posted August 31, 2005 I need to know too! Please help! Link to comment Share on other sites More sharing options...
user99999999 Posted August 31, 2005 Share Posted August 31, 2005 You put this <?php eval (' ?> ' . $product_info['products_description'] . ' <?php '); ?> in place of this $product_info['products_description'] in products_info.php or product_info.tpl.php fot BTS Link to comment Share on other sites More sharing options...
Ender-DI Posted September 1, 2005 Share Posted September 1, 2005 Works like a charm! Thanks! Link to comment Share on other sites More sharing options...
kontraktr Posted September 3, 2005 Share Posted September 3, 2005 Hi there; I cant use HTML tags on products description. For example; i wrote. Specs <p><p> Controls<p> Nice<p> It returns Specs_p__p_Controls_p_Nice_p_ When i go to the MySql on pruducts table. The product_description field again, Specs_p__p_Controls_p_Nice_p_ I think there can be a problem at admin/catagories.php while adding the products. Any suggestions? Thanks a lot and sory for my poor english.. Link to comment Share on other sites More sharing options...
user99999999 Posted September 3, 2005 Share Posted September 3, 2005 you must have uploaded catalog/includes/functions/database.php into your admin catalog/admin/includes/functions/database.php This function is for admin it doesnt call tep_sanitize_string(). function tep_db_prepare_input($string) { if (is_string($string)) { return trim(stripslashes($string)); } elseif (is_array($string)) { reset($string); while (list($key, $value) = each($string)) { $string[$key] = tep_db_prepare_input($value); } return $string; } else { return $string; } } Link to comment Share on other sites More sharing options...
kontraktr Posted September 3, 2005 Share Posted September 3, 2005 Thanks a lot Dave. :thumbsup: I put correct database.php file and now it works great. Thanks again! Link to comment Share on other sites More sharing options...
Guest Posted April 9, 2006 Share Posted April 9, 2006 Thanks Dave! Genius like you make our life easier!! :D Link to comment Share on other sites More sharing options...
Guest Posted January 23, 2008 Share Posted January 23, 2008 I was referred to this thread by another for this fix...........however, I don't see the code that's posted in product_info.php........is this supposed to be inserted in /catalog/product_info.php??? or another file?? :blink: Thanks Dave! Genius like you make our life easier!! :D Link to comment Share on other sites More sharing options...
ianric Posted January 8, 2009 Share Posted January 8, 2009 I was referred to this thread by another for this fix...........however, I don't see the code that's posted in product_info.php........is this supposed to be inserted in /catalog/product_info.php??? or another file?? :blink: Hi Another thanks to Dave. The eval function worked for me straight off. There is another thread similar to this here and as mentioned by Germ Offhand, I'd say to change this line: <p><?php echo stripslashes($product_info['products_description']); ?></p> To: <p><?php eval (' ?> ' . $product_info['products_description'] . ' <?php '); ?></p> Thought I'd just clarify so if anyone else needs this, it's all in one post. You need to change the above code in the catalog/product_info.php file around line 120 on a default install of 2.2Rc2a Cheers Ian Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.