Get Real Shipment ID
Question
I am able to retrieve the real order id by
$order->getReadlOrderId();
I am unable to find any documentation or posts that show how to get the real shipment id, so far I am only able to get the Id by
$shipment->getId();
And that Id is not the Id shown on the adminhtml grids... any ideas on how I can get the real shipment id?
Solution
Try the following:
$shipment->getIncrementId();
In fact, you can use getIncrementId
on credit memos and invoices, too.
After all, getRealOrderId
is just an alias for increment_id
:
Mage_Sales_Model_Order
public function getRealOrderId()
{
$id = $this->getData('real_order_id');
if (is_null($id)) {
$id = $this->getIncrementId();
}
return $id;
}
I'm not sure of the history, but real_order_id
looks to be a remnant deprecated by standardization of increment_id
- it was once a column value in some modules including the flat order grid.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange