Closed indextwo closed 1 year ago
Hi @indextwo , it might happen because of the https://liquid-ajax-cart.js.org/reference/updateOnWindowFocus/ parameter. When your focus is in the console and if you go back to the page -- Liquid Ajax Cart will run a request just to update the cart. Just set this option to false when you are developing.
@EvgeniyMukhamedjanov Thanks for this - I missed that reference page, so that's super-handy to have.
As it happens, I think this may have been some Shopify weirdness 🥴 I asked a friend to check it for me on their computer. As I was recreating the steps (on one of those showcase stores), I noticed it suddenly wasn't happening any more. Went back and checked the 3 sites where I was able to recreate the problem, and now it seems to be fine?
Shopify wasn't letting anyone log in earlier this morning, so I'm just going to assume it was Shopify having a rough morning and leave it at that 😬
Yeah, Shopify is so... Shopify :-)
I'm a Shopify dev creating a new theme from scratch (so there's no existing JS interfering with cart functions), but I was initially baffled when I first implemented this and it didn't seem to work. It would send an XHR request that showed up in the console, and the classes would be added/removed on the
body
, but then the actual cart quantities wouldn't update.It wasn't until I tested this on one of the sites listed on the project homepage using
liquid-ajax-cart
that I saw the same behaviour (I'd glanced at it earlier and it seemed to work just fine) - then I put 2 & 2 together: with the console/developer panel open, the ajaxified cart doesn't work. Close the panel, it works fine. I've tested this in FF 115 & Chrome 114 - same behaviour on both.To replicate
liquid-ajax-cart
)Note: I've tried this on at least 3 other stores listed in the Built with Liquid Ajax Cart and they all show the same behaviour.
This is a minor issue, as I don't imagine most people are browsing the web with the console open, but definitely seems odd.