I need to get the actual order id that the customer is using creating an order. Tried with this that works fine, but returns me the previous order id, I need to get the actual one:

    $last_order_increment_id = Mage::getModel("sales/order")->getCollection()->getLastItem()->getIncrementId();
  • I achived it with this code.. not sure if there's a better option: $orderId = Mage::getSingleton('checkout/session')->getLastRealOrderId(); $lastorderId = $orderId + 1; Jul 1, 2020 at 14:10


Your Answer

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

Browse other questions tagged or ask your own question.