Last active
August 28, 2023 13:48
-
-
Save amirhmoradi/1cd8ba6c856e6cba1d345fc4dc46333d to your computer and use it in GitHub Desktop.
Woocommerce pre-orders plugin allow multiple products in cart
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
<?php | |
//remove pre-order limitations --> only one item per order | |
function ax_remove_validation_cart(){ | |
if (!empty($GLOBALS['wc_pre_orders'])){ | |
remove_filter( 'woocommerce_add_to_cart_validation', array( $GLOBALS['wc_pre_orders']->cart, 'validate_cart' ), 15, 2 ); | |
} | |
} | |
add_action( 'init', 'ax_remove_validation_cart' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment