回答:
お元気で。
この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);
});