diff --git a/view/frontend/web/js/model/checkout.js b/view/frontend/web/js/model/checkout.js index 45c950d7..93f1a0b0 100644 --- a/view/frontend/web/js/model/checkout.js +++ b/view/frontend/web/js/model/checkout.js @@ -289,24 +289,17 @@ function( })); } - function isEuCountry(shippingCountry) { - return EU_COUNTRIES.includes(shippingCountry); - } - function updateHasDeliveryOptions() { let isAllowed = false; const shippingCountry = quote.shippingAddress().countryId; - if (isEuCountry(shippingCountry)) { - - Model.allowedShippingMethods().forEach(function(carrierCode) { - const rate = Model.findOriginalRateByCarrierCode(carrierCode); + Model.allowedShippingMethods().forEach(function(carrierCode) { + const rate = Model.findOriginalRateByCarrierCode(carrierCode); + if (rate && rate.available) { + isAllowed = true; + } + }); - if (rate && rate.available) { - isAllowed = true; - } - }); - } Model.hasDeliveryOptions(isAllowed); Model.hideShippingMethods(); } diff --git a/view/frontend/web/js/view/delivery-options.js b/view/frontend/web/js/view/delivery-options.js index 0bd960fa..bcb62d67 100644 --- a/view/frontend/web/js/view/delivery-options.js +++ b/view/frontend/web/js/view/delivery-options.js @@ -155,13 +155,8 @@ define( }, destroy: function() { - deliveryOptions.triggerEvent(deliveryOptions.hideDeliveryOptionsEvent); document.querySelector(deliveryOptions.hiddenDataInput).value = ''; - - document.removeEventListener( - deliveryOptions.updatedDeliveryOptionsEvent, - deliveryOptions.onUpdatedDeliveryOptions - ); + deliveryOptions.triggerEvent(deliveryOptions.hideDeliveryOptionsEvent); }, /** @@ -244,6 +239,7 @@ define( window.MyParcelConfig.address = newAddress; + deliveryOptions.triggerEvent(deliveryOptions.showDeliveryOptionsEvent); deliveryOptions.triggerEvent(deliveryOptions.updateDeliveryOptionsEvent); },