• Resolved infbooster

    (@infbooster)


    hi, i have been thinking is it possible to make my customer check out by wallet only. I know that i can disable other payment method on woocommerce but that will disable my customer top up their wallet. so is there any way i can have a payment method for wallet top up and when they check out for products purchase it will show wallet payment only.

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

    (@subratamal)

    Hi @infbooster

    Thanks for reaching out please use below code in active theme function.php file to pay only via wallet.

    if(!function_exists('woocommerce_available_payment_gateways_callback')){
        function woocommerce_available_payment_gateways_callback($_available_gateways){
            if(!is_admin() && !is_wallet_rechargeable_cart()){
                foreach ($_available_gateways as $id => $gateway){
                    if('wallet' != $id){
                        unset($_available_gateways[$id]);
                    }
                }
            }
            return $_available_gateways;
        }
    }
    add_filter('woocommerce_available_payment_gateways', 'woocommerce_available_payment_gateways_callback');

    Thank you.

Viewing 1 replies (of 1 total)
  • The topic ‘Pay by Wallet only’ is closed to new replies.