2

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();
1
  • 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

0

Your Answer

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

Browse other questions tagged or ask your own question.