- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
Prestashop 1.6.x. How to make HTML tags show up in product description
November 18, 2015
Hello! This video tutorial shows how to make HTML tags show up in products description in Prestashop.
Prestashop 1.6.x. How to make HTML tags show up in product description
You may face the issue when you are trying to style some text for product description using editor and changes are not applied on the product listing pages:
This happens because HTML tags are stripped in products description by default.
Let’s learn how to force HTML tags to be displayed.
-
Using your FTP/hosting control panel File Manager navigate to /themes/themeXXXX/ directory (where XXXX is your theme number).
-
Locate the product-list.tpl file and open it for editing:
-
Now, use CTRL+F/CMND+F key (Windows OS/Mac OS) to find the “product-desc” text:
You will see two lines of code below the “product-desc” class:
<span class="list-desc">{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}</span> <span class="grid-desc">{$product.description_short|strip_tags:'UTF-8'|truncate:100:'...'}</span>
The first line of code corresponds to “List” listing view, the second one – the “Grid” listing view.
Let’s say you want to allow HTML tags to be displayed for both listing views.
Simply remove the strip_tags string so the code look as follows:
<span class="list-desc">{$product.description_short|truncate:360:'...'}</span> <span class="grid-desc">{$product.description_short|truncate:100:'...'}</span>
Do not forget to save the file to apply changes:
Open the product listing page on your store front-end and refresh it.
You can see the description text is now styled:
This is the end of the tutorial. You have learnt how to force HTML tags to be displayed in products description in your Prestashop store.
Feel free to check the detailed video tutorial below:
Prestashop 1.6.x. How to make HTML tags show up in product description