Variants / Options image display from characteristics of product

  • Posts: 135
  • Thank you received: 5
3 years 3 weeks ago #339546

-- HikaShop version -- : 4.4.5
-- Joomla version -- : 4.1.0
-- PHP version -- : 7.4.28
-- Browser(s) name and version -- : Brave Version 1.35.103 Chromium: 98.0.4758.102 (Official Build) (64-bit)
-- Error-message(debug-mod must be tuned on) -- : No Error Message

I have a test product and this will be the norm for all the products I set up.
In this test product "ZLS1 - 50 - Left", there are a number of options / variants that are mandatory for the overall build of the product.

I will like to see the images displayed for the options / variants.

See the attachment of what I am looking for!

Do I need to do some changes to a display PHP file to achieve this ?

I have created the product ("ZLS1 - 50 - LEFT")
I have created product options with the characteristics all set and the image against the variant.
I have then in the product ("ZLS1 - 50 - LEFT") option section assigned the various product options.

If you need admin access to the site let me know ;)

Regards,
Mark

Attachments:

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

  • Posts: 83402
  • Thank you received: 13495
  • MODERATOR
3 years 3 weeks ago #339548

Hi,

You would have to edit the file product / option via the menu Display>Views
In there you have a variable $variant defined a some point within a foreach.
The images data of the current variant of the current option being displayed is available in $variant->images
So you need to add custom PHP/HTML code to add the HTML of all the images of all the variants of all the options on the page.
And then, at the end of the view, you can see a bunch of javascript code to handle the refresh of the total price when you change a selection in an option.
So you need to add custom javascript code there to display/hide the images based on what is selected.

The following user(s) said Thank You: markfell

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

  • Posts: 135
  • Thank you received: 5
3 years 3 weeks ago #339627

Thank Nicolas,

Great support as usual :)

Mark

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

Time to create page: 0.057 seconds
Powered by Kunena Forum