• Resolved sultan51

    (@sultan51)


    Hi,

    I would like to put the wallet as only payment method and delete other payment method added from WooCommerce, can you help me ?

    Thanks !
    Best regards.

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

    (@subratamal)

    Hi @sultan51,

    Sorry for delayed response. Please use below code to theme function.php file to remove all other payment gateways except wallet.

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

    Cheers!!!

Viewing 1 replies (of 1 total)
  • The topic ‘Disable woocommerce payment’ is closed to new replies.