delete-account-pleas Posted July 8, 2017 Share Posted July 8, 2017 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} Link to comment Share on other sites More sharing options...
vekia Posted July 8, 2017 Share Posted July 8, 2017 use |strip_tags modifier to remove the html code from variable Link to comment Share on other sites More sharing options...
delete-account-pleas Posted July 8, 2017 Author Share Posted July 8, 2017 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. Link to comment Share on other sites More sharing options...
delete-account-pleas Posted July 10, 2017 Author Share Posted July 10, 2017 (edited) 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 July 10, 2017 by Crezzur (see edit history) Link to comment Share on other sites More sharing options...
metalines Posted May 4, 2020 Share Posted May 4, 2020 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? Link to comment Share on other sites More sharing options...
metalines Posted May 4, 2020 Share Posted May 4, 2020 Actually, just tried nofilter and it works! well done guys you are heros! {$product.instructions nofilter} worked great! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now