Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save rajeshsingh520/cf0b1eef446e3ec0bbb25aa7a02e9323 to your computer and use it in GitHub Desktop.

Select an option

Save rajeshsingh520/cf0b1eef446e3ec0bbb25aa7a02e9323 to your computer and use it in GitHub Desktop.
give discount when partial payment not selected
add_action('woocommerce_cart_calculate_fees', function($cart) {
if(class_exists('PISOL\DPMW\Session')){
$fees_selected = PISOL\DPMW\Session::partialPaymentSelectedInSession();
if(!$fees_selected){
$cart->add_fee( 'Custom Fee', -100 );
}
}
}, 20);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment