Quick and Easy Product Description Line Break Solution
#1
Posted 12 September 2003 - 06:05 AM
The issue that I had was in regards to how product_info.php displayed the description of the item. I would not display any of the line breaks. The suggestions that I have received were install the WYSIWYG contribution but I have made to many mods to the store so that will not work and its to time consuming to install.
Here is the solution that I came up with.
I created a function that converts n to a <BR> tag.
<?php
function nl2p($text) {
$text = ereg_replace("n", "<br>", $text);
return $text;
}
?>
and inserted that at about line 115 just above this call
($product_info_values['products_description'
I then added nlp2 just before it so the desc now looks like this
<?php echo nl2p ($product_info_values['products_description']); ?>
Works like a charm and I thought that I'd pass it along.
--Gary
#2
Posted 12 September 2003 - 02:58 PM
hth
#3
Posted 13 September 2003 - 03:40 AM
#4
Posted 13 September 2003 - 08:55 AM
#5
Posted 13 September 2003 - 12:31 PM
I also think this is a great little tip. Extremly usefull.
NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.
If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.
#6
Posted 09 January 2004 - 11:20 PM
Great Tip, works a treat.
Dereck
#7
Posted 06 February 2004 - 12:40 AM
#8
Posted 09 February 2004 - 02:39 PM
Just use:
<?php echo nl2br ($product_info_values['products_description']); ?>
No need for new functions then
p.s. Burt - only read your post after I posted this - you've already mentioned it I see - sorry.
Edited by Cerberus, 09 February 2004 - 02:40 PM.
#9
Posted 05 March 2004 - 07:26 AM
#10
Posted 05 March 2004 - 07:27 AM
#11
Posted 03 April 2004 - 04:26 PM
am i missing something here?
#12
Posted 04 April 2004 - 05:34 AM
dannyliem, on Apr 3 2004, 11:26 AM, said:
Hth,
Matt
#13
Posted 02 August 2004 - 03:14 AM
#14
Posted 08 August 2004 - 05:46 AM
Good old HTML.....what ever happen to it?
#15
Posted 10 September 2004 - 05:40 PM
#16
Posted 08 June 2006 - 03:26 PM
#18
Posted 10 August 2006 - 04:14 PM
#19
Posted 11 October 2011 - 01:00 PM










