Getting order number from order ID in Magento?

I use the following code to get the order number from the 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 get the correct order number using this code, for example, 100000067.

I wanted to know this is the right approach to use.

Please guide.

thanks

+4
source share
1 answer

This should work for you.

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

Hooray!

+6
source

Source: https://habr.com/ru/post/1486546/


All Articles