Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I just noticed the "Add to Cart" button becomes disabled as soon as I pick a variant of one of my products, like a hat size, making it impossible to add those items to my cart. However, I can add an item if I don't pick a variant or if there is only one variant available or if I refresh the page after selecting a variant.
My website (and product page to test issue): https://grayfoxww.com/products/flexfit-branded-hat-white
Thank you in advance!
Solved! Go to the solution
This is an accepted solution.
Hi @GrayFox,
Please go to sections > main-product.liquid file, find 'pickup-availability'. Please check the declaration of pickup-availability.js file, is it like the following screenshot?
If the declaration is correct, please go to Assets and create the file pickup-availability.js
After that, copy the following code and paste it in: https://github.com/Shopify/dawn/blob/main/assets/pickup-availability.js
Hope it helps!
The sites theme has a console error:
global.js?v=138967679220690932761645924793:810 Uncaught TypeError: pickUpAvailability.fetchAvailability is not a function
at VariantSelects.updatePickupAvailability (global.js?v=138967679220690932761645924793:810:26)
at VariantSelects.onVariantChange (global.js?v=138967679220690932761645924793:746:10)
Issues like this can often stem from modifications made to the related product template, such as invalid html, or important javascript not being output.
Contact [email protected] for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Thank you for finding the issue. How would I go about fixing it? I'm really not well-versed in coding to go at it by myself. I had a hard enough time describing the issue. Haha
I found the code that needs to be altered, I just don't know how to alter it.
This is an accepted solution.
Hi @GrayFox,
Please go to sections > main-product.liquid file, find 'pickup-availability'. Please check the declaration of pickup-availability.js file, is it like the following screenshot?
If the declaration is correct, please go to Assets and create the file pickup-availability.js
After that, copy the following code and paste it in: https://github.com/Shopify/dawn/blob/main/assets/pickup-availability.js
Hope it helps!
Hi, I tried this and I already had the pickup-availability.js function. It did not work. I still cannot add to cart.
Hey @GrayFox,
If you want to continuously monitor and test your store for issues like "add-to-cart not working" and "checkout not working", you can use this free app called Store Watchers - Automated Testing & Monitoring Solution for Shopify.
This app will help you monitor whether your functionalities are operational or not. If any issue occurs and your customer is facing it then you can take immediate steps to fix these issues and offer your customer a great purchasing experience.
Hope this helps 🙂
I was having the same issue, turns out that it happens when my variants have the "/" symbol in their names, I switched from "2 - Sky Blue / Matte" to "2 - Sky Blue Matte" and now the Add to cart button works again on my variants.
I hope this helped!
Was this symbol in the code?
How can I see if that is my issue?
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024