Change product image when selecting varient

  • Posts: 109
  • Thank you received: 1
6 years 2 months ago #303122

-- HikaShop version -- : 4.0.1
-- Joomla version -- : 3.9.2
-- PHP version -- : 7.x
-- Browser(s) name and version -- : Chrome 71.0.3578.98
-- Error-message(debug-mod must be tuned on) -- : none

I see where you can set the default image for a product that comes in several colors, and have also created the variants (size, color) but is there a way to configure it so that when someone selects a color variant from the dropdown on the front end that the product image also changes?

For instance, if I have a red, green and blue jacket variant, I would like to product photo to change to match the variant selected from the drop-down. In my config, the default image is always displayed no matter which variant I select.

Thanks!

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

  • Posts: 83511
  • Thank you received: 13511
  • MODERATOR
6 years 2 months ago #303125

Hi,

Yes. It's not a problem.
You can see an example of that on our demo website:
demo.hikashop.com/index.php/fr/hikashop/...with-characteristics
You can also read a tutorial on that here:
www.hikashop.com/support/documentation/2...isplay-by-color.html

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

  • Posts: 109
  • Thank you received: 1
6 years 1 month ago #303178

I'm not sure if this is the correct way to do it but—I assigned the product photo with the correct color to the variant (red jacket to red variant, etc.), and it seems to display the correct color product when you select that color from the dropdown.

However, now 1) all the little product thumbnails have disappeared from below the product photo, and 2) the size of my product photo has changed (smaller).

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

  • Posts: 83511
  • Thank you received: 13511
  • MODERATOR
6 years 1 month ago #303179

Hi,

1. Yes, if you do it like that, you only have the images relative to the current variant displayed.
If you want all the images, but that the current one changes when you change the variant, then you want to all all the images to all the variants, and have the first image of the list of images to correspond to the color of the variant.

2. I don't see why that would affect the size of the image. Please provide a link to the product page you're talking about and a screenshot of the settings of the default variant and a screenshot of the settings popup of the image of that variant.

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

  • Posts: 109
  • Thank you received: 1
6 years 1 month ago #303252

Item #1:
I did that for one of the products as a test. I added the correct image (color) for each of the variants and when we select the variant from the drop down, the image changes to the correct color.

Item #2:
Today the product image is the correct size—go figure (I'm careful to clear the site and browser cache). However, the thumbnails below the product have all disappeared (see screenshot comparison). The image on the right does not have the product/colors attached to the variants while the one on the left does.

This message contains confidential information

Attachments:

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

  • Posts: 109
  • Thank you received: 1
6 years 1 month ago #303253

What I'm seeing with Google Inspector is that the view with the product/color assigned to the variant is not loading the thumbnails while the one that doesn't have a product/color assigned to a variant is loading the thumbnails (see screenshots)

Attachments:

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

  • Posts: 83511
  • Thank you received: 13511
  • MODERATOR
6 years 1 month ago #303254

Hi,

Looking at your screenshot www.hikashop.com/media/kunena/attachment...1-30at11.07.00AM.png it confirms what I was saying in my previous message, that you only added the image of the corresponding color in each variant.
You need to edit each variant and add the other color images to each. Just make sure that the first image of each variant is the one that corresponds to the variant color.

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

  • Posts: 109
  • Thank you received: 1
6 years 1 month ago #303300

So then are you saying that I should NOT have all the product photos in the Product "Images and Files' section but instead All the product photos in each of the variants?

Got it - so the images in the product basically set the default view on the front end and the images in the variants are attached to the dropdown and thumbnails.

Thank you!

Last edit: 6 years 1 month ago by dagroupinc.

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

  • Posts: 109
  • Thank you received: 1
6 years 1 month ago #303305

Nicolas—

One thing I've noticed is that the color and size variants don't seem to be related. For instance, I have a 'medium black' jacket and an 'extra large blue' jacket. In the front end of the store, the color in the dropdown and the correct colored product are connected, the default product set, and the variants set up.

However if I switch from the black medium jacket to the blue extra large jacket on the front end:
• the size doesn't change from medium to extra large for the blue jacket (medium is not a variant I've set up for the blue jacket).
• the color of the jacket does not change (because there is not a variant for a medium blue jacket),
• the color of the jacket changes from black to blue when you select the extra large variant.

Thoughts?

Attachments:

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

  • Posts: 4820
  • Thank you received: 654
  • MODERATOR
6 years 1 month ago #303328

Hello,

Even if it's not really the most logical way, I recognize it but there is the limit of using the dropdown.
Let's note that the image don't change AND the product page display "no stock", you can try to switch for another variant display :



To have this result :



Note : Note that Table display is only possible if you have 2 crossed variants, like in your case size X color
Hope this will fit your needs.
Regards

Last edit: 6 years 1 month ago by Philip.

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

  • Posts: 109
  • Thank you received: 1
6 years 1 month ago #303363

I suppose another way would be to set the default variant to one that is 'in stock' across the other variants.

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

Time to create page: 0.078 seconds
Powered by Kunena Forum