O
O
Otrivin2017-09-15 17:41:54
PHP
Otrivin, 2017-09-15 17:41:54

How to display unprocessed product description in opencart?

Good afternoon.
In the product card, in the "quick view" and in the category, a description of the product is displayed, previously cleaned from html tags. Thus, for example, an unlabeled list with ingredients is merged into one line.
In the product card, I solved this problem by simply replacing the operator

echo utf8_substr(strip_tags(html_entity_decode($description, ENT_QUOTES, 'UTF-8')), 0, 199)
on
echo $description.
In "quick view" and category, this magic will not work.
I found the variable responsible for the description in the file \catalog\controller\product\quick_view.php and added one more, descriptionraw:
$data['description'] = utf8_substr(strip_tags(html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8')), 0, 250);
$data['descriptionraw'] = $product_info['description'];

and in the template I display it, but the maximum I could achieve was the output of html tags converted to utf-8 ( &lt;li&gt;угорь, displayed in the browser as ) I want to ask: how to display the raw, raw value of the "product description" containing the html code?<li>угорь

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan, 2017-09-15
@Otrivin

Well, just try to remove this strip_tags tag removal function:
It worked for me...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question