- Posts: 3
- Thank you received: 0
After saving the product from front end - styling of custom fields gets erased
7 years 8 months ago - 7 years 8 months ago #303984
by solishop
[SOLVED] Styling of custom fields gets erased was created by solishop
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:
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!
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:
Code:
<?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: 7 years 8 months ago by solishop.
Please Log in or Create an account to join the conversation.
7 years 8 months ago #303985
by nicolas
Replied by nicolas on topic After saving the product from front end - styling of custom fields gets erased
Hi,
You want to turn off the "input filtering" setting of your custom field so that you allow HTML tags on the frontend.
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.
7 years 8 months ago #304006
by solishop
Replied by solishop on topic After saving the product from front end - styling of custom fields gets erased
Thanks you, it worked! Apparently it wasn't a bug but a feature.
Have a nice day.
Have a nice day.
Please Log in or Create an account to join the conversation.
Time to create page: 0.072 seconds