Skip to content

Instantly share code, notes, and snippets.

@Frique
Created January 3, 2019 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Frique/157488a352723098afe55a7287110b5a to your computer and use it in GitHub Desktop.
Save Frique/157488a352723098afe55a7287110b5a to your computer and use it in GitHub Desktop.
WCSSM: Do not apply sales to out-of-stock products
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