Solving the Mystery: Why Your Shopify Store is Adding the Wrong Variant to Cart on Mobile

Hey fellow store owners!

Lately, I've seen a recurring issue pop up in the Shopify community that's a real head-scratcher: customers selecting a product variant (like a specific size or color) on mobile, only for the wrong variant (often the smallest or default one) to end up in their cart. It's frustrating for you, and even more so for your customers!

This exact scenario recently played out in a thread started by octopusgarden, who was using the Craft theme and suddenly found their mobile customers couldn't add the correct size of a dress to their cart. The community rallied, and we got some fantastic insights into what causes this and, more importantly, how to fix it. Let's dive in!

The Head-Scratching Problem: Wrong Variant on Mobile

Octopusgarden's issue was classic: on desktop, everything worked perfectly. Select a size, add to cart, no problem. But on mobile, no matter what size was chosen, the smallest variant was always added. What made it even more confusing was that it had been working fine for years, and then, seemingly out of nowhere, it broke.

Initially, @hamzatahir pointed out that this often stems from a mobile-specific theme error. When a customer selects a size, the theme tries to update the product details, but on mobile, this process breaks because some elements might be missing or not loading correctly. This stops the variant from updating, causing Shopify to default to the first available (often smallest) size.

Unmasking the Culprit: Slow Loading & App Remnants

While a mobile-only theme error is a good general diagnosis, the community dug deeper. @jpaylor quickly identified a more specific cause: page speed. If a customer clicks "Add to Cart" before all the necessary JavaScript code has fully loaded and executed, the variant selection logic simply isn't ready. The result? The cart defaults to the smallest variant.

And what was causing this sluggishness? Turns out, it was a rogue app! Specifically, files from instagrid.instasell.co.in were attempting to load, taking over 30 seconds and often failing. This effectively blocked the rest of the page's crucial JavaScript from running, creating a terrible user experience.

@tim_tairli confirmed this, noting that an app from Instasell (likely an older, unsupported one) was blocking the page from rendering properly, sometimes for as long as 25 seconds on desktop, and even longer on mobile. This meant vital sections like "Related products" and the footer wouldn't even appear until much later.

The key takeaway here? Even if you've uninstalled an app, its code can sometimes linger in your theme, causing unexpected problems and slowing down your site.

Your Action Plan: Removing Pesky Leftover Code

The good news is that diagnosing and fixing this kind of issue, while it can feel intimidating, is totally doable. Here’s a step-by-step guide based on the community's successful resolution:

Step 1: Back Up Your Theme (Crucial!)

Before you touch any code, ALWAYS duplicate your live theme. This is your safety net. If something goes wrong, you can quickly revert to the working version.

  • From your Shopify admin, go to Online Store > Themes.
  • Find your current theme, click Actions, and select Duplicate.

Step 2: Access Your Theme Code

Now, let's get into the theme editor:

  • From your Shopify admin, go to Online Store > Themes.
  • Find your current theme, click Actions, and select Edit code.

Step 3: Search for Problematic Files and Code

In the theme code editor, use the search bar (usually at the top) to look for common culprits. The community identified these specific files and domains:

  • instagrid
  • instasell.co.in
  • index.js (specifically in conjunction with the above domain)
  • index.css (specifically in conjunction with the above domain)

You're looking for code snippets that look something like this, often within .liquid files (like theme.liquid, product-template.liquid, or files within the sections or snippets folders):


image

Step 4: Remove the Found Code

Once you find these references, carefully delete the entire line or block of code related to instagrid.instasell.co.in. Be precise! Save your changes after each deletion.

Step 5: Check Theme Customization for App Blocks

Sometimes, apps also leave behind blocks in your theme customizer:

  • Go to Online Store > Themes > Customize.
  • Navigate to your product pages and check the footer section, or any other section where apps might inject content. Look for any blocks named "Instagrid" or similar.
  • If you find one, remove or disable it.

Step 6: Clear Your Mobile Device's Cache & Test

After making changes, it's crucial to clear your browser's cache on your mobile device (and any others you're testing with). Old versions of your site might still be cached, making it seem like the problem persists. Then, revisit your product pages and thoroughly test the variant selection and add-to-cart process.

When to Call for Backup

If you're not comfortable editing code, or if you can't find the problematic snippets, don't hesitate to reach out for help. You could contact a web developer or even the original app developer (though in this case, Instasell's app seems unsupported, as @tim_tairli noted). Sometimes it's worth the peace of mind to have an expert handle it.

As @jpaylor observed, once octopusgarden removed the problematic code, their site became "super quick" and the add-to-cart functionality was restored. It really highlights how much a single, poorly optimized or defunct app can impact your store's performance and conversion rates. Stay vigilant about the apps you install and always monitor your site's speed! It pays off.

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases