• Resolved cullachie

    (@cullachie)


    We are trialling both your plugins (Stripe Payment Plugin for WooCommerce AND WebToffee PayPal Express Checkout Payment Gateway for WooCommerce ( Free ) and we want the Stripe payment using bank cards to be the deafult ie it is pre-selected and its radio button is active.
    We have Stripe Payment Plugin for WooCommerce at the top of the list bin Woo payments but it seems no matter what we do, the Paypal button is live when the page is opened.

    Is there a fix for this please?

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support WebToffee Support

    (@webtoffeesupport)

    Hi @cullachie,

    Greetings from WebToffee support.

    The payment method in the top of the list is given the priority and it will be preselected for new users. However, for existing users their last used payment method will be selected by default.

    As this is the functionality provided by WooCommerce, we don’t have any control over it.
    In any case, while searching for a solution online, we came across a thread on stackoverflow.com. We have replaced the correct payment ID for the Stripe payment method and attached the code snippet below.

    add_action( 'template_redirect', 'define_default_payment_gateway' );
    function define_default_payment_gateway(){
        if( is_checkout() && ! is_wc_endpoint_url() ) {
            // HERE define the default payment gateway ID
            $default_payment_id = 'eh_stripe_pay';
    
            WC()->session->set( 'chosen_payment_method', $default_payment_id );
        }
    }

    Please copy the code snippet from below and paste it into your active theme’s function.php file (WordPress Dashboard > Appearance > Theme Editor > functions.php) or you can use the?Code Snippet plugin to do that for you.

    Kindly check using the code snippet and let us know how it goes.

    Thread Starter cullachie

    (@cullachie)

    Great support, many thanks. Will give it a spin today and let you know.

    Thread Starter cullachie

    (@cullachie)

    Marvellous, that worked exactly as i wanted.

    Many thanks for super support!

    Plugin Support WebToffee Support

    (@webtoffeesupport)

    Hi @cullachie,

    We are glad to hear that.

    If you like the plugin and support, please leave us a review here.
    Your feedbacks are very important to us and it would really help us stand out in the WordPress community!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Making Stripe the default’ is closed to new replies.