Skip to content

Commit c3e5ec1

Browse files
committed
ACP2E-1143: trigger tax / subtotal estimates refresh on shipping address updates
1 parent 89bc62e commit c3e5ec1

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ define([
3737
// check if user data not changed -> load rates from cache
3838
if (!cartCache.isChanged('address', quote.shippingAddress()) &&
3939
!cartCache.isChanged('cartVersion', customerData.get('cart')()['data_id']) &&
40-
cartCache.get('rates') //&& cartCache.get('totals')
40+
cartCache.get('rates')
4141
) {
42-
4342
shippingService.setShippingRates(cartCache.get('rates'));
4443
quote.setTotals(cartCache.get('totals'));
4544
return;
@@ -57,9 +56,8 @@ define([
5756
});
5857

5958
// update totals based on updated shipping address / rates changes
60-
if (cartCache.get('address') &&
61-
(!quote.shippingMethod() || !quote.shippingMethod()['method_code'])
62-
) {
59+
if (customerData.get('cart')()['data_id'] &&
60+
(!quote.shippingMethod() || !quote.shippingMethod()['method_code'])) {
6361
totalsDefaultProvider.estimateTotals(quote.shippingAddress());
6462
}
6563
}
@@ -87,9 +85,6 @@ define([
8785
}
8886
};
8987

90-
/*if (!quote.shippingMethod() && cartCache.get('rates')) {
91-
selectShippingMethodAction(cartCache.get('rates')[0]);
92-
}*/
9388
quote.shippingAddress.subscribe(estimateTotalsAndUpdateRates);
9489
quote.shippingMethod.subscribe(estimateTotalsShipping);
9590
quote.billingAddress.subscribe(estimateTotalsBilling);

0 commit comments

Comments
 (0)