답변:
잘 지내길 바랍니다.
이 JavaScript 코드를 사용해보십시오. 이것이 도움이 될 것입니다.
define(
[
'Magento_Checkout/js/model/quote',
'Magento_Checkout/js/model/shipping-rate-processor/new-address',
'Magento_Checkout/js/model/shipping-rate-processor/customer-address',
'Magento_Checkout/js/model/shipping-rate-registry'
],
function (quote, defaultProcessor, customerAddressProcessor, rateRegistry) {
'use strict';
var processors = [];
rateRegistry.set(quote.shippingAddress().getCacheKey(), null);
processors.default = defaultProcessor;
processors['customer-address'] = customerAddressProcessor;
var type = quote.shippingAddress().getType();
if (processors[type]) {
processors[type].getRates(quote.shippingAddress());
} else {
processors.default.getRates(quote.shippingAddress());
}
}
);
requirejs([
'Magento_Checkout/js/model/quote',
'Magento_Checkout/js/model/shipping-rate-registry'
], function(quote, rateRegistry){
var address = quote.shippingAddress();
address.trigger_reload = new Date().getTime();
rateRegistry.set(address.getKey(), null);
rateRegistry.set(address.getCacheKey(), null);
quote.shippingAddress(address);
});