- Posts: 104
- Thank you received: 0
Show custom fields in the front end
13 years 7 months ago - 13 years 7 months ago #91808
by dyvymtvar
Show custom fields in the front end was created 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.
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.
Less
More
- Posts: 12953
- Thank you received: 1778
13 years 7 months ago - 13 years 7 months ago #91999
by Mohamed Thelji
Replied by Mohamed Thelji on topic Show custom fields in the front end
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.
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.
13 years 7 months ago #92282
by nicolas
Replied by nicolas on topic Show custom fields in the front end
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 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.
13 years 7 months ago #92440
by dyvymtvar
Replied by dyvymtvar on topic Show custom fields in the front end
Thanks nicolas now it works.
Please Log in or Create an account to join the conversation.
Time to create page: 0.174 seconds