admin管理员组

文章数量:1387429

I have 2 products with different properties.
1 product has 5 variations configured and the other 120.
However, the maximum possible variations for both products are 144 (not all variations are configured).

We notice that the product with 5 variations only shows the 5 variations (so other variations cannot be chosen in the listbox).
But for the product with 120 variations it shows the 144 variations.
This sometimes leads to the message "Sorry, this product is not available. Pick another combination".

Is it possible for product 2 to only have the 120 configured varations show up in the listbox?

I have 2 products with different properties.
1 product has 5 variations configured and the other 120.
However, the maximum possible variations for both products are 144 (not all variations are configured).

We notice that the product with 5 variations only shows the 5 variations (so other variations cannot be chosen in the listbox).
But for the product with 120 variations it shows the 144 variations.
This sometimes leads to the message "Sorry, this product is not available. Pick another combination".

Is it possible for product 2 to only have the 120 configured varations show up in the listbox?

Share Improve this question asked Mar 30, 2020 at 19:21 user2827958user2827958 1112 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

We found it ourselves, this is the solution.
Add the following snippet in functions.php

function wc_increase_variation_threshold( $product ) {
    return 500;
}
add_filter( 'woocommerce_ajax_variation_threshold', 'wc_increase_variation_threshold', 10, 2 );

本文标签: WooCommerce hide unexisting variations