fbpx
Want To Add Extra Images Per Product Variation? Download This Free Plugin

Variation Images not Changing when Filter is active

Dear team,

When we select any filte ron our shop page, we experience an issue with the swatches: The image is not changing to the selected color.

this is the website: https://ra-shop.ch/sportshop

I recreated the issue for you in this video: https://www.awesomescreenshot.com/video/42771652?key=575f5a4f7bb696828bced1a7fa502b2c

 

Hakik Zaman

Hi Elisabeth,

We are sorry for the inconvenience.

We need an event from your filter plugin (/theme feature).

The event must trigger once new products are loaded (via Ajax) after filtering.

Let’s consider Product Filters for WooCommerce as an example: https://woocommerce.com/products/product-filters/

It offers this trigger: wcpf_update_products

Using the trigger, we can add custom scripts.

jQuery(document).ready(function( $ ){
jQuery(window).on('wcpf_update_products', function () {
console.log('Hi');
});
});

Once you get the trigger, we will share a script to fix the issue.

Thank you

Hakik Zaman

Hi Elisabeth,

How do I get this trigger?

Firstly, check how you are getting the Ajax behavior.

If you are using a plugin, contact the filter plugin author for an event.

If you are using a theme option, contact the theme author regarding the event.

Thank You

Hakik Zaman

Hi Elisabeth,

Please check your theme option and search for Ajax behavior for filtering products.

As far as I know, WooCommerce doesn’t have a feature to filter the products using Ajax.

So, perhaps it’s coming from your theme. If so, ask your theme support for an event name that fires after a new product loads.

Then share that event with us. So that we can test if that event works or not.

Thank You