Jump to content

How to change short description of product on page category


Recommended Posts

Hi

 

I work with theme default on prestashop 1.6.

 

I would like make a list for short description of product on page category. I would like the same presentation, in list, because when i need to read information, its more simple with list presentation.

 

I seach a answer on internet and i tried to do that myself but I have not succeeded.

 

If my explanation does not clear, please do not hesitate to ask me more details, because i have a bad english (im french its normal ^^)

 thanks in advance.

 

Cordially

Edited by viper2583 (see edit history)
Link to comment
Share on other sites

Hi,

 

it does not work

 

I think for create this presentation, prestashop use a js file (global.js) but I don't find where and how Prestashop make a list for page product, because in product.tpl he make this : 

 

{if $product->description_short}

<div id="short_description_content" class="rte align_justify" itemprop="description">{$product->description_short}</div>

{/if}

 

but where is code for create a list. Maybe if I find where he do something to create a list, I can copy it and do the same for category page.

 

Cordially  :)

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

 

If you want do the same modification you just need to delete "strip_tags:'UTF-8".

 

In file product.tpl, you need to find this line : 

 

{hook h='displayProductListReviews' product=$product}
<p class="product-desc" itemprop="description">
{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}
</p>

 

Delete tthe red text and tadahhhh !!! you have a list and not a block.

 

Do not hesitate if you have a question.

 

Cordially  :)

Link to comment
Share on other sites

remember that it can generate conflict in html markups

 

for example you've got code:

 

<div><p>This is my description</p></div>

 

 

then you use |truncate:20 modifier

 

code will be cutted after 20 chars

<div><p>This is my description</p></div>

 

 

<div><p> tags will be unclosed then!

it can affect website structure!

Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

In file product.tpl, you need to find this line : 

 

{hook h='displayProductListReviews' product=$product}
<p class="product-desc" itemprop="description">
{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}
</p>

 

Delete tthe red text and tadahhhh !!! you have a list and not a block.

 

 

Is this the solution to upload image in short description in product page?

Edited by divamvak (see edit history)
Link to comment
Share on other sites

  • 10 months later...

Hello,

 

I was wondering if it was possible to achieve that while avoiding the issue @vekia raised.

What I mean is, being able to only apply the "truncate" to the "text" part of the description.

If my truncate is set to 10, the description <div><p>This is my description</p></div> would then show "This is my" instead of "Th" like it currently works.

Would love to have a solution to that so if you have the start of an idea, please share with us :)

Thanks

Link to comment
Share on other sites

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...