Created
June 18, 2019 09:59
-
-
Save wickywills/4e95c060cbc25daff5e400582963659f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
add_filter( 'woocommerce_variation_is_active', 'grey_out_variations_when_out_of_stock', 10, 2 ); | |
function grey_out_variations_when_out_of_stock( $grey_out, $variation ) { | |
if ( ! $variation->is_in_stock() ) | |
return false; | |
return true; | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment