Search
 
SCRIPT & CODE EXAMPLE
 

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' );
Comment

PREVIOUS NEXT
Code Example
Php :: php check if text is blank 
Php :: codeigniter 4 query builder get inserted id 
Php :: create a new project from cli laravel 
Php :: parse data from xml CDATA php 
Php :: array to string using php method 
Php :: can I change my ip adress with python 
Php :: drupal 8 get enabled languages 
Php :: create a custom method laravel model 
Php :: post params in body laravel 
Php :: api response in json laravel 
Php :: laravel create coma separated string from query 
Php :: change the date format in laravel view page 
Php :: laravel create mode 
Php :: php print all woocommerce products 
Php :: create controller with model resources and request command in laravel 
Php :: find over array object php find 
Php :: laravel 9 Route::controller 
Php :: get post info in php 
Php :: thousand seperator php 
Php :: php line break 
Php :: php check if associative array 
Php :: how to create shortcode with php 
Php :: curl php loop 
Php :: php get keys of duplicate values in array 
Php :: laravel query foreach 
Php :: drupal 8 user_load 
Php :: curl post laravel 
Php :: php get object josn 
Php :: wherein elequent 
Php :: insert multiple rows laravel 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =