• Resolved bhwarrior

    (@blackhatwarrior)


    Hi,

    I’m using a filter to disable partial payment for certain products in the cart.

    add_filter('is_enable_wallet_partial_payment', '__return_false');

    This filter does work & disables the partial payment but It does not hide the following text on checkout page:

    $10.00 will be debited from your wallet and $20.00 will be paid through other payment method

    Can you please fix it so I don’t have to edit the template file & move it to child theme directory?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter bhwarrior

    (@blackhatwarrior)

    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?

    Plugin Author Subrata Mal

    (@subratamal)

    Hi @blackhatwarrior

    Please use woo_wallet_disable_partial_payment filter insted of is_enable_wallet_partial_payment and let us know.

    Thank you.

    Thread Starter bhwarrior

    (@blackhatwarrior)

    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.

    Thread Starter bhwarrior

    (@blackhatwarrior)

    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.

    Plugin Author Subrata Mal

    (@subratamal)

    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.

    Thread Starter bhwarrior

    (@blackhatwarrior)

    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!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Filter doesn’t work properly’ is closed to new replies.