1

I observed that all the above term's value are different which I thought to be same.

echo $orderId = $observer->getEvent()->getOrderIds();
echo $qid = $order->getQuoteId();
$order_data= $order->getData();
echo $increment_id = $order_data['increment_id'];

Above code outputs orderId: 32, QuoteId: 41 and incremenId: 52. Why are these three values different and what they mean?

1 Answer 1

5

The difference is:

  • order_id is the internal Magento order ID (database table auto increment id)
  • increment_id is the ID which you communicate to your customer
  • quote_id is the internal quote id (When user add product to cart those are added in quote , after checkout success quote is transferred to order)

Why they are different

order_id and quote_id needs to be different because they refers to the different table(or different object, order_id refers to order object while quote_id refers to quote object), increment id is different as it allows you to show a different order-id with prefix to the customer

2
  • And why should they be different?
    – P S
    Commented Dec 6, 2017 at 9:27
  • Please edit your answer with this info.
    – P S
    Commented Dec 6, 2017 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.