When clicking on checkout it redirects back to cart - cant get to checkout page

khn
Visitor
1 0 0

Hi I am having an issue where when I click on the "Checkout" button of my site it redirects back to the "Shopping cart"page and thus you cant get to checkout to make payment.  When i look at the address bar i see at the end "no cookies from redirect1" appear but i haven't setup any redirects.

 

Could anyone help with this?

Replies 18 (18)

ashiqueh4
Shopify Partner
361 34 57

could share me your store url?so i can check it .

Shopify ,Shopify plus and Shopify 2.0 theme developer and customization

I Would like to add new functionality or customize an existing one, please hire me.
If helpful then please Like and Accept Solution .
Email: ashiquehussaincodediary@gmail.com

htuckwiller
Visitor
3 0 0

hi there - my shop is doing this too... the weird thing is that it is ONLY doing it on my chrome browser. I tested it on my phone, it works fine. I tested it on safari, works fine. I tested it on another desktop chrome browser on another device, works fine. so it has sometime to do with my browser I believe but I cannot figure out what? I have spent hours trying to figure out what the problem is. I cleared cookies and uninstalled/reinstalled chrome - that didn't work. any thoughts? 

my URL is bluehollyhock.com

password is: holly

Thank you!

ashiqueh4
Shopify Partner
361 34 57

go to product-template 

and i will get this code in it 

<input type="submit" name="checkout" id="cartCheckout" class="btn cartDWcheckout" value="Proceed to Checkout" disabled="disabled">

just remove the "disabled="disabled"" from the code than it will work

final code will be like this :

<input type="submit" name="checkout" id="cartCheckout" class="btn cartDWcheckout" value="Proceed to Checkout">

Shopify ,Shopify plus and Shopify 2.0 theme developer and customization

I Would like to add new functionality or customize an existing one, please hire me.
If helpful then please Like and Accept Solution .
Email: ashiquehussaincodediary@gmail.com

Ashaan
Visitor
2 0 0

Hi @ashiqueh4, I had the same issue and was trying to follow your instruction. Do you mean to make the change to product-template.liquid? I am not able to find the line of code in this file you have specified to make the modification. (I am using the Debut theme). Would greatly appreciate your help. 
Thanks!

Gordon_Chan
Shopify Expert
27 2 20

I don't think modifying the theme code help. As it works sometime and not work another time.

From my investigation I can see from Chrome network panel, it attempts to reach the /checkout page, but then it being redirect back to cart.

It shall require Shopify Technical support engage on such issue, as it seems there is logic check on /checkout and it match a case causing it redirect back to cart.

It happens when I have login for some time in the store, e.g. over 24hrs. Upon clicking checkout button, the browser did perform form submit to /cart, then attempt to /checkout, but then it is being redirect back to /cart.

 

I wonder it is caused by any outdated cookie.

Look forward any Shopify support engagement.

http://gordon-chan.net
I am a Freelance Web Engineer. Dedicated my life to e-commerce development.
daviddietz
Tourist
6 0 3

Hi, Gordon_Chan. My store is doing that very thing now. Do you have any additional information/steps that I can look into?

daviddietz
Tourist
6 0 3

***UPDATE***

If you happen to be using some type of "preload.js" script to speed up your site (so when users hover over a link it preloads that URL), you might want to put an if/else or unless condition around that so that it DOES NOT LOAD on the cart page.

In my case, I found that it was running on every page of my site, including the cart page, and I have an "Empty Cart" button on that page. Whenever a user inadvertently hovers or scrolls their mouse over that button/link, it's preloading the "/clear" URL and clearing the cart. See the attached video for reference.


Gordon_Chan
Shopify Expert
27 2 20

Hi David,

My developing site does not persisting have that cart loop happen. This causes it much hard to debug. Fired a email to Shopify support but it doesn’t help and it is hard to esculate further as it does not happen all the time /-\.

I think your case is a bit different because you are having the clear cart button as a link instead of a button trigger. Also it seldom to have clear cart as that dominant (believe you dont want customer to re-add item if they accidentally treat it as checkout button.

http://gordon-chan.net
I am a Freelance Web Engineer. Dedicated my life to e-commerce development.
daviddietz
Tourist
6 0 3

Well, my Empty Cart button fires a Javascript "confirm" prompt to ensure the customer actually wants to empty their cart before doing so. But because the preload.js was running on the cart page, hovering over the link caused it to load the "/clear" URL without the prompt.

I found that the same thing was happening whenever a customer would hover/mouse-over the "Logout" link. They were being inadvertently logged out through the preload.js, too. I've updated my logout link to fire through Javascript instead of href.

Good luck!

Michellet1
Visitor
1 0 1

Hi @Gordon_Chan 
My team is facing the same problem you are. Some users on Desktop Chrome cannot checkout. They are redirected back to /cart whenever they hit checkout. Were you able to ever resolve this issue? 

robbinvan
Visitor
1 0 0

Hello brother, I tried to find the piece of code inside of product-template but could not find it.

If you mean that I need to paste '<input type="submit" name="checkout" id="cartCheckout" class="btn cartDWcheckout" value="Proceed to Checkout">' inside of the code, let me know where I should paste it. 

Thank you in advance and appreciate that you share this!

abbyadd
Visitor
2 0 0

Did you get an answer to this as  mine is doing the same?

Talha_Uddin
Shopify Partner
2 0 0

Hey @htuckwiller

how have you fixed this ? issue we are facing the same issue only in chrome it redirect back to cart page 

Thank you

abbyadd
Visitor
2 0 0
Try clearing cache, this resolved mine
tony_planes
Visitor
1 0 0

Thanks, this worked for me, but isn't a solution if it is happening to users en masse.  I have a headless Next JS/Shopify site with a checkout button that directs the user to the checkout url created via the storefront api.  However, some users on chrome click it and end up on the shopify cart page.  Clearing cache fixes the issue for any individual user but as we have 1000s of customers, we can't tell them all to clear their chrome cache when this happens.  Does anyone have another solution?

haddi
Shopify Partner
11 0 1

I had a similar issue with a cart drawer's checkout button, it's a simple "<a>" tag that although its "href" value is "/checkout", it redirects to "/cart", and it keeps doing that even when I remove its "id" and "class" attributes. And since I wasn't familiar with the codebase, and the JavaScript files were very messed up I couldn't figure out what was happening in a short time, I ended up overriding any events with my own code inside "onclick":

("id" and "class" attributes removed for clarity)

 

<a
  onclick="
    event.preventDefault();
    window.history.pushState('', '', '/checkout');
    window.location.href = '/checkout';
  "
  href
>

 

the "pushState" method is just to make it seem as though it's an effect of "href", because when I kept the "href='/checkout'", the "onclick" code still didn't override whatever was happening, so I had to keep the "href" empty.

Mohamed, web developer.

Eniac
Shopify Partner
11 0 0

I have the same issue, when I create a checkout through graphql, and get the webUrl for checkout.
then I jump to the checkout page but I came back to /cart.

Just as Gordon_Chan said, you can see in the chrome network console that the request is redirected to the cart page.
and I found that when there is no products in checkout, it will come back to /cart.
if there are something in checkout, it works correctly.

robwatkins88
Shopify Partner
14 0 0

Has there been and fixed put in place for this, its only a problem on Shopify plus and it affects a number of theme files. From the investigations we have done we can see the issue relates to cookies on the Shopify side, when cookies for the cart are not found the basket redirects back to the cart page resulting in a loop, the only way to fix this issue is for the cookies to be deleted. 

 

The URL redirects to URL no_cookies_from_redirect=1

 

It seems highly unlikely to be a change the store front owner has implemented when its been going on for years and affects different store fronts. Weve succesfully added tracking to this event and its happening frequently resulting in loss sales.