Skip to content

Commit ffe86ac

Browse files
committed
Show shipping methods in shipping estimator as loading whilst the shipping estimator is calculating methods
Prevents the display of "Sorry, no quotes are available" momentarily whilst the shipping estimator is loading methods
1 parent d6bb4de commit ffe86ac

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

app/code/Magento/Checkout/view/frontend/web/js/view/cart/shipping-estimation.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ define(
1414
'uiRegistry',
1515
'Magento_Checkout/js/model/quote',
1616
'Magento_Checkout/js/model/checkout-data-resolver',
17+
'Magento_Checkout/js/model/shipping-service',
1718
'mage/validation'
1819
],
1920
function (
@@ -26,7 +27,8 @@ define(
2627
shippingRatesValidator,
2728
registry,
2829
quote,
29-
checkoutDataResolver
30+
checkoutDataResolver,
31+
shippingService
3032
) {
3133
'use strict';
3234

@@ -41,9 +43,15 @@ define(
4143
*/
4244
initialize: function () {
4345
this._super();
46+
47+
// Prevent shipping methods showing none available whilst we resolve
48+
shippingService.isLoading(true);
49+
4450
registry.async('checkoutProvider')(function (checkoutProvider) {
4551
var address, estimatedAddress;
4652

53+
shippingService.isLoading(false);
54+
4755
checkoutDataResolver.resolveEstimationAddress();
4856
address = quote.isVirtual() ? quote.billingAddress() : quote.shippingAddress();
4957

app/code/Magento/Checkout/view/frontend/web/template/cart/shipping-rates.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
-->
77
<form id="co-shipping-method-form" data-bind="blockLoader: isLoading, visible: isVisible()">
8-
<p class="field note" data-bind="visible: (shippingRates().length <= 0)">
8+
<p class="field note" data-bind="visible: (!isLoading() && shippingRates().length <= 0)">
99
<!-- ko text: $t('Sorry, no quotes are available for this order at this time')--><!-- /ko -->
1010
</p>
1111
<fieldset class="fieldset rate" data-bind="visible: (shippingRates().length > 0)">

0 commit comments

Comments
 (0)