• Hello, dear woocommerce support!

    Sorry about bothering you, I have some issue with checkout page for not logged in users. It always redirects the user to the cart page. On the link page with which I need help, you can see it. Also, in the network tab, it returns 302 http code.

    But it works correctly and showing checkout page for logged-in user(me as admin).

    Here is some setting from woocommerce product tab https://prntscr.com/tdnnyh. Also, orders allowed for users without account https://prntscr.com/tdno8s.

    If it helps, I have no any extra plugins, and the theme was developed from scratch by me.
    And on the checkout page I created I display the woocommerce checkout with the shortcode. Here how it looks https://prntscr.com/tdnpom.

    I tried to switch to default page, removed some code from my checkout template – but the result is always the same, if I’m not logged in, I am redirected to the cart on checkout.

    I also tried hooks to redirect user to the checkout page and skip cart(woocommerce_add_to_cart_redirect). But also without any result.

    Maybe I missed smth? Can you please help or adjust me something?
    Thanks in advance!

    UPD: what I just noticed, that if I’ll go to the checkout url with add-to-cart parameter, it does not redirect to the cart page, and works correctly. So, may this issue appear with an empty cart? If so, how can I prevent it?
    On the code of the checkout page template I am adding some items to cart by WC()->cart->add_to_cart($product_id), but it seems that it does not run the code, and redirect before page load.

    • This topic was modified 4 years, 4 months ago by ahordii.
    • This topic was modified 4 years, 4 months ago by ahordii.
    • This topic was modified 4 years, 4 months ago by ahordii.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    Just to make sure – is everything working as expected when switching to the default TwentyTwenty or Storefront themes? I’m asking as it sounds like the issue here is with your custom coding more than the core WooCommerce plugin itself.

    Thread Starter ahordii

    (@ahordii)

    yes, the behaviour is the same on the default themes
    actually, for me it really looks like with empty cart user can’t open checkout page

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Checkout page redirect for not logged in users’ is closed to new replies.