Php Magento 2-getDestStreet from RateRequest在collectRates中返回NULL

Php Magento 2-getDestStreet from RateRequest在collectRates中返回NULL,php,magento,magento2,Php,Magento,Magento2,我制作了自己的模块来添加一个定制的运送方法。除了在collectRates功能中获取目的地街道和城市外,一切正常 public function collectRates(RateRequest $request) 文件中的注释: /vendor/magento/module quote/Model/quote/Address/RateRequest.php * @method \Magento\Quote\Model\Quote\Address\RateRequest setDestCity

我制作了自己的模块来添加一个定制的运送方法。除了在
collectRates
功能中获取目的地街道和城市外,一切正常

public function collectRates(RateRequest $request)
文件中的注释: /vendor/magento/module quote/Model/quote/Address/RateRequest.php

* @method \Magento\Quote\Model\Quote\Address\RateRequest setDestCity(string $value)
* @method string getDestCity()
* @method \Magento\Quote\Model\Quote\Address\RateRequest setDestStreet(string $value)
* @method string getDestStreet()
不幸的是,两者都返回
NULL
。当我尝试打印(json编码($request->getData()) 我在打印输出中得到
“dest_street”:null,“dest_city”:null

我需要这两个信息来计算价格


有人有同样的问题吗

是否在订单/购物车中未设置配送地址?正如您在代码中所看到的,我希望在订单/购物车中未设置配送地址?正如您在代码中所看到的,我希望在代码中设置目的地城市和目的地街道