【发布时间】:2020-03-10 20:44:22
【问题描述】:
我想在结帐页面上获得选定的运输 ID。
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
//$cart = $objectManager->get('\Magento\Checkout\Model\Cart');
$session = $objectManager->get('Magento\Checkout\Model\Session');
$quote = $session->getQuote();
$shippingMethod = $quote->getShippingAddress();
echo $addressId = $shippingMethod->getCustomerAddressId();
我尝试获取送货地址 ID,但当我从结帐更改波纹管图像时,它总是提供保存 ID https://drive.google.com/file/d/11N3SBaahNlugWzMw2ySAZHn4Yh4kQ64q/view
它不会改变运输 ID 显示相同。如何获取当前选定的送货地址 ID?
【问题讨论】:
-
您是否使用过任何结帐页面的扩展程序?