Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Difference between status and state in sales_order? 
 
parkin_m
Jr. Member
 
Total Posts:  18
Joined:  2008-12-01
 

Hello there,

Not sure if this is the correct forum so feel free to move this post if need be.

I am wondering what is the difference between status and state in the sales_order

I can see:

[state] => new [status] => pending 
   [state] 
=> pending [status] => pending

I presume status is the current status of the order, when does state change?

 
Magento Community Magento Community
Magento Community
Magento Community
 
parkin_m
Jr. Member
 
Total Posts:  18
Joined:  2008-12-01
 

From what I can tell:

State starts off as new, then as soon as the status is changed to pending (by hitting ship or invoice), once the order is complete (both shipped and invoiced) then state and status change to complete.

So I really dont know what the point of this state is, new orders seem to be identifiable by status or state (new or pending).

Could anyone offer any insight into this?

What I am trying to do:

Select orders that have been made pending (because they have been invoiced), generate some data for DHL, set them to a new state (could be anything) wait until a response from DHL is recieved and then select all the orders with this new state and set them to be shipped.

 
Magento Community Magento Community
Magento Community
Magento Community
 
skippybosco
Enthusiast
 
Avatar
Total Posts:  796
Joined:  2008-10-03
 

I do something like this in an Observer:

$event $observer->getEvent();
$order $event->getOrder();
if(
$order->getStatusLabel() == "Complete"{
 
Magento Community Magento Community
Magento Community
Magento Community
 
Yan Sanchez
Jr. Member
 
Avatar
Total Posts:  11
Joined:  2008-05-26
Poitiers
 

Hi,

Same question. In the previous project on Magento I worked, we used status to define order life cycle. But natively, what is the semantic difference between those attributes ?
Thanks

Yan

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top