Jump to content

Product Feature value saved as html


Recommended Posts

Hello. How can I change type of the FeatureValue to html. I did override to class FeatureValue.php and change validation to: 'validate' => 'isCleanHtml'. I tried isAnything too. Form is now correctly submitted (no errors), but html is still truncated.
Where can I turn off removing html tags from this value? I want using <br> and <b> in feature value.


Link to comment
Share on other sites

Yeah. It's working. I found great post here: https://www.prestashop.com/forums/topic/298061-how-to-add-hyperlink-and-images-to-features/

In conclusion. To insert html tags to feature input, we need set 'type' => self::TYPE_NOTHING and 'validate' => 'isAnything' for value in lang fields in class FeatureValue.php.
To view with html we need to modify product.tpl template and remove escaping 'htmlall' like that: {$feature.value|escape:'htmlall':'UTF-8'}

Link to comment
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...