How do I edit product-form__error-message in Dawn 15.1?

How do I edit product-form__error-message in Dawn 15.1?

pena2o
Visitor
1 0 0

If I have 5 of a product in stock and a customer attempts to buy 6, they get an error message that says, "You can't add more <product variant name here> to the cart." However, it adds 5 to their cart without letting them know until they go to the cart.

How can I edit this message to say "You can't add more than <available inventory quantity here> to the cart. The <available inventory quantity here> available have been added to your cart."?

I checked my en.default.json and there is no product-form__error-message to edit. Any ideas? 

Screenshot 2024-09-13 at 11.39.50 AM.png

Reply 1 (1)

PaulNewton
Shopify Partner
7213 637 1499

Hi @pena2o  👋 It varies by theme , if a UI text isn't available in the locale editor  then likely the error message needs to be edited either in a template or it's hardcoded in the javascript or the error response might need to be intercepted from the api and replaced with the wanted message.

 

Finding out which for some themes typically means hopping through the debugger want watching the network request and related javascript.

 

If you need this customization then contact me by my email for services.
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org