The dropdown variant selector doesn't seem to be working

Topic summary

Problem: On a Shopify product page using a dropdown variant selector, the Add to Cart button becomes disabled after selecting any option. Switching the selector to “pills” works. A link and screenshots are provided (images are central to understanding).

Attempted fix: One responder advised editing pickup-availability.js, replacing “this.dataset.rootUrl” with “this.dataset.baseUrl” (line ~16). This targets the pickup availability script’s base URL reference.

Result after fix: Selecting a variant (e.g., “2 hours”) now shows “Sold out” despite stock on all variants. After a page refresh, the same variant loads preselected and functions, suggesting the bug occurs during variant-change handling rather than inventory.

Analysis from responder: The error stems from logic when switching variants. They recommended contacting the theme’s support for a proper fix.

Constraint: The store uses a free Shopify theme, and the OP notes support is limited; they request additional guidance.

Status: No confirmed solution. Outstanding issue: ensure the dropdown variant-change logic updates availability/state correctly to avoid false “Sold out” and re-enable Add to Cart. Discussion remains open.

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

If you go to this page, you’ll see you can add to cart before you dropdown, but second you select an option it won’t allow you to add to cart or press the button. https://silkhuis.com/products/event-charge

If i change in theme editor the pills , then this works fine but i want dropdown. I think maybe i edit something in code that’s done this but I tried a few things can’t see what, if anyone could help, i be very grateful. Thanks :slightly_smiling_face:

  • Here is the solution for you
  • Please follow these steps:

  • Then find the pickup-availability.js file.

  • Find the code “let rootUrl = this.dataset.rootUrl;” at line 16 and replace with the following code: “let rootUrl = this.dataset.baseUrl;”

  • And press ‘Save’ to save it.

  • Please press ‘Like’ and mark it as ‘Solution’ if you find it helpful. Thank you.

Thanks. Now if i dropdown to 2 hours for example, it now shows as sold out (even though it has stock assigned to all variants), then when i refresh page, it’s on 2 hour variant by default and works, which isn’t ideal.

The current error is due to an error in the processing logic when selecting another variant. You can contact the theme’s support to fix the error.

As it’s a shopify free theme, this is something they do not extend their support on - if you’re able to offer any further insight into the issue would be greateful. Thanks.