Created
January 3, 2019 00:13
-
-
Save Frique/157488a352723098afe55a7287110b5a to your computer and use it in GitHub Desktop.
WCSSM: Do not apply sales to out-of-stock products
This file contains 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( 'wcssm-applicable-sales', function( $value, $product ) { | |
if ( ! $product->is_in_stock() ) { | |
$value = null; | |
} | |
return $value; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment