gpt4 book ai didi

magento2 - 如何在结帐时强制更新/刷新运输方式 Magento 2

转载 作者:行者123 更新时间:2023-12-02 20:51:45 26 4
gpt4 key购买 nike

Magento 2结账时如何刷新发货方式,有哪些js功能?

最佳答案

https://alanstorm.com/refresh-shipping-rates-for-the-magento-2-checkout/

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);
});

关于magento2 - 如何在结帐时强制更新/刷新运输方式 Magento 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41998033/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com