This topic has 4 replies, 2 voices, and was last updated 7 years, 11 months ago ago by Jack Richardson
Hi,
I am running Legenda theme version 2.11 and I *cannot* update it now. I am also running WooCommerce v2.5.5.
On my products that have less than 30 variations, my product images change nicely when the color swatch is selected and all works well. However, when I have more than 30 product variations, the product images do not change and I get the following theme error thrown:
Warning: Invalid argument supplied for foreach() in /nas/content/staging/yrcoclothing/wp-content/themes/legenda/framework/theme-functions.php on line 3249
This is definitely an issue with the 30 product variations as I had one product with 31 variations. When I removed one of those, it started working perfectly.
Can you please help me fix this issue?
Thanks!
Hello,
Try to add this code in functions.php file in wp-content/themes/legenda directory:
function custom_wc_ajax_variation_threshold( $qty, $product ) {
return 100;
}
add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 100, 2 );
Best regards,
Jack Richardson.
That worked perfectly!! Thank you!
Hello,
You’re welcome.
Best regards,
Jack Richardson.
The issue related to '‘Product Variation Image Changing throws error with more than 30 variations’' has been successfully resolved, and the topic is now closed for further responses