Add to Cart doesn't work on variant changes

Topic summary

Issue: On variant changes (size/color), the product page disables (“greys out”) the Add to Cart button, preventing purchase.

Context: Variants are product options like color and size. Initial guidance suggested checking inventory levels. The store owner confirmed inventory is available for all products and suspected a variant-related issue.

Latest findings: After the store URL was shared, a reviewer identified a JavaScript error in the theme as the likely cause. A screenshot highlighting the error was provided, indicating a code-level problem rather than inventory settings.

Recommendations shared:

  • Inspect and fix the theme’s JavaScript causing errors during variant selection.
  • Revert or remove recent changes (new apps or custom theme code) that may have introduced the issue.

Status: No confirmed resolution yet. Next steps hinge on correcting the theme’s JavaScript and rolling back recent customizations to restore Add to Cart functionality.

Notes: The attached image (screenshot of the JS error) is central to understanding the diagnosis.

Summarized with AI on December 25. AI used: gpt-5.

Please help!

When I try to change the color or Size of a product, the “Add to Cart” greys out and you are unable to add to Cart. Please help!

Hi @PPKY2024 ,

Please check the quantity of products in your inventory carefully.

Hi, i have inventory available in all the products. I think it has something to do with the actual variants themselves. But I don’t know what.

Hi @PPKY2024 ,

Can you kindly share your store link (with the password, if any) with us? We will check it and suggest you a solution if possible.

https://perfectlypressedky.com/

Hi @PPKY2024 ,

There is an issue with the JavaScript code in your theme.

Hello @PPKY2024 ,

Try to remove the recent changes you did in the store.
New apps or customization in the theme code.

Thanks