• Resolved Adrian Ladó

    (@adrianpo)


    Hi,

    I am a developer for PlatiOnline Payments plugin, which is a payment gateway based in Romania.

    We use a redirect to payment page and after the customer enters card details on our site, we redirect back to the website to display authorization response. Everything used to work perfect, but since a while ago, we have some problems on the order-received page. It asks for login, although the client is logged in when he is redirected to our payment page.

    We know that for Chrome we should set the session cookie as samesite = None, Secure to prevent this from happening, but as I can see WordPress doesn’t have this option.

    If I go to My Account I am logged in, but on the checkout order-received page it asks me to login. Any ideas how to fix this? For guest checkout I already applied woocommerce_order_email_verification_required filter and it works, but for logged in users the problem persists.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi there @adrianpo ??

    Thank you for contacting Woo support!

    If I go to My Account I am logged in, but on the checkout order-received page it asks me to login. Any ideas how to fix this? For guest checkout I already applied woocommerce_order_email_verification_required filter and it works, but for logged in users the problem persists.

    I understand that the issue appears for logged-in users only.

    Just to clarify, what does WP_DEBUG (link from the WooCommerce plugin developer handbook) reveal with regard to this?

    Thread Starter Adrian Ladó

    (@adrianpo)

    Hi @anastas10s, thank you for getting in touch with me. WP_DEBUG shows no error, and none in the debug.log.

    This is a printscreen of the order-received page asking me to login, although I am logged in as admin: https://pasteboard.co/A37WlPT7lkz5.png

    This happens only on Chrome, so this is why I suspect it has to do with cookie samesite none.

    Saif

    (@babylon1999)

    Hello @adrianpo,

    The team is already aware of this issue, it’s being tracked in this GitHub report: GitHub Issue #39750.

    A partial fix has already been pushed in version 8.2.0, and the team is continuing to work on further optimizations.

    I understand you’re inquiring about your plugin gateway, but if you’re managing client stores, you can find a few workarounds in this thread.

    I hope this clears the picture, and sorry for any inconvenience caused.

    Cheers!

    wpshushu

    (@wpshushu)

    Exactly same problem here, our store uses this payment gateway https://www.ads-software.com/plugins/ecpay-ecommerce-for-woocommerce/ which takes customer to the gateway’s site and then redirects him back to our site, on order-received page, customer is asked to login – even thouh he has already logged in.

    hrn1995 (woo-hc)

    (@aguinaldodarla)

    Hi @wpshushu

    Thanks for letting us know! As stated by my colleague, this has already been reported and is being actively worked on in this GitHub report:?GitHub Issue #39750.

    In the meantime, you can try the recommended workaround in this thread.

    I hope it helps!

    Thread Starter Adrian Ladó

    (@adrianpo)

    @aguinaldodarla From what I read, woocommerce_order_email_verification_required hook applies only on guest checkout. The described behaviour applies to registered and logged in users loosing session on redirect from payment gateway page to order-received page.

    wpshushu

    (@wpshushu)

    It appears that when the user is directed back from the payment gateway site, he is no longer logged in (get_current_user_id() being 0), which triggers this code in woocommerce/includes/shortcode/: class-wc-shortcode-checkout.php

        // For non-guest orders, require the user to be logged in before showing this page.
        if ( $order_customer_id && get_current_user_id() !== $order_customer_id ) {
            wc_get_template( 'checkout/order-received.php', array( 'order' => false ) );
            wc_print_notice( esc_html__( 'Please log in to your account to view this order.', 'woocommerce' ), 'notice' );
            woocommerce_login_form( array( 'redirect' => $order->get_checkout_order_received_url() ) );
            return;
        }
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Woocommerce order-received chrome asks for login’ is closed to new replies.