Skip to main content

Show custom fields in the front end

More
13 years 7 months ago - 13 years 7 months ago #91808 by dyvymtvar
I have created some custom fields for a specific category but they don't show correctly in the front end.

I have a product with diferent colors and sizes (characteristics) and some custom fields. Some of them are required and other fields are not required.

When I open this product (for example Size:XL & Color: red) custom fields shows correctly but when I choose another color like blue I see all the custom fields, required or not and some of them are empty because they are a checkbox and the box is empty.

I do not want to see custom fields that are not required and the checkbox is empty.

How can I do?

Thanks.
Last edit: 13 years 7 months ago by dyvymtvar. Reason: Sorry I have had a mistake and this is not the correct forum. Please some moderator move it to the correct. Thanks.

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

More
13 years 7 months ago - 13 years 7 months ago #91999 by Mohamed Thelji
Hi,

Firstly, can you give us a link to your product page, then we'll maybe be able to figure out what the problem really is ?

Thank you.
Last edit: 13 years 7 months ago by Mohamed Thelji.

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

More
13 years 7 months ago #92282 by nicolas
Hi,

Please add the code:
if(!empty($variant->$fieldName)) $variant->$fieldName = trim($variant->$fieldName);

before the line:
if (!empty ($variant->$fieldName)) {

in the file 'show' of the view 'product' for your frontend template via the menu Display->Views and that should fix that problem.

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

More
13 years 7 months ago #92440 by dyvymtvar
Thanks nicolas now it works.

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

Time to create page: 0.174 seconds
Powered by Kunena Forum