If I understand your question correctly, you want woocommerce to prevent users from selecting certain combinations of options on variable products, unless a variation with the selected options actually exists and is in stock?
This probably is due to the woocommerce_ajax_variation_threshold. If your product contains more variations than the threshold specifies, woocommerce will wait until all variation options have been selected by the user before determining if the selected combination of options is valid(in stock, exists, etc). If the user has selected a combination that is not valid or is not instock, you will get the
Sorry, no products matched your selection. Please choose a different combination
Say you had a product where you can set the following attributes:
upholstery, base, arms headrest, back
That is 5 different attributes.
If each one of those attributes has 5 options, that is 25 different possible combinations assuming the user has to select all 5 options.
If the user doesn't have to select all 5 options then there are even more possible combinations.
So even if you only actually created 2 variations for this product, its woocommerce_ajax_variation_threshold would be 25, meaning 25 possible options(variations).
I think by default the woocommerce_ajax_variation_threshold is set to 10.
So to fix(filter) this, set the woocommerce_ajax_variation_threshold to a higher value. If your product has 30 possible combinations(whether they actually exist or not) set the threshold to something higher than 30, like 1111 for example.
You can use the snippet below in your functions.php file.
/* Increase Woocommerce Variation Threshold */
function wc_ajax_variation_threshold_modify( $threshold, $product ){
$threshold = '1111';
return $threshold;
}
add_filter( 'woocommerce_ajax_variation_threshold','wc_ajax_variation_threshold_modify', 10, 2 );