Partial Payment in checkout page (30% payment through wallet)2020-12-02T22:47:03+05:30

Home Forums Core Partial Payment in checkout page (30% payment through wallet)

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Alga Malo
    Participant
    Post count: 1

    I want to enable partial payment on the checkout page all the time. 30 % payment can be done through the wallet and for 70% payment customer has to choose another payment option. And the checkbox will show all the time. I tried this on my child themes function.php file, but it’s not working! 🙁

    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;
    }

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
WhatsApp