Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function authorize_less($available_gateways) {
- $maximum = 0;
- if ( WC()->cart->total < $maximum ) {
- unset( $available_gateways['authorizenet'] );
- }
- return $available_gateways;
- }
- add_filter( 'woocommerce_available_payment_gateways', 'authorize_less');
- add_action( 'woocommerce_cart_calculate_fees' , 'authorize_less' );
- add_action( 'woocommerce_after_cart_item_quantity_update', 'authorize_less' );
- function authorize_more($available_gateways) {
- $maximum = 0;
- if ( WC()->cart->total > $maximum ) {
- unset( $available_gateways['cod'] );
- }
- return $available_gateways;
- }
- add_filter( 'woocommerce_available_payment_gateways', 'authorize_more');
- add_action( 'woocommerce_cart_calculate_fees' , 'authorize_more' );
- add_action( 'woocommerce_removed_coupon', 'authorize_more' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement