fbpx

Variation image swatch bug

HomeTopicsSupport forumVariation image swatch bug
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #16340
    Avatar
    BadChip
    Participant

    Hello Artem,

    When the product image matches the variation image, the swatch will not appear as an image but it will still show the color.

    Please see the screenshot, I explain it better.

    Can this be fixed please?

    Thank you,

    Attachments:
    You must be logged in to view attached files.
    #16349
    Artem Temos
    Artem Temos
    Keymaster

    Hello,

    Please, send us your admin access so we can check what is wrong.

    Kind Regards

    #16361
    Avatar
    BadChip
    Participant

    Here is access

    You can see if you change either product image or variation image it will start working, but if both are the same it will only display the color :\

    #16376
    Eric Watson
    Eric Watson
    Keymaster

    Hello,

    Try to replace this code:

    if ( $variation['image_id'] !== $product_image_id ) {
    	$option_variation['image_src']    = $variation['image']['src'];
    	$option_variation['image_srcset'] = $variation['image']['srcset'];
    	$option_variation['image_sizes']  = $variation['image']['sizes'];
    }

    for this one:

    $option_variation['image_src']    = $variation['image']['src'];
    $option_variation['image_srcset'] = $variation['image']['srcset'];
    $option_variation['image_sizes']  = $variation['image']['sizes'];

    in framework/modules/wc-variations-swatches/class-wc-variations-swatches.php file

    Best Regards

    #16377
    Avatar
    BadChip
    Participant

    Hi Eric,

    Ya that fixed it. However is modifying parent theme files like this safe? Will this change survive an update? Is there a better way to do it other than editing parent theme directly?

    Thanks,

    #16385
    Artem Temos
    Artem Temos
    Keymaster

    Hello,

    We will fix this in our next theme update so you don’t need to worry about that.

    Kind Regards

    #16443
    Avatar
    BadChip
    Participant

    Ok, thanks.

    #16444
    Artem Temos
    Artem Temos
    Keymaster

    You are welcome!

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Variation image swatch bug’ is closed to new replies.

Sign in

No account yet?

Create an Account