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

#   Display same custom field value for variants

##

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

Less More

- Posts: 24
- Thank you received: 0
-
-

14 years 1 day ago [\#73254](#73254) by [wzyefd](/forum/user/9587-wzyefd "View wzyefd's Profile")  *[Display same custom field value for variants](/forum/4-how-to/73254-display-same-custom-field-value-for-variants#73254 "I have a question. When I choose a variant on main product page,the custom fields will disappear. I realized that I have to input values on variants' edit page again. If my variants have same values with main product, What can I do to save the repeat work that input the same values in variant edit page. So that the custom fields will show on main product page and variant page")* was created by *[wzyefd](/forum/user/9587-wzyefd "View wzyefd's Profile")*

I have a question.
When I choose a variant on main product page,the custom fields will disappear.
I realized that I have to input values on variants' edit page again.
If my variants have same values with main product,
What can I do to save the repeat work that input the same values in variant edit page.
So that the custom fields will show on main product page and variant page

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

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

Less More

- Posts: 24
- Thank you received: 0
-
-

14 years 2 hours ago [\#73511](#73511) by [wzyefd](/forum/user/9587-wzyefd "View wzyefd's Profile")  Replied by *[wzyefd](/forum/user/9587-wzyefd "View wzyefd's Profile")* on topic *[Re: Display same custom field value for variants](/forum/4-how-to/73254-display-same-custom-field-value-for-variants#73511 "I have a question. When I choose a variant on main product page,the custom fields will disappear. I realized that I have to input values on variants' edit page again. If my variants have same values with main product, What can I do to save the repeat work that input the same values in variant edit page. So that the custom fields will show on main product page and variant page")*

waiting for your replay!!

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

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

Less More

- Posts: 24
- Thank you received: 0
-
-

14 years 53 minutes ago [\#73518](#73518) by [wzyefd](/forum/user/9587-wzyefd "View wzyefd's Profile")  Replied by *[wzyefd](/forum/user/9587-wzyefd "View wzyefd's Profile")* on topic *[Re: Display same custom field value for variants](/forum/4-how-to/73254-display-same-custom-field-value-for-variants#73518 "I have a question. When I choose a variant on main product page,the custom fields will disappear. I realized that I have to input values on variants' edit page again. If my variants have same values with main product, What can I do to save the repeat work that input the same values in variant edit page. So that the custom fields will show on main product page and variant page")*

I have solved it by myself.
I modify this code in show_block_custom_main.php
&lt;div id="hikashop_product_custom_info_main" class="hikashop_product_custom_info_main"&gt;
to
&lt;div id="hikashop_product_custom_info_main1" class="hikashop_product_custom_info_main"&gt;
The custom fields will show on the main product and variants.
I don't know the reason , I thought it will cause other problems maybe.
Can someone could give me some advise?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzczMjU0LWRpc3BsYXktc2FtZS1jdXN0b20tZmllbGQtdmFsdWUtZm9yLXZhcmlhbnRzP3RtcGw9bWFya2Rvd24=) 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: 86316
- Thank you received: 14276
-
-

13 years 11 months ago [\#73593](#73593) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Display same custom field value for variants](/forum/4-how-to/73254-display-same-custom-field-value-for-variants#73593 "I have a question. When I choose a variant on main product page,the custom fields will disappear. I realized that I have to input values on variants' edit page again. If my variants have same values with main product, What can I do to save the repeat work that input the same values in variant edit page. So that the custom fields will show on main product page and variant page")*

Hi,

That will be fixed in next version of HikaShop. Until then, your modification is a correct way to solve that.

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

- **[mair](/forum/user/9742-mair "View mair's Profile")**
- [![mair's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar_2012-12-17.png)](/forum/user/9742-mair "View mair's Profile")
- [ Offline](/forum/user/9742-mair)

Less More

- Posts: 46
- Thank you received: 2
-
- [](http://www.workwearandsports.co.uk/)
-

13 years 11 months ago [\#78983](#78983) by [mair](/forum/user/9742-mair "View mair's Profile")  Replied by *[mair](/forum/user/9742-mair "View mair's Profile")* on topic *[Re: Display same custom field value for variants](/forum/4-how-to/73254-display-same-custom-field-value-for-variants#78983 "I have a question. When I choose a variant on main product page,the custom fields will disappear. I realized that I have to input values on variants' edit page again. If my variants have same values with main product, What can I do to save the repeat work that input the same values in variant edit page. So that the custom fields will show on main product page and variant page")*

Hi has this been solved in version 2.0?

---

[ Workwear Suppliers in the UK](http://www.workwearandsports.co.uk)

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 11 months ago [\#79057](#79057) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Re: Display same custom field value for variants](/forum/4-how-to/73254-display-same-custom-field-value-for-variants#79057 "I have a question. When I choose a variant on main product page,the custom fields will disappear. I realized that I have to input values on variants' edit page again. If my variants have same values with main product, What can I do to save the repeat work that input the same values in variant edit page. So that the custom fields will show on main product page and variant page")*

Hi,

Yes, it as been solved in HikaShop 2.0

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[mair](/forum/user/9742-mair "View mair's Profile")**
- [![mair's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar_2012-12-17.png)](/forum/user/9742-mair "View mair's Profile")
- [ Offline](/forum/user/9742-mair)

Less More

- Posts: 46
- Thank you received: 2
-
- [](http://www.workwearandsports.co.uk/)
-

13 years 11 months ago [\#79086](#79086) by [mair](/forum/user/9742-mair "View mair's Profile")  Replied by *[mair](/forum/user/9742-mair "View mair's Profile")* on topic *[Re: Display same custom field value for variants](/forum/4-how-to/73254-display-same-custom-field-value-for-variants#79086 "I have a question. When I choose a variant on main product page,the custom fields will disappear. I realized that I have to input values on variants' edit page again. If my variants have same values with main product, What can I do to save the repeat work that input the same values in variant edit page. So that the custom fields will show on main product page and variant page")*

Thanks for the reply Jerome I have the 2.0 business addition and I had to make the changes as described above to the show_block_custom_main.php

Is there a new setting to make it appear in the variants ?

---

[ Workwear Suppliers in the UK](http://www.workwearandsports.co.uk)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzczMjU0LWRpc3BsYXktc2FtZS1jdXN0b20tZmllbGQtdmFsdWUtZm9yLXZhcmlhbnRzP3RtcGw9bWFya2Rvd24=) 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: 86316
- Thank you received: 14276
-
-

13 years 11 months ago [\#79284](#79284) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Display same custom field value for variants](/forum/4-how-to/73254-display-same-custom-field-value-for-variants#79284 "I have a question. When I choose a variant on main product page,the custom fields will disappear. I realized that I have to input values on variants' edit page again. If my variants have same values with main product, What can I do to save the repeat work that input the same values in variant edit page. So that the custom fields will show on main product page and variant page")*

It could have been that you already had edited one of the view files of the product view before the update and thus you didn't get the modification.
But that's not really a problem since you can easily fix it yourself as you already did.

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

- **[Lemon Tree](/forum/user/9739-lemon-tree "View Lemon Tree's Profile")**
- [![Lemon Tree's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9739-lemon-tree "View Lemon Tree's Profile")
- [ Offline](/forum/user/9739-lemon-tree)

Less More

- Posts: 23
- Thank you received: 0
-
-

13 years 10 months ago [\#82304](#82304) by [Lemon Tree](/forum/user/9739-lemon-tree "View Lemon Tree's Profile")  Replied by *[Lemon Tree](/forum/user/9739-lemon-tree "View Lemon Tree's Profile")* on topic *[Re: Display same custom field value for variants](/forum/4-how-to/73254-display-same-custom-field-value-for-variants#82304 "I have a question. When I choose a variant on main product page,the custom fields will disappear. I realized that I have to input values on variants' edit page again. If my variants have same values with main product, What can I do to save the repeat work that input the same values in variant edit page. So that the custom fields will show on main product page and variant page")*

I have HikaShop Essential 2.0 - a fresh install, and I have the same problem. It would seem it has not been fixed.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzczMjU0LWRpc3BsYXktc2FtZS1jdXN0b20tZmllbGQtdmFsdWUtZm9yLXZhcmlhbnRzP3RtcGw9bWFya2Rvd24=) 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: 86316
- Thank you received: 14276
-
-

13 years 10 months ago [\#82463](#82463) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Display same custom field value for variants](/forum/4-how-to/73254-display-same-custom-field-value-for-variants#82463 "I have a question. When I choose a variant on main product page,the custom fields will disappear. I realized that I have to input values on variants' edit page again. If my variants have same values with main product, What can I do to save the repeat work that input the same values in variant edit page. So that the custom fields will show on main product page and variant page")*

Can you add the code: Code:

if(empty($variant-&gt;$fieldName) &amp;&amp; !empty($this-&gt;element-&gt;main-&gt;$fieldName)){ $variant-&gt;$fieldName = $this-&gt;element-&gt;main-&gt;$fieldName; }

after the line Code:

foreach ($this-&gt;fields as $fieldName =&gt; $oneExtraField) {

in the file 'show' of the view 'product' via the menu Display-&gt;Views and try again ?

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

- **[Lemon Tree](/forum/user/9739-lemon-tree "View Lemon Tree's Profile")**
- [![Lemon Tree's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/9739-lemon-tree "View Lemon Tree's Profile")
- [ Offline](/forum/user/9739-lemon-tree)

Less More

- Posts: 23
- Thank you received: 0
-
-

13 years 10 months ago -  13 years 10 months ago [\#82497](#82497) by [Lemon Tree](/forum/user/9739-lemon-tree "View Lemon Tree's Profile")  Replied by *[Lemon Tree](/forum/user/9739-lemon-tree "View Lemon Tree's Profile")* on topic *[Re: Display same custom field value for variants](/forum/4-how-to/73254-display-same-custom-field-value-for-variants#82497 "I have a question. When I choose a variant on main product page,the custom fields will disappear. I realized that I have to input values on variants' edit page again. If my variants have same values with main product, What can I do to save the repeat work that input the same values in variant edit page. So that the custom fields will show on main product page and variant page")*

> nicolas wrote: Can you add the code:
>
> Code:
>
> if(empty($variant-&gt;$fieldName) &amp;&amp; !empty($this-&gt;element-&gt;main-&gt;$fieldName)){ $variant-&gt;$fieldName = $this-&gt;element-&gt;main-&gt;$fieldName; }
>
>
>
> after the line Code:
>
> foreach ($this-&gt;fields as $fieldName =&gt; $oneExtraField) {
>
>
>
> in the file 'show' of the view 'product' via the menu Display-&gt;Views and try again ?

Thanks, Nicolas. Can you advise do we ALSO have to make the change suggested above by wzyefd to the file show_block_custom_main.php?

Last edit: 13 years 10 months ago by [Lemon Tree](/forum/user/9739-lemon-tree "View Lemon Tree's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzczMjU0LWRpc3BsYXktc2FtZS1jdXN0b20tZmllbGQtdmFsdWUtZm9yLXZhcmlhbnRzP3RtcGw9bWFya2Rvd24=) 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: 86316
- Thank you received: 14276
-
-

13 years 10 months ago [\#82691](#82691) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Display same custom field value for variants](/forum/4-how-to/73254-display-same-custom-field-value-for-variants#82691 "I have a question. When I choose a variant on main product page,the custom fields will disappear. I realized that I have to input values on variants' edit page again. If my variants have same values with main product, What can I do to save the repeat work that input the same values in variant edit page. So that the custom fields will show on main product page and variant page")*

No

The following user(s) said Thank You: [Lemon Tree](/forum/user/9739-lemon-tree "View Lemon Tree's Profile")

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

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

[](#top)
