Guest Posted March 23, 2007 Posted March 23, 2007 Hi, I was wondering if it would be possible to use PHP's function 'nl2br' to add line breaks to the product description when adding a product? I find it frustrating to have to manualy type in <br /> tags. If I added something like this to the relevant page the line breaks would automatically be added: $productdescription= nl2br($productdescription); Can anyone possibly give me any advice on which page to add this to and what variable name the product description is stored in?
soregonmale Posted March 23, 2007 Posted March 23, 2007 I was wondering the same thing!!! Otherwise those product descriptions look like... ummmm... crud!! :D
Guest Posted March 23, 2007 Posted March 23, 2007 I'm guessing that I need to make the mod at around line 357 of admin/categories.php Can anyone verify this?
Guest Posted March 23, 2007 Posted March 23, 2007 Actually line 296 looks more like it: while ($description = tep_db_fetch_array($description_query)) { tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_url']) . "', '0')"); }
squalid Posted March 24, 2007 Posted March 24, 2007 why not just add a wysiwyg editor to deal with product descriptions ?
Guest Posted March 26, 2007 Posted March 26, 2007 OScommerce is one of the most popular shopping cart solutuions available, surely Im not the only one who sees this as a problem? Can anyone with a little more experience with PHP lend a hand, please?
emilyjem Posted April 1, 2007 Posted April 1, 2007 I have implemented something similar, but at the point when osCommerce displays the description. This means that anyone editing it doesn't have to deal with any HTML code, and the code won't interfere with searches etc. I changed the following line in "product_info.php" (around line 120): FROM: <p><?php echo stripslashes($product_info['products_description']); ?></p> TO: <p><?php echo nl2br(stripslashes($product_info['products_description'])); ?></p> Hope this helps!
The ANT man Posted November 6, 2010 Posted November 6, 2010 I have implemented something similar, but at the point when osCommerce displays the description. This means that anyone editing it doesn't have to deal with any HTML code, and the code won't interfere with searches etc. I changed the following line in "product_info.php" (around line 120): FROM: <p><?php echo stripslashes($product_info['products_description']); ?></p> TO: <p><?php echo nl2br(stripslashes($product_info['products_description'])); ?></p> Hope this helps! exactly what i needed, many thanks!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.