ajax variation

Hi, is it possible to enable the Ajax variation threshold function only on a specific product? I have many products with many variations (all available) and others with less variations (not all available). If active ajax the site becomes very slow and the products with many variations (arrival up to 10,000) do not load the page, so I would like to apply it only to some products ... I entered this code but maybe it's wrong:

add_filter( ‘woocommerce_ajax_variation_threshold’, ‘wc_ninja_ajax_threshold’ );
function wc_ninja_ajax_threshold( $product_id ) {
    return 4750;
$product->get_id(38358);
}
Can you help me?
 

Ahmed Ehsaan

Hi antonella,
It’s a default feature of WooCommerce. Currently, it’s not possible.
but we can run research for you. If we find solution, will notify you.
Thank You