-1

I have a problem with WooCommerce showing out of stock items as in stock. This is for a T-Shirt customization site. Some variations have more than 500 variations. Some items when click show as in-stock and it does not display a warning. How can I stop users from selecting out of stock items in large variations.

I changed php.ini max_input_vars to 20000 but that does not fix the issue.

closed as off-topic by nmr, Jacob Peattie, Max Yudin, Mayeenul Islam, cjbj Nov 4 at 19:40

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1

I was able to fix the issue by simply adding the following to functions.php

add_filter( 'woocommerce_ajax_variation_threshold', 'wc_ninja_ajax_threshold' ); 
function wc_ninja_ajax_threshold() {
    return 1000;
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.