Jump to content

New line in product list - short description


gregor123

Recommended Posts

Hi,

 

Anyone maybe knows how to make new line in product list description, so it will look the same as short description at product review.

 

I want to have same text with new lines in product review description and product list description. When I write product description and when i check it out in product list there are no lines in product description, it replaces "new line" with "space".

 

i have prestashop 1.4.7

post-355305-0-60863800-1335359266_thumb.png

Link to comment
Share on other sites

  On 4/25/2012 at 1:08 PM, gregor123 said:

Hi,

 

Anyone maybe knows how to make new line in product list description, so it will look the same as short description at product review.

 

I want to have same text with new lines in product review description and product list description. When I write product description and when i check it out in product list there are no lines in product description, it replaces "new line" with "space".

 

i have prestashop 1.4.7

 

I think you have to enable short description html, to do so edit product-list.tpl file and remove " |strip_tags:'UTF-8' " from " {$product.description_short|truncate:360:'...'|strip_tags:'UTF-8'} "

Link to comment
Share on other sites

  On 4/25/2012 at 4:18 PM, gregor123 said:

hmm it works... but it also moves the price under description and also "add to cart" and "view" button under the picture

well, you have to modify css and/or layout in product-list.tpl file...

Link to comment
Share on other sites

  • 7 months later...
  On 4/25/2012 at 1:52 PM, doubleD said:

I think you have to enable short description html, to do so edit product-list.tpl file and remove " |strip_tags:'UTF-8' " from " {$product.description_short|truncate:360:'...'|strip_tags:'UTF-8'} "

 

Does not work for me!

{$product.description_short|truncate:360:'...'}

 

Also does not work.

{$product.description_short|replace:' ':' '}

 

Printing {$product.description_short} Gives me the string with   spaces. In the DB the string has no  

 

What i have to do?? :(

Link to comment
Share on other sites

  • 2 months later...

I know this topic is already a few months old, but maybe someone encouters the same problem.

I solved it by editing product-list.tpl and changing

{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}

(around line 45)

to

{strip_tags($product.description_short,'<br>')|truncate:360:'...'}

 

This strips everything except the newlines.

  • Like 2
Link to comment
Share on other sites

  • 7 months later...
  • 2 weeks later...
  On 11/30/2012 at 9:53 AM, Publisher said:

Does not work for me!

{$product.description_short|truncate:360:'...'}

 

Also does not work.

{$product.description_short|replace:' ':' '}

 

Printing {$product.description_short} Gives me the string with   spaces. In the DB the string has no  

 

What i have to do?? :(

 

Great! thank you!

Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...