How can I modify the inventory error message in the Debut theme?

I am using the Debut theme. I have added a quantity box to my product page so customers can choose a quantity to purchase without having to edit the quantity in the cart. My problem is an error message that pops up when a quantity is chosen that exceeds the current available inventory. The current error message reads "You can't add more [product name] to the cart." The error message is blunt and vague. I don't want my customers trying all different numbers under they reach an available quantity, and the error message does not even imply that the problem is the quantity exceeding available inventory.
I am looking for 1 of 2 fixes:

1. Change the error message to read "We're sorry, that quantity exceeds our current available inventory." 

2. Change the quantity box to function as the quantity box in the cart currently functions, which is it defaults to the max available inventory when a large number is entered. For example, if their are 15 items available and the customer enters "20" into the quantity box, the quantity box automatically changes the "20" to "15".

@hiddenacres the 1st fix can be easily done. All you need to do is go to Online StoreActionsEdit CodeLocalesen.default.json.

You will see this banner:

Click on theme language editor.

Now in the Filter input box enter “add more”:

You will see this box here:

Change to whatever text you want to.

4 Likes

Thank you so much! This was driving me nuts, and I have no idea how to write/edit code, this is all foreign to me.

Thank you so so much!

Thank you for getting this far, but I want the message to also display the quantity available so its more user friendly. How can I do that?

1 Like