Open the assets/theme.js
and search for response.responseJSON.description
. It should be withing the _addItemToCart
method. Add the following .replace("Required parameter missing or invalid: items", "Please pick a size")
. So after this change the whole method should look like the below:
_addItemToCart: function(data) {
var params = {
url: '/cart/add.js',
data: $(data).serialize(),
dataType: 'json'
};
$.post(params)
.done(
function(item) {
this._hideErrorMessage();
this._setupCartPopup(item);
}.bind(this)
)
.fail(
function(response) {
this.$previouslyFocusedElement.focus();
var errorMessage = response.responseJSON
? response.responseJSON.description.replace("Required parameter missing or invalid: items", "Please pick a size")
: theme.strings.cartError;
this._showErrorMessage(errorMessage);
this._handleButtonLoadingState(false);
}.bind(this)
);
},