disable payment gateways based on conditions
-
disable payment gateway based on Get method(from url)
eg. https://xyz.com/checkout/?add-to-cart=89&action=saveyourquote
add_filter( 'woocommerce_available_payment_gateways', 'custom_paypal_disable_manager' ); function custom_paypal_disable_manager( $available_gateways ) { if ( $_GET['action'] == "saveyourquote" ) { unset( $available_gateways['paypal'] ); unset( $available_gateways['bacs'] ); } return $available_gateways; }
This is not working based on GET method.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘disable payment gateways based on conditions’ is closed to new replies.