Confusion with order id, order increment id and I am not getting order id as 20001201
I am bit confused with order id and order increment id, So can any one help me to understand the difference between these two?
I have an observer for sales_order_place_after where I store sales details in a custom table.
$orderId = $observer->getEvent()->getOrder()->getId();
I get the order ids as normal ids like 112 or 113 or 110 etc not like 20001201
So which is the real order id, 20001201 or 112?
I need to further process order data based on this order id, I use 112, 113 etc. and it works, but I need to clarify this.
The difference is:
- order_id is the internal Magento order ID
- order increment ID is the ID which you communicate to your customer
You can easily load an order using the internal order_id:
PS: If you need it, you can easily get the increment ID from a loaded order: