Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Product Description Line Breaks


Recommended Posts

A good feature, if possible, for osCommerce to have would be the ability to process line breaks in the Product Description text box from Admin to be recognized as HTML line breaks on the actual store.


Currently, for example, if you input the following into the Product Description in admin:


Small T-Shirt

100% Cotton

Red Color


It comes out in the store as:


Small T-Shirt 100% Cotton Red Color


Anyone know a way around this other than manually typing in <br> at every line break?

Link to comment
Share on other sites

When you put a line break in the product description, it actually puts a \n in the database. You could change the \n to a <br> on the fly when you echo the product description.


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.

Link to comment
Share on other sites



change from this:


<p><?php echo stripslashes($product_info['products_description']); ?></p>


to this:


<p><?php echo nl2br(stripslashes($product_info['products_description'])); ?></p>

Link to comment
Share on other sites


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

  • Create New...