Jump to content

Presta 1.7 - Product page - Hook - Product Description


Recommended Posts

Hello all,

 

I am having issues with product description in prestashop 1.7

 

I have a module which hooks into the product page and displays the product description.

However it works fine, but it keeps showing HTML tags in the text like "<br>, <p>, ..." nothing what i try does solve the issue.

The code works in prestashop 1.6

 

Things i have tried:

  • {$product->description}
  • {html_entity_decode($product->description)}
  • {$product->description|escape:'htmlall':'UTF-8'}
  • {html_entity_decode($product->description|escape:'htmlall':'UTF-8')}

 

Original code:

{if isset($product) && $product->description}
<div aria-expanded="true" class="tab-pane fade active in" id="tab1">
    <div class="product-description">
        <p>{html_entity_decode($product->description|escape:'htmlall':'UTF-8')}</p>
    </div>
</div>
{/if}

Share this post


Link to post
Share on other sites

Yeah tried that one to, but it removes the tags, so when customers use for instance "<iframe> it will not be displayed since the tags are removed.

Share this post


Link to post
Share on other sites

This did the job {$product->description nofilter}, the HTML code is being displayed correctly now

{if isset($product) && $product->description}
<div aria-expanded="true" class="tab-pane fade active in" id="tab1">
    <div class="product-description">
        <p>{$product->description nofilter}</p>
    </div>
</div>
{/if}
Edited by Crezzur (see edit history)

Share this post


Link to post
Share on other sites
  • 2 years later...

Hi,

 

I am currently struggling with this on 1.7.

i have tried these:

            {$product.instructions|escape:'htmlall':'UTF-8'}

            {$product.instructions|escape:'html':'UTF-8'}

            {$product.instructions|escape:'escape:'striptags':'UTF-8'}

 

but every time it leaves behind <b> and </b> and </br> all over the page.

 

Any ideas?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More