By default, Shopware does not use HTML formatting in the product listing. This is inconvenient when you have different, independent pieces of information in the product description that you naturally want to display in a structured way.
For example: the product name, the manufacturer, a product description, and the place of origin. Without HTML formatting, all of this is displayed in the listing without formatting or line breaks, one item after another. We will now show you how to enable HTML formatting in the listing.
First, go to the directory:
/themes/Frontend/Bare/frontend/listing/product-box
and open the
Box-basic.tpl
file. In the next step, search this file for:
{* Product description *}
{block name='frontend_listing_box_article_description'}
{$sArticle.description_long|strip_tags|truncate:240}
{/block}
and replace the following line
{$sArticle.description_long|strip_tags|truncate:240}
with
{strip_tags($sArticle.description_long|truncate:240,"<p><strong>") nofilter}
Save the file. The <p> and <strong> tags can be supplemented with additional HTML tags that you want to use to format your text.
As the final step, open the following directory:
/engine/Shopware/Core
and open the
sArticles.php
file. In this file, search for
$article['description_long'] = $this->sOptimizeText($article['description_long']);
Comment out or delete this line from the file and save it again.
As with any change, don't forget to clear the browser cache and the Shopware backend cache at the end.
