Using images for custom field radio options

  • Posts: 21
  • Thank you received: 0
11 months 2 weeks ago #351615

-- HikaShop version -- : 4.2.2
-- Joomla version -- : 3.10.0
-- PHP version -- : 7.4.33

I've followed the tutorial listed on the following page to add characteristics for colours:

www.hikashop.com/support/documentation/2...isplay-by-color.html

However, when I add the image variants the page stops loading as the total variant number becomes over 800.

So my next thought was to add a custom field to show colour options using images instead.

However, I do not see any way to add image to each radio option within custom field - is this not possible just like you do in characteristics?

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

  • Posts: 81515
  • Thank you received: 13068
  • MODERATOR
11 months 2 weeks ago #351616

Hi,

It's possible to do something similar with a custom item field. You would have to make it as a "radio" type and then in the values you could use the img tag of an image in the "title" input field, like you did with the values of the characteristic.
However, the CSS presented in this tutorial would have to be different as the custom fields don't use the same classes as the characteristics.
I can see that you have a size characteristic which apparently doesn't affect the price or anything of your product. So you could do it the other way around: instead of having a size characteristic with a color custom item field, you could make a custom item field for the size selection, and use the color characteristic for the color selection. That way, you would keep down the number of variants.

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

  • Posts: 21
  • Thank you received: 0
11 months 1 week ago #351650

Thanks for your input, nicolas.

Size characteristics do have variable prices, so I could not move them to Custom Fields.

I managed to achieve this with the use of Custom Fields as you first suggested - is it possible to do the same "linking icons to images" with Custom Fields?

www.hikashop.com/support/documentation/2...y-by-color.html#link

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

  • Posts: 81515
  • Thank you received: 13068
  • MODERATOR
11 months 1 week ago #351651

Hi,

Yes. In the data area of your custom field (when you edit it), in the "title" inputs, instead of entering the name of the icons, enter an img HTML tag with the URL of the icon and it should do it.

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

  • Posts: 21
  • Thank you received: 0
11 months 1 week ago #351676

I already completed that part as shown in the attached here.

What I'm asking now is whether or no it is possible to link these values to larger images just like outlined in your documentation under "Link icons and pictures" for characteristics:

Link icons and pictures
Now, onto the second step. You have your color icons selector displayed, and you want to show different product pictures linked with the color selector. Return to the Hikashop -> Products menu,

Attachments:
Last edit: 11 months 1 week ago by officezen.

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

  • Posts: 81515
  • Thank you received: 13068
  • MODERATOR
11 months 1 week ago #351677

That's not possible easily.
It would require custom javascript coding on the product page layout view to be able to do that.
You would need to have a developer work on that.

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

Time to create page: 0.064 seconds
Powered by Kunena Forum