I have a csv file from our SAP system that has a list of order IDs and items within the order and quantity shipped for each item. I am trying to cycle through each order ID and load them in Magento and perform operations on them depending on their status or state (I'm not sure which one to use, please help!).

Basically, if an order is still processing/pending, I want to go into the items ordered and set the quantity shipped (and other things). However, I'm having difficulty understanding if I should use order state or status to get this information. Could someone help me understand which one to use and why?

I'm having a very hard time locating the Mage_Sales_Model_Order::getStatus() method. I've even used ReflectionClass to view the methods and do not see it! If I should use order status, I'd like to compare it with the Magento defined status (whether constant or db value), and not some literal string (i.e. "processing").

I'm using Magento Enterprise 1.13, but only 1.12 tag is available.

1 Answer 1


Take a look @ Magento: Difference between order states and statuses

State is used by magento to tell if the order is new, processing, complete, closed, canceled, etc.;

Each 'state' can have multiple 'statues', for example 'processing' (after payment is received) you could additional 'statuses' to match you business work flow ('order in production', 'order in post production' etc)

To my knowledge you can not really modify 'state' because it is deeply integrated in the payment workflow, so you best option is to use 'statuses'.

But if you want to transfer all order that order is paid for, then you could look up all orders that have a 'processing' state.

To add Statuses go to Admin -> System -> Order Statuses

  • Without knowing exactly what you are tying to do it kinda hard to say. Also take a look at stackoverflow.com/questions/8309289/… Jun 7, 2013 at 15:08
  • Scratch that. I'm just trying to compare the order status to the value magento has configured for "processing" status. Knowing the value is "processing", I could hard-code it, but knowing the value could possibly change or whatever (just to be safe), I'd like to retrieve this value. I think I'm way in over my head though, since these are user defined and set, and Magento seems to use what is set on the order according to the user. Jun 7, 2013 at 15:24
  • Your comment link, the person uses a string literal to compare "complete". I guess if these values are messed with by someone else and my code breaks, we'll just have to live and deal with it. Thanks again :) Jun 7, 2013 at 15:25
  • What I usual do is create a system.xml and use a multi/select, so I don't have to hardcode any values.. take a look @ ecomdev.org/2010/10/27/… Jun 7, 2013 at 15:36

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.