• Resolved cushbin

    (@cushbin)


    Hi,
    Is there any way to limit the usage of wallet balance same as in the cashback? It will be great if admin can set a maximum usable amount or percentage of the wallet balance in checkout. For example, if a customer have 100 usd in wallet and he purchases a product for 200 usd, and admin have an option to limit maximum 20% of cart value to deduct, then the user can deduct only 40 usd from wallet and rest can be paid from gateway, instead of paying the entire 100 from wallet.
    Is it possible?

    Thanks in advance.

    The page I need help with: [log in to see the link]

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

    (@subratamal)

    Hi @cushbin,

    Use this code to themes function.php file.

    add_filter('is_valid_payment_through_wallet', '__return_false');
    add_filter('woo_wallet_partial_payment_amount', 'woo_wallet_partial_payment_amount_callback', 10, 2);
    
    function woo_wallet_partial_payment_amount_callback($amount, $order) {
        if (!is_null($order)) {
            $order_total = $order->get_total('edit');
            if ($amount > $order_total) {
                $amount = ($order_total * 20) / 100;
            }
        } else if (sizeof(wc()->cart->get_cart()) > 0) {
            $cart_total = wc()->cart->get_total('edit');
            if ($amount > $cart_total) {
                $amount = ($cart_total * 20) / 100;
            }
        }
        return $amount;
    }

    Cheers!!!

    Thread Starter cushbin

    (@cushbin)

    Thanks a lot Bro! It worked perfect.
    Is there any way to exempt the shipping charges from the calculation of cashback and the wallet amount redeeming? Right now its calculated on the grand total. I afraid I cannot afford that much as sometimes shipping charges are huge in international shipments.

    Also, I noticed the wallet balance is shown in Indian Currency is not converted, just showing Rs. 100 even if the balance is USD 100. I am using the Price based on country plugin to show INR to Indian customers. this is the plugin homepage: https://www.ads-software.com/plugins/woocommerce-product-price-based-on-countries/

    Please see that in action @ https://cushbu.com

    Plugin Author Subrata Mal

    (@subratamal)

    Hi @cushbin,

    Regarding cashback yes, it can be done but you have to do some custom coding.

    And for multi currency support we don’t have support for WooCommerce price based on country but it can be done easily by using our hooks and filters.

    Thread Starter cushbin

    (@cushbin)

    Hi @subratamal,
    Thank you for the fast response.
    If you can customize it, what will be the charges? Please give a quote if you are able to do it, including Multi currency support.
    Thanks in advance.

    Plugin Author Subrata Mal

    (@subratamal)

    Please reach out us at [email protected] regarding this.

    I am setting up my e-commerce website with your plugin. However, I plan to give 100% cashback to users in their wallet on their first buy on whichever product they buy and from then onwards product based cashback. Also I want to limit the wallet usage by a certain percentage of the product value.

    Will I be able to realize this??

    Thanks for your help in advance

    for the code you provided above this is what I got after I tried to update the functions.php file

    Your PHP code changes were rolled back due to an error on line 88 of file wp-content/themes/lapa/functions.php. Please fix and try saving again.

    Uncaught Error: Call to a member function get_total() on string in wp-content/themes/lapa/functions.php:88
    Stack trace:
    #0 wp-includes/class-wp-hook.php(286): woo_wallet_partial_payment_amount_callback(‘279.00’, ‘NULL’)
    #1 wp-includes/plugin.php(203): WP_Hook->apply_filters(‘279.00’, Array)
    #2 wp-content/plugins/woo-wallet/includes/class-woo-wallet-frontend.php(444): apply_filters(‘woo_wallet_part…’, ‘279.00’, ‘NULL’)
    #3 wp-includes/class-wp-hook.php(286): Woo_Wallet_Frontend->woo_wallet_add_partial_payment_fee(Object(WC_Cart))
    #4 wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array)
    #5 wp-includes/plugin.php(453): WP_Hook->do_action(Array)
    #6 /home/admin/web/the-originals.in/public

    i am looking for same
    cashback on first purchase.. and cashback usage limit on next purchase like 20 or 25% of Product MRP can use cashbackupp amount maximum.. like use has 100 rupee cashback amount. and next purchasing is 200 .. in that case user can use maximum 25% of mrp .. mean 50 ruppe of cash.. rest of 150 + gst + shipping he need to pay
    thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘WooCommerce Wallet Limit settings’ is closed to new replies.