Viewing 1 replies (of 1 total)
  • Plugin Author Subrata Mal

    (@subratamal)

    Use below updated code.

    add_filter('is_valid_payment_through_wallet', '__return_false');
    add_filter('woo_wallet_partial_payment_amount', 'woo_wallet_partial_payment_amount_callback', 100);
    
    function woo_wallet_partial_payment_amount_callback($amount) {
        if (sizeof(WC()->cart->get_cart()) > 0) {
            $totals = WC()->cart->get_totals();
            $cart_total = $totals['subtotal'] + $totals['shipping_total'] + $totals['subtotal_tax'] + $totals['shipping_tax'];
            $amount = ($cart_total * 15) / 100;
            if ($amount > woo_wallet()->wallet->get_wallet_balance(get_current_user_id(), 'edit')) {
                $amount = woo_wallet()->wallet->get_wallet_balance(get_current_user_id(), 'edit') < 1000 ? woo_wallet()->wallet->get_wallet_balance(get_current_user_id(), 'edit') : 1000;
            }
        }
        return $amount;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Woowallet/Terawallet max limits’ is closed to new replies.