Display same custom field value for variants

  • Posts: 24
  • Thank you received: 0
12 years 2 weeks ago #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

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

  • Posts: 24
  • Thank you received: 0
12 years 2 weeks ago #73511

waiting for your replay!!

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

  • Posts: 24
  • Thank you received: 0
12 years 2 weeks ago #73518

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.

  • Posts: 82818
  • Thank you received: 13360
  • MODERATOR
12 years 1 week ago #73593

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.

  • Posts: 46
  • Thank you received: 2
11 years 11 months ago #78983

Hi has this been solved in version 2.0?

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

  • Posts: 26152
  • Thank you received: 4027
  • MODERATOR
11 years 11 months ago #79057

Hi,

Yes, it as been solved in HikaShop 2.0

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 46
  • Thank you received: 2
11 years 11 months ago #79086

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.

  • Posts: 82818
  • Thank you received: 13360
  • MODERATOR
11 years 11 months ago #79284

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.

  • Posts: 23
  • Thank you received: 0
11 years 10 months ago #82304

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.

  • Posts: 82818
  • Thank you received: 13360
  • MODERATOR
11 years 10 months ago #82463

Can you add the code:

if(empty($variant->$fieldName) && !empty($this->element->main->$fieldName)){
					$variant->$fieldName = $this->element->main->$fieldName;
				}
after the line
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.

  • Posts: 23
  • Thank you received: 0
11 years 10 months ago #82497

nicolas wrote: Can you add the code:

if(empty($variant->$fieldName) && !empty($this->element->main->$fieldName)){
					$variant->$fieldName = $this->element->main->$fieldName;
				}
after the line
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: 11 years 10 months ago by Lemon Tree.

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

  • Posts: 82818
  • Thank you received: 13360
  • MODERATOR
11 years 10 months ago #82691

No

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.084 seconds
Powered by Kunena Forum