Custom Fields in Variants

  • Posts: 62
  • Thank you received: 0
10 years 2 months ago #206040

-- HikaShop version -- : [1503061200]

Hi there,

I am trying to add specific or additional extra info to my product variants, such as add sub-names to items and other data. Is this possible?

Or even just to get the name to change. For Example I have some products that are named "Product CA" and their variants are named "Product XS" for example. But changing the dropdown in the item only changes the price and the description if I change the data there.

Is there anyway to do this?

Thanks.

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

  • Posts: 84304
  • Thank you received: 13699
  • MODERATOR
10 years 2 months ago #206104

Hi,

You sure can add custom product fields to variants with different data and the data will refresh when you change the characteristics selection on the product page.
That's done automatically and there is nothing to do for that to work.
If that doesn't work, the only thing I can think of is that there are some template overrides of the HikaShop product view files which don't take that into account properly.
Rename the folder templates/YOUR_TEMPLATE/html/com_hikashop/product to something else via FTP and try again.

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

  • Posts: 62
  • Thank you received: 0
10 years 2 months ago #206111

Thanks for the reply.

Setting it back to the default template seemed to of got that back to work.

I am trying to move specific custom fields to different parts of the template (not in the product description tabs) and I guess I have stuffed the code up.

Can you advise on the code for displaying a specific single custom field display at different parts as I believe they were grouped and I would of stuffed the code up that makes them change when the variant is chosen. Because I don't want them all displayed in the tabs 'Specifications' tab.

Thanks :)

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

  • Posts: 84304
  • Thank you received: 13699
  • MODERATOR
10 years 2 months ago #206241

Hi,

The switching system of the variants only support one switching for the custom product fields area. It wasn't meant to support what you want.
So in that case, you would have to cheat and use the ids of other elements which can switch like the description, the product code, etc. And the modifications for the separation of the fields will be much more complex as it needs to be done in the show_tabular (for the main areas) and in the "show" view files (for the variants custom product field data).

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

  • Posts: 62
  • Thank you received: 0
10 years 2 months ago #206614

Do you mean I just copy the same code from that area and put it into another area and hide by CSS what I do not want?

Can you also advise how I remove the : before the variant name modification?

Thanks.

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

  • Posts: 84304
  • Thank you received: 13699
  • MODERATOR
10 years 2 months ago #206625

Something like that yes.
Each area from the show_tabular view file switches with its corresponding area in the show view file. So the best is to indeed use the area of something else, like the product code, move it where you in the show_tabular want and put in it the display of the custom fields you want to display there (and add in its corresponding area in the show file the display of the custom fields of each variant).

The : before the variant name can be removed with a translation override of the translation key:
HIKA_VARIANT_SEPARATOR
hikashop.com/download/languages.html#modify

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

Time to create page: 0.062 seconds
Powered by Kunena Forum