Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
* Disable out of stock variations
* @return Boolean
function wcbv_variation_is_active( $active, $variation ) {
if( ! $variation->is_in_stock() ) {
return false;
return $active;
add_filter( 'woocommerce_variation_is_active', 'wcbv_variation_is_active', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.