How to change the pop-up message for unselected variant on a product page?

Topic summary

Main issue: A cryptic pop-up error (“expected String to be a id: id”) appears on the product page when no variant is selected. After an app removed the pop-up, clicking “Add to basket” gives no feedback, confusing customers.

Desired behavior: Replace the error with a clear prompt like “Please select a variant,” or have the button show “Make a selection” until a variant is chosen, then switch to “Add to basket.”

Proposed approach:

  • Add a JavaScript check bound to the ATC (Add to cart) button click. If no variant is selected, display a readable message; otherwise proceed with add-to-cart.
  • This requires theme customization; consider referencing code from the previous theme where this worked.

On editing the exact error text: No direct solution provided. Suggestion is to inspect the working theme to see what “id” value it returns and replicate that logic in the new theme. Without code access, specifics can’t be given.

Latest update/status: Another participant asked for an easy solution; none shared yet. No code snippets or final fix posted. Discussion remains open.

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

Hi @Guleria I just know that our previous theme’s ATC button has that function, but don’t know how to navigate through that. How about the ‘expected string…’, do you know if it’s doable to edit that into a readable text?