Forum Replies Created

Viewing 1 replies (of 1 total)
  • Paste this code into your functions.php file and your unavailable variations will be disabled.

    
    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 );
    

    The rest you can do by simply adding a ::before in every disabled option.

Viewing 1 replies (of 1 total)