lovemyseo Posted March 2, 2015 Share Posted March 2, 2015 Hi is it possible that we can display html tags e.g bullets numbers , bg color font color enable it on product listing page prestashop ? just like it works on product detail page ? Link to comment Share on other sites More sharing options...
Dh42 Posted March 3, 2015 Share Posted March 3, 2015 You would have to edit your template to do it. More than likely your template is stripping it. In the product list find this {$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'} and replace it with this {$product.description_short|truncate:360:'...'} Link to comment Share on other sites More sharing options...
lovemyseo Posted March 3, 2015 Author Share Posted March 3, 2015 (edited) You would have to edit your template to do it. More than likely your template is stripping it. In the product list find this {$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'} and replace it with this {$product.description_short|truncate:360:'...'} It removes the whole text from product listing page http://lovemyseo.com/presta/3-music-ipods I did followinf but its displays tags isntad of fisplaying number <p class="product-desc itemprop="description_short"> {$product.description_short|escape:'html':'UTF-8'|truncate:360:'...'} </p> Edited March 3, 2015 by lovemyseo (see edit history) Link to comment Share on other sites More sharing options...
khejit68 Posted March 9, 2015 Share Posted March 9, 2015 Find this line in product-list.tpl in main directory of your theme: <p class="product-desc" itemprop="description"> {$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'} </p> and change it to: <div class="product-desc" itemprop="description"> {$product.description_short|truncate:360:'...'} </div> Then navigate to your theme's js folder and in global.js file find: html += '<p class="product-desc">'+ $(element).find('.product-desc').html() + '</p>'; and change it to: html += '<div class="product-desc">'+ $(element).find('.product-desc').html() + '</div>'; This first line should be there twice, change both. You may have to do additional styling, for example add list-style-type: circle; in css for ul to make bullets appear for list. Link to comment Share on other sites More sharing options...
lovemyseo Posted March 15, 2015 Author Share Posted March 15, 2015 (edited) Find this line in product-list.tpl in main directory of your theme: and change it to: Then navigate to your theme's js folder and in global.js file find: and change it to: This first line should be there twice, change both. You may have to do additional styling, for example add list-style-type: circle; in css for ul to make bullets appear for list. Perfect Worked like charm , great solution, I didnt even have to touch global.css got it working with first change <div class="product-desc" itemprop="description"> {$product.description_short|truncate:360:'...'} </div> Please admin mark it as solved Edited March 15, 2015 by lovemyseo (see edit history) Link to comment Share on other sites More sharing options...
webmasterBS Posted June 11, 2015 Share Posted June 11, 2015 khejit68, lovemyseo : did you tried it on 1.6.x version? Your posts are quite recent but I did what suggested on my latest Presta installation and it did nothing, html tags are still ignored :/ Link to comment Share on other sites More sharing options...
lovemyseo Posted June 11, 2015 Author Share Posted June 11, 2015 Perfect Worked like charm , great solution, I didnt even have to touch global.css got it working with first change <div class="product-desc" itemprop="description"> {$product.description_short|truncate:360:'...'} </div> Please admin mark it as solved khejit68, lovemyseo : did you tried it on 1.6.x version? Your posts are quite recent but I did what suggested on my latest Presta installation and it did nothing, html tags are still ignored :/ DId work for me on 1.6.0.14 which theme u r using? Link to comment Share on other sites More sharing options...
webmasterBS Posted June 12, 2015 Share Posted June 12, 2015 Thank you for your quick answer Indeed removing "strip_tags" as mentioned above works like a charm! I did it on default bootstrap theme. Solution to my problem laid elswhere, I just had too long short_description in CSV Increasing max characters in the Back Office resolved the issue. (menu Preferences>Products>in the first section there is a field to change it) Link to comment Share on other sites More sharing options...
khejit68 Posted July 20, 2015 Share Posted July 20, 2015 (edited) I encountered bug on this solution. If there are html tags involved and smarty's truncate:360 is still on place, in some cases buttons "add to cart", "quick view" etc are doubled. These cases are when smarty tries to truncate in the middle of html code, which is counted with the rest of short description. Solutions: 1) Remove truncate function: <div class="product-desc" itemprop="description"> {$product.description_short} </div> 2) If you still want to truncate, change '360' value to something else, for example: <div class="product-desc" itemprop="description"> {$product.description_short|truncate:760:'...'} </div> But this will apply to all of your short descriptions, so be careful, and check the result for every product on listing Edited July 20, 2015 by khejit68 (see edit history) Link to comment Share on other sites More sharing options...
lovemyseo Posted May 26, 2017 Author Share Posted May 26, 2017 Find this line in product-list.tpl in main directory of your theme: and change it to: Then navigate to your theme's js folder and in global.js file find: and change it to: This first line should be there twice, change both. You may have to do additional styling, for example add list-style-type: circle; in css for ul to make bullets appear for list. I am IN Ps 1.6.1.11 line breaks worked but bullets not appearing? any clue can you check this code line for me it kidn of work but breaks category page too<div id="short_description_content" class="rte align_justify"><p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|strip_tags:'UTF-8'|truncate:360:''}"></a>{$product.description_short}</p></div> </div> using the first one you provided line breaks worked but no bullets Link to comment Share on other sites More sharing options...
Recommended Posts