Created
February 20, 2022 16:04
-
-
Save finalwebsites/a31735cb938c6c8babbe24b7139f499f to your computer and use it in GitHub Desktop.
WooCommerce product variaties uitschakelen wanneer deze zijn uitverkocht
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
<?php | |
// plaats deze code in het functions.php bestand van je child thema | |
add_filter( 'woocommerce_variation_is_active', 'fws_disable_variations_out_of_stock', 10, 2 ); | |
function fws_disable_variations_out_of_stock( $is_active, $variation ) { | |
if ( ! $variation->is_in_stock() ) return false; | |
return $is_active; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment