Shopify Add to Cart Not Working? Unmasking the AI-Generated Section Bug
Hey there, fellow store owners! Ever hit that "Add to Cart" button on your Shopify store only for... absolutely nothing to happen? It's a common, incredibly frustrating problem that can cripple your sales. We recently saw a fantastic discussion in the Shopify Community that perfectly illustrates how to diagnose and fix this, especially when custom code or AI-generated sections are involved.
The Case of the Silent Add to Cart Button
Our community member, aleeT, came to the forum with a "crucial issue." Their product pages on the Refresh theme had Add to Cart and Buy Now buttons that were completely unresponsive. No product was added to the cart, and critically, no requests were even being sent to /cart/add.js. The browser console remained silent – no errors, no warnings. The strange part? The exact same store and products worked perfectly on another theme, Origin. This strongly suggested the problem was specific to the Refresh theme itself or its modifications. As Maximus3 shared, a freshly installed Refresh theme works perfectly, demonstrating the issue isn't inherent to the theme:

The community quickly rallied, with experts like Hardeep, Priyasha, and others offering initial troubleshooting steps: checking for JavaScript errors, comparing the affected theme to a fresh install, and examining the Network tab in developer tools. Many, including Dan-From-Ryviu and devcoders, also rightly asked for the store's URL to investigate, which aleeT provided: TechNova.
The "Aha!" Moment: The AI-Generated Culprit
This is where the power of community expertise truly shone. One sharp-eyed expert, wilhelmpa, investigated aleeT's product page directly and quickly pinpointed the exact issue. The product page on the Refresh theme was missing something fundamental:
- There was no cart form at all – no
and noelement anywhere in the HTML. - The Add to Cart button was simply this:
That class name, starting with ai-premium-product-, was the giveaway! The button was a plain type="button", sitting completely outside any proper form, and crucially, had no JavaScript bound to it to tell it what to do. It was just visual markup, designed to look like an Add to Cart button, but without any underlying functionality. As Laza_Binaery and others suspected, this was almost certainly due to an AI tool, possibly "Sidekick," generating a custom product section that overlooked critical functional requirements. Laza_Binaery even shared a screenshot suggesting how one might try to prompt such an AI tool:

Why a Simple Button Isn't Enough for Shopify
Modern Shopify themes, especially OS 2.0 themes like Refresh, rely on specific HTML and Liquid structures to handle cart additions. The Add to Cart button needs to be nested within a custom element, which itself encapsulates the {% form 'product', product %} Liquid tag. This form is responsible for sending the product's variant ID and quantity to Shopify's cart API (/cart/add.js). Without this proper structure, the button has no instruction set to follow, leading to the silent failure aleeT experienced.
VikashJ from Apploy perfectly summarized this: "The most common cause of exactly this symptom (silent, no console error, no network request) is: A duplicated or malformed wrapper... if it's sitting outside that wrapper, that's almost certainly your root cause."
Your Two Paths to a Working Cart
If you're facing a similar issue, here are your options:
Path 1: The Quick Fix (Recommended for Most)
This is the fastest and easiest way to get your Add to Cart button working again:
- Access your Theme Editor: From your Shopify admin, go to Online Store > Themes. Find your Refresh theme and click Customize.
- Navigate to a Product Page: In the theme editor, use the dropdown at the top to select Products > Default product (or the specific product template with the issue).
- Identify and Remove/Hide the AI Section: In the left-hand sidebar, look for a section containing the problematic Add to Cart button. It might have classes like
ai-premium-product-or be clearly labeled as a custom/AI-generated section. You can either hide it (eye icon) or remove it. - Add the Default Product Information Section: Click Add section in the sidebar and select the standard Product information section. This includes all necessary components.
- Save Your Changes: Hit Save!
This reverts your product page to use the theme's built-in, functional components.
Path 2: Keeping Your Custom Design (Requires Code Knowledge)
If your AI-generated design is essential, you'll need to modify the code to properly embed your button within a Shopify product form:
- Locate Your Product Template File: In your theme code (Online Store > Themes > Actions > Edit code), find the relevant product template or custom section file (e.g.,
main-product.liquid). - Wrap Your Button in a Product Form: Your custom button needs to be inside a Liquid product form and, for AJAX behavior (like Refresh theme usually has), within a
custom element. Here's the structure you'll need, including the hidden variant ID input and atype="submit"button:{% form 'product', product %} {% endform %} Remember, the
type="submit"on the button is critical here.
A Crucial Next Step: Variant Selection!
wilhelmpa also wisely pointed out another potential pitfall: if your AI-generated section includes custom color swatches or size options, they might just be visual `divs`. They often don't automatically update the hidden variant ID input () in your form. If you go with Path 2, you'll need to add custom JavaScript to ensure that when a customer selects a variant, the correct variant ID is passed to that hidden input. Otherwise, every order will just add the first available variant, regardless of what the customer picked!
This community discussion perfectly highlights that while tools like AI can offer amazing design flexibility, they sometimes miss the fundamental functional requirements of an e-commerce platform. Always, always test your core conversion paths thoroughly after any significant theme modifications, whether they're manual code changes or AI-generated sections. A responsive Add to Cart button isn't just a convenience; it's the lifeline of your Shopify store!