Magento: How to get increment id of an Order by order id in magento

In most cases, an user (A developer) need to write own code to generate an order, generate invoice for an order or generate shipment for an order then he need both order id and its increment id. You can get this increment value by following code:

$order = Mage::getModel('sales/order');
$order->load(Mage::getSingleton('sales/order')->getLastOrderId());
$orderIncrementId = $order->getIncrementId();

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

*