-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cart error issue #633
Cart error issue #633
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested both fixes and it all looks good. This one was sneaky.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff for finding the root cause 👍
@ludoboludo just added this to famme.no and the cart seems broken. |
@gregjotau could you provide some details on what's not working so I can see if I can replicate the issue locally ? |
try adding to cart |
I tried to revert, but it is still not working... |
https://github.com/gregjotau/dawn-famme The repo is here, there is not much customization @ludoboludo |
product-form.js?v=3576239225032671514? [sm]:21 Uncaught TypeError: Cannot read properties of null (reading 'classList') |
We just sent out an "email blast" so a lot of lost customers now :( |
@ludoboludo no product pages are working. Adding to cart simply does not work anymore. |
A video, this is critical as I cannot fix it even with a revert. Screen.Recording.2021-09-17.at.23.07.10.mov |
Ah I think it's because there are some changes in other PR that you haven't added to your store. Take a look at this file and the PR that goes with it. Did you add that to your store as well ? #576 and specifically the |
2 sec |
It changes how the |
yeah, have already cherry picked #576 |
but might not have merged it correctly |
OK, spotted something in base.css |
Nope, sorry, still does not work |
Yeah I see that on variant change it seem to remove the For now I'd suggest adding a conditional around this.querySelector('.loading-overlay__spinner').classList.remove('hidden'); So have it say: if (this.querySelector('.loading-overlay__spinner')) this.querySelector('.loading-overlay__spinner').classList.remove('hidden'); |
2 sec |
That seemed to work, but the spinner does not work for add nr 2, but OK. That should be fine for now. |
OK, thanks for the quick help! |
Have to sleep now. Keep up the great work 🤓 |
Yeah something we will look into this first thing next week 👍 Seems like the variant change is removing the spinner. Then making the JS fail. Didn't come up from this PR but something we did recently that had this unexpected impact. |
np! Have a great weekend :) |
* first draft * found a fix! Thanks Tyler :) * remove error in catch
Why are these changes introduced?
Fixes #380
What approach did you take?
Two fixes in this PR:
ID
as the form for thecart-items
. Changing the one from the cart notification to make sure there wasn't a duplicate fixed a couple things: pressingEnter
will submit the form and take you to checkout and when changing the quantity by highlighting the number and pressingEnter
you will get an error message if you try a higher quantity than available.body
when clicking on an input that isn't oftype="text"
. So I added a check in the if statement so it doesn't error anymore.Other considerations
There isn't a fix for the situation where for example:
10
but no error is mentioned.This to me seems like there could be some work done platform wise to handle cases like this. Otherwise we need to run lots of checks and logic.
Demo links
Checklist