6

嗨,谁能告诉我成功下订单后如何获得运输方式标题?

这是我所拥有的

$iOrderId = Mage::getSingleton('checkout/session')->getLastRealOrderId();
$oOrder = Mage::getModel('sales/order')->loadByIncrementId($iOrderId);

echo $oOrder->getShippingMethod();

但我怎样才能得到这个运输方式的标题?

4

4 回答 4

21
$oOrder->getShippingDescription();
于 2012-08-26T19:03:33.200 回答
3
$order = Mage::getModel('sales/order')->loadByIncrementId($iOrderId);
$order->getShippingDescription();

或者

$shipping = $order->getShippingAddress()->getShippingMethod();
echo $shipping->getData('title');
于 2014-08-26T14:34:59.033 回答
1

这在寻找自定义标题时对我有用:

Mage::getModel('sales/order')->loadByIncrementId($orderId)->getTracksCollection()->getFirstItem()->getTitle();
于 2014-09-05T12:23:27.443 回答
1
$order->getShippingDescription(); // returns Shipping Method Title
于 2019-07-26T10:04:49.887 回答