Categories

Featured templates

Prestashop 1.6.x. How to make HTML tags show up in product description

Andre Flores November 18, 2015
Rating: 4.0/5. From 4 votes.
Please wait...

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:

prestashop_1.6.x_force_html_tags_to_be_displayed_in_products_description_1

This happens because HTML tags are stripped in products description by default.

Let’s learn how to force HTML tags to be displayed.

  1. Using your FTP/hosting control panel File Manager navigate to /themes/themeXXXX/ directory (where XXXX is your theme number).

  2. Locate the product-list.tpl file and open it for editing:

    prestashop_1.6.x_force_html_tags_to_be_displayed_in_products_description_2

  3. Now, use CTRL+F/CMND+F key (Windows OS/Mac OS) to find the “product-desc” text:

    prestashop_1.6.x_force_html_tags_to_be_displayed_in_products_description_3

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>

prestashop_1.6.x_force_html_tags_to_be_displayed_in_products_description_4

Do not forget to save the file to apply changes:

prestashop_1.6.x_force_html_tags_to_be_displayed_in_products_description_5

Open the product listing page on your store front-end and refresh it.

You can see the description text is now styled:

prestashop_1.6.x_force_html_tags_to_be_displayed_in_products_description_6

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

Prestashop Premium Themes
This entry was posted in PrestaShop Tutorials and tagged description, HTML, Prestashop, product, tag. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket