• I’m exclusively using Klarna checkout as payment option in my store. Vipps is one of the payment methods inside Klarna checkout.

    To make sure that the checkout page always starts with Klarna checkout and not the default Woocommere checkout, I have checked the “Disable other gateway button” option that the Vipps plugin provides inside Klarna checkout.


    The issue comes when a user already initiated a payment with Vipps through Klarna checkout and then comes back to the checkout page.
    It saved that this session was using Vipps, so it switches back to the Woocommerce default checkout form.

    Is there anything I can do, to prevent this from happening?

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Iver Odin Kvello

    (@iverok)

    There is actually code to prevent that in the plugin; but it seems it is failing. Could you try to add this to your child-themes functions.php or a plugin:

    add_action( 'woocommerce_checkout_order_processed',
    function ($order_id, $posted_data, $order ) {
    WC()->session->set('chosen_payment_method', 'kco');
    }, 10, 3);

    It should set the chosen payment method to Klarna Checkout whatever payment method was used.

    Thread Starter kebom

    (@kebom)

    Thanks for the reply.

    I added it, but the behaviour remains the same.

    Plugin Author Iver Odin Kvello

    (@iverok)

    Ok, that explains why the included reset doesn’t work. On re-reading the KCO code here I see that ‘chosen_payment_method’ is actually set another place entirely. We’ll fix it at our end, but could you try replacing the previous code with this:

    add_action( 'woo_vipps_before_redirect_to_vipps',
    function ($order_id ) {
    WC()->session->set('chosen_payment_method', 'kco');
    }, 10, 1);
    Thread Starter kebom

    (@kebom)

    Yes this seems to have worked, thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Klarna checkout issue with “Disable other gateway button” option.’ is closed to new replies.