Online Office USA Posted January 26, 2012 Share Posted January 26, 2012 Hello. In trying different layouts and content presentation I decided that I like to have more content in the Short Description as bullet points as opposed to the normal few sentences. The problem I'm having is that the Product List Short Description is also affected as you can see in the images. I would like to be able to truncate the description on the Product List page if possible. I see the code in product_list.tpl that I would have thought would do the trick but making changes didn't have any results. Using version 1.4.6.2 with prestashop_new theme Thanks! Link to comment Share on other sites More sharing options...
_matis_ Posted January 26, 2012 Share Posted January 26, 2012 Hi, in file product-list.tpl find {$product.description_short|truncate:360:'...'|strip_tags:'UTF-8'} and remove strip_tags: {$product.description_short|truncate:360:'...'} Link to comment Share on other sites More sharing options...
Online Office USA Posted January 26, 2012 Author Share Posted January 26, 2012 Hi, in file product-list.tpl find {$product.description_short|truncate:360:'...'|strip_tags:'UTF-8'} and remove strip_tags: {$product.description_short|truncate:360:'...'} Thanks for the input but unfortunately that didn't do it... Link to comment Share on other sites More sharing options...
tdr170 Posted January 26, 2012 Share Posted January 26, 2012 I also wanted the short desription in product list to be the same as product view but was unable to get an answer. I tried the above but the product list view did not change. I hope we are talking about the same thing. Changed this <p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}">{$product.description_short|truncate:360:'...'|strip_tags:'UTF-8'}</a></p> To this <p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|truncate:360:'...'}">{$product.description_short|truncate:360:'...'}</a></p> Link to comment Share on other sites More sharing options...
_matis_ Posted January 26, 2012 Share Posted January 26, 2012 It is working solution (tested). And there is no need to remove strip_tags from the title attribute. <p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|truncate:360:'...'|strip_tags:'UTF-8'|escape:'htmlall':'UTF-8'}">{$product.description_short|truncate:360:'...'}</a></p> 1 Link to comment Share on other sites More sharing options...
tdr170 Posted January 26, 2012 Share Posted January 26, 2012 OK I did get this to work, I forgot to Force Compile as soon as I did that I had an ordered list. Thanks so much. Link to comment Share on other sites More sharing options...
Online Office USA Posted January 27, 2012 Author Share Posted January 27, 2012 Thanks...I have my solution Link to comment Share on other sites More sharing options...
stevent Posted October 4, 2014 Share Posted October 4, 2014 It is working solution (tested). And there is no need to remove strip_tags from the title attribute. <p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|truncate:360:'...'|strip_tags:'UTF-8'|escape:'htmlall':'UTF-8'}">{$product.description_short|truncate:360:'...'}</a></p> When i to this with 1.6, the result is : " undefined" :'( anybody can help me for this?? http://www.arthostechnics.com/catalogue/fr/12-nos-produits thank you verry much Link to comment Share on other sites More sharing options...
RemcoDr Posted October 6, 2015 Share Posted October 6, 2015 Same here.. 1.6 not working Link to comment Share on other sites More sharing options...
oxygenuk Posted December 15, 2015 Share Posted December 15, 2015 this does not work with 1.6 any ideas? Link to comment Share on other sites More sharing options...
andrw Posted September 4, 2016 Share Posted September 4, 2016 (edited) Try this: <div class="product-desc" itemprop="description"> {$product.description_short|truncate:360:'...'} </div> So basically you have to remove the strip_tags thing and replace the p html tag with a div. Hope it helps. Edited September 4, 2016 by andrw (see edit history) Link to comment Share on other sites More sharing options...
pegasus6464 Posted April 11, 2017 Share Posted April 11, 2017 my product list. tpl contains: <p class="product-desc" itemprop="description"> {$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'} </p> but in the frontend the value appears as undefined , I'm using PS 1.6.1.0 anyone knows the reason? THANKS! i also try <div class="product-desc" itemprop="description"> {$product.description_short|truncate:360:'...'}</div> wihout <p></p> but also appears "undefined" Link to comment Share on other sites More sharing options...
TempFail Posted June 10, 2017 Share Posted June 10, 2017 <div class="product-desc" itemprop="description"> {$product.description_short|truncate:360:'...'} </div> Worked. I have 1.6.1.14. Have you forced template recompilation? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now