Created
August 22, 2018 16:51
-
-
Save 1wdtv/202056454331f8029851eeea03478f38 to your computer and use it in GitHub Desktop.
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( 'woocommerce_add_to_cart_validation', 'lab_only_one_in_cart', 99, 2 ); | |
function lab_only_one_in_cart( $passed, $added_product_id ) { | |
wc_empty_cart(); | |
return $passed; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment