0

We have imported a lot of orders to magento store, but almost all of them are 'pending' I need those to be completed, but I don't know which is the best way to do it.

Can I update all orders in database only changing the status id or something like that ?

  • I have fixed using this UPDATE sales_flat_order_grid SET status = 'complete' WHERE entity_id > 700000; and UPDATE sales_flat_order SET state = 'complete', status = 'complete' WHERE entity_id > 700000; – jacr1614 Jan 10 '18 at 21:08
  • did you face any issues after manually changing the order status? – Ask Bytes Jan 5 '19 at 11:22
1

It is possible? Yes. Is it a good idea? No.

Magento is an event-based system. This means that often times when you save, delete, or modify an object, it triggers other actions within the system.

When an order's status is updated, events fire to make sure that the order's state is also set properly. Status is a child of the State, there is a relationship there and its important to not have an order status that does not belong under a specific order state.

A couple of the relevant event names are:

sales_order_status_unassign
sales_order_state_change_before 

I'm sure there are other relevant events but these are 2 that come to mind right away. Anyways, by modifying the data directly, you lose out on all events that would fire off and you run this risk of data corruption.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.