grey out product attributes that are not available
-
Please open the two links in the private content.
On both, please choose the product color RED.
“Design I” will grey out all “impossible” product variations, “Design I (Kopie)” does not do that and tells me after selecting the rest something like: “This combination is not available”.
Why do they behave different?
Is there a maximum number of variations until the functionality switches? (Design I uses 25 variations, Design I (Kopie) uses 40 variations.)
How do I set up the theme so all products use the behavior of greying out impossible attributes?
Did more testing and I’m guessing the greying out stops when the product has 31 variations or more. Can you confirm?
If so, how do I use greying out for products with more than 30 variations?
Hello,
Thank you so much for contacting our support center.
Out variations are only visually improved standard variations Woocommerce and they work on the basis of standard ones. After 30 variations, Woocommerce begins to load them with an AJAX. The gray color of the variations is based on the standard select and its classes, as you can see after 30 variations there are no more classes.
http://prntscr.com/oz4tj6
http://prntscr.com/oz4txe
Kind Regards
XTemos Studio
Thank you.
How can I make the grey color work for more then 30 variations then?
OK I found something: https://iconicwp.com/blog/modify-ajax-variation-threshold/
Seems to work!
function iconic_wc_ajax_variation_threshold( $qty, $product ) {
return 250;
}
add_filter( 'woocommerce_ajax_variation_threshold', 'iconic_wc_ajax_variation_threshold', 10, 2 );
Great, we are glad that you have found the solution.
Thx for pointing me in the right direction, Eric!