Magento get order id from increment id


Magento get order id from increment id : You can use Mage::getModel(‘sales/order’) to get the order id from the increment id of order. First load the order by increment id then get the order id from the order object. Here is this example we are going to explain how to get the order id from increment id.


Magento get order id from increment id

Here is syntax to get order id from increment id in magento –

Magento get order id from increment id:

$orderIncrementId = "1000002";
$order = Mage::getModel('sales/order')->loadByIncrementId($orderIncrementId);
$orderId = $order->getId();

In the above example we have loaded order object by increment id of order. From order object $order you can get order id as $order->getId(); which will give you order id of an order.


Advertisements

Add Comment

📖 Read More