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

January 6, 2011 | In: Magento, web development

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');
$orderIncrementId = $order->getIncrementId();