0

How to get latest order No. from onepageController.php in checkout module in Magento? Or how can I get last booked order No. on onepageController.php file?

xyz
  • 2,277
  • 2
  • 25
  • 41
Prat
  • 519
  • 5
  • 16
  • 33
  • Possible duplicate of http://stackoverflow.com/questions/2195743/get-order-increment-id-in-magento / http://stackoverflow.com/questions/3698395/how-to-get-last-running-transaction-id-in-magento? – Simon Mar 22 '12 at 10:56

1 Answers1

1

Use following code:

            $incrementId = Mage::getSingleton('eav/config')
            ->getEntityType('order')
            ->fetchNewIncrementId($this->getStoreId());

magento have different incrementId per store.

Sergey
  • 1,494
  • 10
  • 14
  • 1
    "(...)magento have different incrementId per store.(...)" - not quite true as they can have same increment_id for each store. Check `increment_per_store` in `eav_entity_type` – xyz Mar 22 '12 at 18:49