Hi Anne,
Thanks for reaching out to us.
Please add the following snippet using a plugin called Code Snippets:
add_filter( 'woocommerce_ajax_variation_threshold', 'woo_variation_swatches_global_ajax_variation_threshold_min', 10, 2 );
function woo_variation_swatches_global_ajax_variation_threshold_min( $size, $product ){
return 80;
}
You can also add the above snippet inside your current theme’s functions.php file.
Note: It is recommended to add the Custom Code to the child theme’s functions.php file, to avoid any data loss while updating the Parent Theme.
Then check how it goes. Hope to hear from you soon.
Thank You
Long AJAX load with PRO
Anne Smith
I find that with PRO enable I get a very long AJAX call, if I disable PRO and just use the standard this load time reduces significantly as the AJAX doesn’t happen.
The product in question – https://colourcraft.uk/product/brusho-small-size-colours/
This is the link, it takes over 30 seconds to arrive – https://colourcraft.uk/wp-json/woo-variation-swatches/v1/single-product/115620?_locale=user and is about 128kb in size, 68 lines of AJAX.
Equally, adding to cart is dreadfully long too, presumably because it fetches this again, but I don’t know?
Please advise, this seems to be the primary cause of site speed issues. Many thanks NEIL