Skip to content

Commit

Permalink
MAGETWO-39475: [GITHUB] No error message shown when purchase qty mism…
Browse files Browse the repository at this point in the history
…atch the 'Qty Increments' setup #1411
  • Loading branch information
Michail Slabko committed Jul 9, 2015
1 parent e9b1713 commit b3b89a3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ define([
$('body').trigger(self.options.processStop);
}

if (res.backUrl) {
window.location = res.backUrl;
if (res.redirect) {
window.location = res.redirect;
return;
}
if (res.messages) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Checkout/Controller/Cart/Add.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ protected function goBack($backUrl = null, $product = null)
$result = [];

if ($backUrl || $backUrl = $this->getBackUrl()) {
$result['backUrl'] = $backUrl;
$result['redirect'] = $backUrl;
} else {
if ($product && !$product->getIsSalable()) {
$result['product'] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ define([
getFromServer: function (sectionNames) {
var parameters = _.isArray(sectionNames) ? {sections: sectionNames.join(',')} : [];
return $.getJSON(options.sectionLoadUrl, parameters).fail(function(jqXHR) {
throw new Error(jqXHR.responseJSON.message);
throw new Error(jqXHR);
});
}
};
Expand Down Expand Up @@ -134,6 +134,10 @@ define([
var sections = sectionConfig.getAffectedSections(settings.url);
if (sections) {
customerData.invalidate(sections);
var redirects = ['redirect'];
if (_.isObject(xhr.responseJSON) && !_.isEmpty(_.pick(xhr.responseJSON, redirects))) {
return ;
}
customerData.reload(sections);
}
}
Expand Down

0 comments on commit b3b89a3

Please sign in to comment.