hi, I am experiencing issues with the quantity selector buttons and cart functionality - they’re unresponsive or loading indefinitely. Please help, I suppose I have messed up something in the custom codes.
Welcome to the community.
It happens, if you made changes in theme code editor, for each file you have a version history so check latest one you edited.
But also, if you could share you store we can check it out and hopefully, pinpoint the issue.
(post deleted by author)
(post deleted by author)
Sharing code is nice, but you could share a link to your store?
You expect too much to debug just from code ![]()
Thanks @NEEDHELP12_s3
Sorry, I did not mention, but as your storefront is password-protected, please share the password. It is in Online Store > Preferences.
You have an JavaScript error in product -info.js
TypeError: Cannot read properties of null (reading 'classList')
at HTMLElement.fetchQuantityRules (product-info.js?v=56072522032945715171768259342:1:9642)
And actuall code is
fetchQuantityRules() {
const currentVariantId = this.productForm?.variantIdInput?.value;
if (currentVariantId)
return this.querySelector(".quantity__rules-cart .loading__spinner").classList.remove("hidden"),
fetch(`${this.dataset.url}?variant=${currentVariantId}§ion_id=${this.dataset.section}`).then(response => response.text()).then(responseText => {
const html = new DOMParser().parseFromString(responseText, "text/html");
this.updateQuantityRules(this.dataset.section, html)
}
).catch(e => console.error(e)).finally( () => this.querySelector(".quantity__rules-cart .loading__spinner").classList.add("hidden"))
}
becasue
querySelector(".quantity__rules-cart .loading__spinner")
as that element does not exist.
Note that in dawn/assets/product-info.js at main · Shopify/dawn · GitHub
that functions is slightly different,t so try that code.
And I think you are missing this line, maybe removed.
Compare with your code. Maybe you intentionally remove loading sppiner but that JS code was left.
Also, that could be just the first JS error, but I do not see others.