I think I have found the solution.
The response product list does not has the class ‘wvs-attachment-image’ on the thumbnail images. So I have add a line :
$( ‘.size-woocommerce_thumbnail’ ).addClass(‘wvs-attachment-image’)
Then it is working fine. And I tried to remove the lines:
$(‘.variations_form’).each(function(){
$(this).wc_variation_form();
});
it still works fine. I guess you need to update your document for developers to note them add back the class ‘wvs-attachment-image’ because sometime other plugins do not retrieve this class.
The product image does not change when click the variations after AJAX requests
Brain Shi
Hi
Can you please have a look at this page? I am a developer who help my client build his website. I wrote an AJAX filter on the shop page and made it work with some custom post mates.
My question is once the AJAX request is done then refresh the product list. The variations swatches seems not working anymore. the product thumbnail doesnot change after I click the variations swatches.
By checking this document https://getwooplugins.com/documentation/woocommerce-variation-swatches/#infinite-scroll-or-ajax-load-more
I have added the code snippet after my AJAX respone is recieved:
$(‘.variations_form’).each(function(){
$(this).wc_variation_form();
});
But it still does not work.
Can you please tell me why and anything I missed?
Thanks!