Re: 'expected String to be a id: id'

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

veamrqz
New Member
7 0 0

Hi everyone!

 

We have this pop up ( 'expected String to be a id: id' ) showing on our product page when a variant isn't selected yet.

 

One of our apps was able to remove this, however, when 'Add to basket' is clicked, there's no message or anything that tells the customer to select a variant. Which in turn, may make our customers think that there's something wrong in our website. We have received some concerns about this already.

 

Would it be possible to change this message into something readable, like 'Please select a variant'?

 

Alternatively, on our previous theme, the button when a variant isn't selected yet says 'Make a selection' and when a variant has been selected already, it says 'Add to basket'. How can we do this on our theme, please?

 

Thanks in advance to those who'll response  🤗

 

 

Replies 3 (3)

Guleria
Shopify Partner
3225 628 903

Hello @veamrqz ,

You need to use a js function which will trigger on click of the atc button. 
On click you have to check if there is a variant selected or not. If not show your message else  let the atc to work as it is.btw keep note without customizing the theme it's not possible to provide code for it just I suggest asking a developer to do it for you. Alternatively as you said in your previous theme it was working so you can take an idea or code from there. 

 

Thanks

- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on store Hire me. - Email: guleriathakur43@gmail.com - Skype: navrocks1 ,
- Try GEMPAGES a great page builder
- Support me PayPal
veamrqz
New Member
7 0 0

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?

Guleria
Shopify Partner
3225 628 903

Without the access of the code no I don't know.

btw if you know you just need that id first check in the working theme what it returns in the working theme.

And once you understand it, use the same logic in the new one so the new theme returns the same value.  

- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on store Hire me. - Email: guleriathakur43@gmail.com - Skype: navrocks1 ,
- Try GEMPAGES a great page builder
- Support me PayPal