Skip to main content

Display same custom field value for variants

More
13 years 11 months ago #73254 by wzyefd
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 or Create an account to join the conversation.

More
13 years 11 months ago #73511 by wzyefd
waiting for your replay!!

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

More
13 years 11 months ago #73518 by wzyefd
I have solved it by myself.
I modify this code in show_block_custom_main.php
<div id="hikashop_product_custom_info_main" class="hikashop_product_custom_info_main">
to
<div id="hikashop_product_custom_info_main1" class="hikashop_product_custom_info_main">
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 or Create an account to join the conversation.

More
13 years 11 months ago #73593 by nicolas
Hi,

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

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

More
13 years 10 months ago #78983 by mair
Hi has this been solved in version 2.0?

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

More
13 years 10 months ago #79057 by Jerome
Hi,

Yes, it as been solved in HikaShop 2.0

Regards,

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

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

More
13 years 10 months ago #79086 by mair
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 ?

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

More
13 years 10 months ago #79284 by nicolas
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 or Create an account to join the conversation.

More
13 years 9 months ago #82304 by Lemon Tree
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 or Create an account to join the conversation.

More
13 years 9 months ago #82463 by nicolas
Can you add the code:
Code:
if(empty($variant->$fieldName) && !empty($this->element->main->$fieldName)){ $variant->$fieldName = $this->element->main->$fieldName; }
after the line
Code:
foreach ($this->fields as $fieldName => $oneExtraField) {
in the file 'show' of the view 'product' via the menu Display->Views and try again ?

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

More
13 years 9 months ago - 13 years 9 months ago #82497 by Lemon Tree

nicolas wrote: Can you add the code:

Code:
if(empty($variant->$fieldName) && !empty($this->element->main->$fieldName)){ $variant->$fieldName = $this->element->main->$fieldName; }
after the line
Code:
foreach ($this->fields as $fieldName => $oneExtraField) {
in the file 'show' of the view 'product' via the menu Display->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 9 months ago by Lemon Tree.

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

More
13 years 9 months ago #82691 by nicolas
The following user(s) said Thank You: Lemon Tree

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

Time to create page: 0.180 seconds
Powered by Kunena Forum