Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting Order Number from Order Id in Magento?

Tags:

magento

I am using following code to get the Order Number from Order ID.

$orderId=64; //Order Id will be supplied dynamically

$order = Mage::getModel('sales/order')->load($orderId);

echo "Order Number is: ".$order['increment_id'];

I am getting the correct order number using this code like 100000067.

I wanted to know Is this the correct approach to use.

Please guide.

Thanks

like image 515
Mukesh Avatar asked Jun 17 '13 06:06

Mukesh


1 Answers

This should work for you.

$orderId = 64;
$order   = Mage::getModel('sales/order')->load($orderId);

echo $order->getIncrementId();    

Cheers!

like image 184
MagentoMan Avatar answered Oct 07 '22 05:10

MagentoMan