Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I can't figure this out. When I load the page there is a chance that product photos with variants won't work, then I reload the page and then they work, but customer won't be reloading the page to see if it works. Sometimes it doesn't work even after reloading.
Solved! Go to the solution
This is an accepted solution.
I think it can prevent fast clicking on the Add to cart button. Try to click it fast 10 times for example. But in general, it works after commented.
Hi, share your URL, please.
there is a problem with the resetProductFormState function in your JS file.
resetProductFormState() {
const productForm = this.productForm;
productForm?.toggleSubmitButton(true);
productForm?.handleErrorMessage();
}
You can see in the console:
If the issue disappears after a page reload, it suggests a timing issue - your script might be running before productForm is properly initialized.
What function does it serve? I commented it out and now it seems to be working. Can I live without it?
This is an accepted solution.
I think it can prevent fast clicking on the Add to cart button. Try to click it fast 10 times for example. But in general, it works after commented.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025