Php 定制配送方式-结帐时的实体店地址?

Php 定制配送方式-结帐时的实体店地址?,php,store,checkout,magento2,Php,Store,Checkout,Magento2,我正在使用一个定制的发货方法,我需要在collectRates方法中检索物理存储地址,以便计算发货价格 我通过以下方式检索了当前存储: $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $storeManager = $objectManager->get('Magento\Store\Model\StoreManagerInterface'); $store = $storeManager->

我正在使用一个定制的发货方法,我需要在collectRates方法中检索物理存储地址,以便计算发货价格

我通过以下方式检索了当前存储:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$storeManager = $objectManager->get('Magento\Store\Model\StoreManagerInterface');
$store = $storeManager->getStore();
但似乎不是实体店,而是在线商店

有人知道如何检索地址、邮政编码和城市吗

谢谢。

好的,找到了

它可能会引起某人的兴趣,因此我将在这里发布解决方案

只需使用要检索的字段调用getConfig方法

为了检索第一行的街道地址,您必须这样做:

$store->getConfig('general/store_information/street_line1');
您可以在上找到不同字段的列表。好的,找到了

它可能会引起某人的兴趣,因此我将在这里发布解决方案

只需使用要检索的字段调用getConfig方法

为了检索第一行的街道地址,您必须这样做:

$store->getConfig('general/store_information/street_line1');
您可以在上找到不同字段的列表