Skip to content

Commit 65740bc

Browse files
committed
Allow 3rd party modules to perform actions after totals calculation
by returning the storage.post promise, third party modules can perform additional actions by adding .done/.fail or .always tasks to the request promise by creating a Javascript mixin for the totals processor.
1 parent 04fb965 commit 65740bc

File tree

1 file changed

+2
-2
lines changed
  • app/code/Magento/Checkout/view/frontend/web/js/model/cart/totals-processor

1 file changed

+2
-2
lines changed

app/code/Magento/Checkout/view/frontend/web/js/model/cart/totals-processor/default.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ define([
3838
payload.addressInformation['shipping_carrier_code'] = quote.shippingMethod()['carrier_code'];
3939
}
4040

41-
storage.post(
41+
return storage.post(
4242
serviceUrl, JSON.stringify(payload), false
4343
).done(function (result) {
4444
var data = {
@@ -96,7 +96,7 @@ define([
9696
) {
9797
quote.setTotals(cartCache.get('totals'));
9898
} else {
99-
loadFromServer(address);
99+
return loadFromServer(address);
100100
}
101101
}
102102
};

0 commit comments

Comments
 (0)