Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top