Skip to content

Commit 45e6680

Browse files
MAGETWO-55301: Enable tax rate calculation on address change without shipping methods
1 parent 65f12ba commit 45e6680

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

app/code/Magento/Checkout/view/frontend/web/js/model/cart/estimate-service.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ define([
1919
quote.shippingAddress.subscribe(function () {
2020
var type = quote.shippingAddress().getType();
2121

22-
totalsProcessors['default'] = totalsDefaultProvider;
23-
totalsProcessors[type] ?
24-
totalsProcessors[type].estimateTotals(quote.shippingAddress()) :
25-
totalsProcessors['default'].estimateTotals(quote.shippingAddress());
26-
27-
if (!quote.isVirtual()) {
22+
if (quote.isVirtual() || window.checkoutConfig.activeCarriers.length() === 0) {
23+
// update totals block when estimated address was set
24+
totalsProcessors['default'] = totalsDefaultProvider;
25+
totalsProcessors[type] ?
26+
totalsProcessors[type].estimateTotals(quote.shippingAddress()) :
27+
totalsProcessors['default'].estimateTotals(quote.shippingAddress());
28+
} else {
2829
// check if user data not changed -> load rates from cache
2930
if (!cartCache.isChanged('address', quote.shippingAddress()) &&
3031
!cartCache.isChanged('cartVersion', customerData.get('cart')()['data_id']) &&

0 commit comments

Comments
 (0)