Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

woocommerce remove payment method when totla is 0

function payment_gateway_disable_total_amount( $available_gateways ) {
global $woocommerce;
if ( isset( $available_gateways['paypal'] ) && $woocommerce->cart->total == 0 ) {
    unset(  $available_gateways['paypal'] );
}
    return $available_gateways;
}
add_filter( 'woocommerce_available_payment_gateways', 'payment_gateway_disable_total_amount' );
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #woocommerce #remove #payment #method #totla
ADD COMMENT
Topic
Name
9+3 =