[Skip to main content](#vessel-content)

#   Show custom fields in the front end

##

- **[dyvymtvar](/forum/user/7407-dyvymtvar "View dyvymtvar's Profile")**
- [![dyvymtvar's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7407-dyvymtvar "View dyvymtvar's Profile") Topic Author
- [ Offline](/forum/user/7407-dyvymtvar)

Less More

- Posts: 104
- Thank you received: 0
-
-

13 years 8 months ago -  13 years 8 months ago [\#91808](#91808) by [dyvymtvar](/forum/user/7407-dyvymtvar "View dyvymtvar's Profile")  *[Show custom fields in the front end](/forum/2-general-talk-about-hikashop/78698-show-custom-fields-in-the-front-end#91808 "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 &amp; 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.")* was created by *[dyvymtvar](/forum/user/7407-dyvymtvar "View dyvymtvar's Profile")*

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 &amp; 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 8 months ago by [dyvymtvar](/forum/user/7407-dyvymtvar "View dyvymtvar's Profile"). 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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc4Njk4LXNob3ctY3VzdG9tLWZpZWxkcy1pbi10aGUtZnJvbnQtZW5kP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

13 years 8 months ago -  13 years 8 months ago [\#91999](#91999) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Show custom fields in the front end](/forum/2-general-talk-about-hikashop/78698-show-custom-fields-in-the-front-end#91999 "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 &amp; 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.")*

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 8 months ago by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc4Njk4LXNob3ctY3VzdG9tLWZpZWxkcy1pbi10aGUtZnJvbnQtZW5kP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86560
- Thank you received: 14307
-
-

13 years 8 months ago [\#92282](#92282) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Show custom fields in the front end](/forum/2-general-talk-about-hikashop/78698-show-custom-fields-in-the-front-end#92282 "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 &amp; 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.")*

Hi,

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

before the line:
if (!empty ($variant-&gt;$fieldName)) {

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc4Njk4LXNob3ctY3VzdG9tLWZpZWxkcy1pbi10aGUtZnJvbnQtZW5kP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[dyvymtvar](/forum/user/7407-dyvymtvar "View dyvymtvar's Profile")**
- [![dyvymtvar's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/7407-dyvymtvar "View dyvymtvar's Profile") Topic Author
- [ Offline](/forum/user/7407-dyvymtvar)

Less More

- Posts: 104
- Thank you received: 0
-
-

13 years 8 months ago [\#92440](#92440) by [dyvymtvar](/forum/user/7407-dyvymtvar "View dyvymtvar's Profile")  Replied by *[dyvymtvar](/forum/user/7407-dyvymtvar "View dyvymtvar's Profile")* on topic *[Show custom fields in the front end](/forum/2-general-talk-about-hikashop/78698-show-custom-fields-in-the-front-end#92440 "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 &amp; 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.")*

Thanks nicolas now it works.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzc4Njk4LXNob3ctY3VzdG9tLWZpZWxkcy1pbi10aGUtZnJvbnQtZW5kP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.054 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
