Checkout page redirect for not logged in users
-
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 byWC()->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 .
- This topic was modified 4 years, 4 months ago by .
- This topic was modified 4 years, 4 months ago by .
The page I need help with: [log in to see the link]
- The topic ‘Checkout page redirect for not logged in users’ is closed to new replies.