After saving the product from front end - styling of custom fields gets erased

  • Posts: 3
  • Thank you received: 0
5 years 9 months ago #303984

Hi,
I found a peculiar bug.

Here's the situation:

Our vendors can add some information about the product in a custom field.
When they do add text in the field (front-end), it gets printed to the product page (Caractéristiques).
For this print, everything is ok - the style is kept.

The issue comes when we want to echo this custom field again (under the title, at the top of the product page).
When the vendor adds the text, it doesn't keep the styling in the second echo (the one at the top of the page).
The thing is, when we do it through the administration, it keeps the styling.

I have no idea how to start debugging this.

The styling I'm talking about is some bullet points (ul and li).

Here's the code that echoes the custom field again at the top of the page:

<?php
    if (!empty ($this->element->product_particularites)) {
        echo '<p>' . $this->element->product_particularites . '</p>';
    }
?>

There might be something wrong with that code.

Here are some visuals about this issue.
https://imgur.com/hzRWz11 Here it works
https://imgur.com/euOERmd Where it comes from
https://imgur.com/KqQXcrg View of the vendor
https://imgur.com/ixPEuU6 The result
https://imgur.com/rLYDMkV The result in code

Thanks!

Last edit: 5 years 9 months ago by solishop.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
5 years 9 months ago #303985

Hi,

You want to turn off the "input filtering" setting of your custom field so that you allow HTML tags on the frontend.

Please Log in or Create an account to join the conversation.

  • Posts: 3
  • Thank you received: 0
5 years 9 months ago #304006

Thanks you, it worked! Apparently it wasn't a bug but a feature.

Have a nice day.

Please Log in or Create an account to join the conversation.

Time to create page: 0.074 seconds
Powered by Kunena Forum