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

#   Custom fields not populated correctly in variants!

##

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

Less More

- Posts: 173
- Thank you received: 8
-
-

6 years 5 months ago [\#320828](#320828) by [ianspeed](/forum/user/1602-ianspeed "View ianspeed's Profile")  *[Custom fields not populated correctly in variants!](/forum/32-content-creation/900188-custom-fields-not-populated-correctly-in-variants#320828 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : latest -- PHP version -- : 7.2 -- Browser(s) name and version -- : All  I have discovered that custom fields are not getting repopulated within the variants of the product. When you save the variant the custom fields default back to the first custom field values. When you save a variant with a different set of custom fields the values save to the database okay, but the values aren't brought back to that variant, it brings the first one that was done. So if you go in to variant number 3 the custom fields are now reset and will be updated incorrectly if you save that variant, also if you go in to the variant and come out to the main product and save the product that variant gets updated with the incorrect custom field information...")* was created by *[ianspeed](/forum/user/1602-ianspeed "View ianspeed's Profile")*

-- HikaShop version -- : 4.3.0
-- Joomla version -- : latest
-- PHP version -- : 7.2
-- Browser(s) name and version -- : All

I have discovered that custom fields are not getting repopulated within the variants of the product.
When you save the variant the custom fields default back to the first custom field values. When you save a variant with a different set of custom fields the values save to the database okay, but the values aren't brought back to that variant, it brings the first one that was done. So if you go in to variant number 3 the custom fields are now reset and will be updated **incorrectly** if you save that variant, also if you go in to the variant and come out to the main product and save the product that variant gets updated with the incorrect custom field information...

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vOTAwMTg4LWN1c3RvbS1maWVsZHMtbm90LXBvcHVsYXRlZC1jb3JyZWN0bHktaW4tdmFyaWFudHM/dG1wbD1tYXJrZG93bg==) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

6 years 5 months ago [\#320895](#320895) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom fields not populated correctly in variants!](/forum/32-content-creation/900188-custom-fields-not-populated-correctly-in-variants#320895 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : latest -- PHP version -- : 7.2 -- Browser(s) name and version -- : All  I have discovered that custom fields are not getting repopulated within the variants of the product. When you save the variant the custom fields default back to the first custom field values. When you save a variant with a different set of custom fields the values save to the database okay, but the values aren't brought back to that variant, it brings the first one that was done. So if you go in to variant number 3 the custom fields are now reset and will be updated incorrectly if you save that variant, also if you go in to the variant and come out to the main product and save the product that variant gets updated with the incorrect custom field information...")*

Hi,

I tried to reproduce the issue on my end, but I'm not able to.
When I edit a variant for the first time, the custom field is always empty. And if I edit a variant for which I already have a value in the custom field, I get that value in the custom field.
And when I enter a value in the custom field, whether it is for a new variant or not, and save the variant, I do get the value saved and it appears in the custom field after the save too for that variant.

Could you maybe provide some screenshots and step by step instructions to reproduce the problem ?
Do you have many custom product fields ?
Maybe a backend access will be necessary to reproduce the issue as I'm thinking it might be something linked with the variant not being saved because a required custom field is not filled in or something and it might not be for the custom field you're doing your test on. If you need to provide the access privately, you can do so via our contact form:
[ www.hikashop.com/support/contact-us.html](https://www.hikashop.com/support/contact-us.html)

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

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

Less More

- Posts: 173
- Thank you received: 8
-
-

6 years 5 months ago [\#320950](#320950) by [ianspeed](/forum/user/1602-ianspeed "View ianspeed's Profile")  Replied by *[ianspeed](/forum/user/1602-ianspeed "View ianspeed's Profile")* on topic *[Custom fields not populated correctly in variants!](/forum/32-content-creation/900188-custom-fields-not-populated-correctly-in-variants#320950 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : latest -- PHP version -- : 7.2 -- Browser(s) name and version -- : All  I have discovered that custom fields are not getting repopulated within the variants of the product. When you save the variant the custom fields default back to the first custom field values. When you save a variant with a different set of custom fields the values save to the database okay, but the values aren't brought back to that variant, it brings the first one that was done. So if you go in to variant number 3 the custom fields are now reset and will be updated incorrectly if you save that variant, also if you go in to the variant and come out to the main product and save the product that variant gets updated with the incorrect custom field information...")*

Hi Nicolas,
It's still doing it. If I add weights to the variant and save, it's overwriting the previous values for the custom fields as this is what i has brought in on loading the variant. Here are the screen shots.

Effectively this means I have to set the custom fields again each time I make an amendment to the variant.

Thanks

Ian  [ ![Example1Changecustomfield&#95;2020-06-18-2.jpg](/forum/attachment/49790) ](/forum/attachment/49790 "...20-06-18-2.jpg")

[ ![Example1bAfterclickingsaveonvariant&#95;2020-06-18-2.jpg](/forum/attachment/49791) ](/forum/attachment/49791 "...20-06-18-2.jpg")

[ ![Example2variantcustomfieldsetto60x40beforesave&#95;2020-06-18-2.jpg](/forum/attachment/49792) ](/forum/attachment/49792 "...20-06-18-2.jpg")

[ ![example2baftersavevariantcustomfieldhasresetfrom60x40backto17x12&#95;2020-06-18-2.jpg](/forum/attachment/49793) ](/forum/attachment/49793 "...20-06-18-2.jpg")

- [ ![Example1Changecustomfield&#95;2020-06-18-2.jpg](/forum/attachment/49790) ](/forum/attachment/49790 "...20-06-18-2.jpg") [ ](/forum/attachment/49790?download=1 "...20-06-18-2.jpg")
- [ ![Example1bAfterclickingsaveonvariant&#95;2020-06-18-2.jpg](/forum/attachment/49791) ](/forum/attachment/49791 "...20-06-18-2.jpg") [ ](/forum/attachment/49791?download=1 "...20-06-18-2.jpg")
- [ ![Example2variantcustomfieldsetto60x40beforesave&#95;2020-06-18-2.jpg](/forum/attachment/49792) ](/forum/attachment/49792 "...20-06-18-2.jpg") [ ](/forum/attachment/49792?download=1 "...20-06-18-2.jpg")
- [ ![example2baftersavevariantcustomfieldhasresetfrom60x40backto17x12&#95;2020-06-18-2.jpg](/forum/attachment/49793) ](/forum/attachment/49793 "...20-06-18-2.jpg") [ ](/forum/attachment/49793?download=1 "...20-06-18-2.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vOTAwMTg4LWN1c3RvbS1maWVsZHMtbm90LXBvcHVsYXRlZC1jb3JyZWN0bHktaW4tdmFyaWFudHM/dG1wbD1tYXJrZG93bg==) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

6 years 5 months ago [\#320966](#320966) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom fields not populated correctly in variants!](/forum/32-content-creation/900188-custom-fields-not-populated-correctly-in-variants#320966 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : latest -- PHP version -- : 7.2 -- Browser(s) name and version -- : All  I have discovered that custom fields are not getting repopulated within the variants of the product. When you save the variant the custom fields default back to the first custom field values. When you save a variant with a different set of custom fields the values save to the database okay, but the values aren't brought back to that variant, it brings the first one that was done. So if you go in to variant number 3 the custom fields are now reset and will be updated incorrectly if you save that variant, also if you go in to the variant and come out to the main product and save the product that variant gets updated with the incorrect custom field information...")*

Hi,

Could you provide a screenshot of the settings of the custom field ? Since I'm not able to reproduce the issue on my end, maybe it's because it only happens in some rare cases based on some combination of settings.

The following user(s) said Thank You: [ianspeed](/forum/user/1602-ianspeed "View ianspeed's Profile")

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

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

Less More

- Posts: 173
- Thank you received: 8
-
-

6 years 5 months ago [\#320973](#320973) by [ianspeed](/forum/user/1602-ianspeed "View ianspeed's Profile")  Replied by *[ianspeed](/forum/user/1602-ianspeed "View ianspeed's Profile")* on topic *[Custom fields not populated correctly in variants!](/forum/32-content-creation/900188-custom-fields-not-populated-correctly-in-variants#320973 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : latest -- PHP version -- : 7.2 -- Browser(s) name and version -- : All  I have discovered that custom fields are not getting repopulated within the variants of the product. When you save the variant the custom fields default back to the first custom field values. When you save a variant with a different set of custom fields the values save to the database okay, but the values aren't brought back to that variant, it brings the first one that was done. So if you go in to variant number 3 the custom fields are now reset and will be updated incorrectly if you save that variant, also if you go in to the variant and come out to the main product and save the product that variant gets updated with the incorrect custom field information...")*

The problem is the last custom field "Size only", it gets updated with the generic data from the product, ie. the default value (12x17"). The custom field keeps reverting back to 12x17" every time.

I can see when you have been testing because you have changed the custom fields and they show on the front end.
I have sent you a video as I could not upload it here. It shows the error happening.

It appears that the field is using the default value form the custom field for some reason.

So whatever I set the "size only" custom field to in the variant, it always reverts back to the default value (12x17") of the custom field when you save.

Thanks

Ian

- [ ![Customfieldsarebacktodefaultproductcustomfields.jpg](/forum/attachment/49796) ](/forum/attachment/49796 "...stomfields.jpg") [ ](/forum/attachment/49796?download=1 "...stomfields.jpg")
- [ ![frontendwithcustomfields&#95;2020-06-19.jpg](/forum/attachment/49797) ](/forum/attachment/49797 "...2020-06-19.jpg") [ ](/forum/attachment/49797?download=1 "...2020-06-19.jpg")
- [ ![frontupdatedwithwronginfo.jpg](/forum/attachment/49798) ](/forum/attachment/49798 "...hwronginfo.jpg") [ ](/forum/attachment/49798?download=1 "...hwronginfo.jpg")
- [ ![selectthisone.jpg](/forum/attachment/49799) ](/forum/attachment/49799 "selectthisone.jpg") [ ](/forum/attachment/49799?download=1 "selectthisone.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vOTAwMTg4LWN1c3RvbS1maWVsZHMtbm90LXBvcHVsYXRlZC1jb3JyZWN0bHktaW4tdmFyaWFudHM/dG1wbD1tYXJrZG93bg==) 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.066 seconds

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