It seems like your plugin is not compatible with Woocommerce Smart Coupons. So, I tried following piece of code to disable partial payment when coupon of type ‘smart_coupon’ is applied on cart page but it didn’t work.
add_action( 'woocommerce_applied_coupon', 'disable_partial_payment' );
function disable_partial_payment() {
foreach ( WC()->cart->get_coupons() as $code => $coupon ) {
if($coupon->discount_type == 'smart_coupon'){
add_filter('woo_wallet_partial_payment_amount', '__return_false');
break;
}
}
}
Can you please provide a solution?
Hi @blackhatwarrior
Please use woo_wallet_disable_partial_payment filter insted of is_enable_wallet_partial_payment and let us know.
Thank you.
Hi @subratamal
I tried woo_wallet_disable_partial_payment filter but partial payment still doesn’t get disabled when a smart coupon is applied. Am I doing something wrong?
I’ve one more query regarding partial payment through wallet plugin. Why is a partial wallet payment applied to an order as negative fee & not payment method? Don’t you think it’s a wrong practice from accounting point of view? For example; When a $50 order is fully paid through wallet the Income from sale is $50. But when the same order is partially paid $25 through wallet & remaining $25 through Credit Card then Income from sale drops down to $25 only. It’s extremely difficult to generate actual sales report in WooCommerce when you’ve tons of people using partial wallet payments.
I’ve resolved the issue with following piece of code:
add_action( 'woocommerce_cart_calculate_fees','disable_partial_payment', 9, 1);
function disable_partial_payment($cart) {
foreach ( $cart->get_coupons() as $code => $coupon ){
if($coupon->get_discount_type() == 'smart_coupon'){
add_filter('is_enable_wallet_partial_payment', '__return_false');
}
}
}
You can close this thread but please reply to my query regarding partial payment.
Hi @blackhatwarrior
Sorry for the delay in response. Yes, you are right but if we create a payment gateway for partial payment then it will disable all other WooCommerce gateways. That’s why we integrate it as a negative fee.
Hi @subratamal,
No doubt partial payments is one of the best features of your plugin, but if its not gonna work as a payment gateway, you should look for a better solution. Negative fee is definitely not how it should be applied to an order. I think most of the people using your plugin with partial payment enabled have no idea how it affects the sales report. But when they realize it, they gonna start raising issues.
Thank you!