当您在“结帐页面”上单击“在此处寄送”时,它将调用
magento / rest / default / V1 / carts / mine / estimate-shipping-methods-by-address-id
然后转到下面的JS文件
magento \ vendor \ magento \ module-checkout \ view \ frontend \ web \ js \ model \ shipping-rate-processor \ customer-address.js
magento \ vendor \ magento \ module-checkout \ view \ frontend \ web \ js \ model \ resource-url-manager.js
getUrlForEstimationShippingMethodsByAddressId: function(quote) {
var params = (this.getCheckoutMethod() == 'guest') ? {quoteId: quote.getQuoteId()} : {};
var urls = {
'default': '/carts/mine/estimate-shipping-methods-by-address-id'
};
return this.getUrl(urls, params);
}
magento \ vendor \ magento \ module-quote \ Model \ ShippingMethodManagement.php
public function estimateByAddressId($cartId, $addressId)
{
echo 1;exit;
}
上面的函数如何estimateByAddressId
调用?