• Resolved zhjoy

    (@zhjoy)


    I want to enable partial payment on the checkout page. 30 % payment can be done through the wallet and for 70% payment customer has to choose another payment option.

    How do I do that?
    Thanks in advanced

Viewing 4 replies - 1 through 4 (of 4 total)
  • ehoty

    (@ehoty)

    Write this code to your function.php or use the Code Snippets plugin to do that.

    add_filter(‘is_valid_payment_through_wallet’, ‘__return_false’);
    add_filter(‘woo_wallet_partial_payment_amount’, ‘woo_wallet_partial_payment_amount_callback’, 10);

    function woo_wallet_partial_payment_amount_callback($amount) {
    if (sizeof(wc()->cart->get_cart()) > 0) {
    $cart_total = get_woowallet_cart_total();
    $partial_payment_amount = ($cart_total * 30) / 100;
    if ($amount >= $partial_payment_amount) {
    $amount = $partial_payment_amount;
    }
    }
    return $amount;
    }

    • This reply was modified 4 years ago by ehoty.
    Thread Starter zhjoy

    (@zhjoy)

    Not working ?? It takes all the amount, as usual the plugin works. But, I wanted to enable the checkbox all the time (not when the wallet amount is less than the product price)

    ehoty

    (@ehoty)

    You need to enable “Auto deduct wallet balance for partial payment” from tera wallet setting. It’s working for woocomerce Version 4.4.1

    Thread Starter zhjoy

    (@zhjoy)

    Thank you! It’s working now. But it takes all amount in spite of 30 % of the payment. I have pasted the code in function.php, you have given. Can you please help? (for your information, I have activated the child theme)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Partial Payment in checkout page (30% payment through wallet)’ is closed to new replies.