Jump to content

How to change the status of an order via SQL?


Recommended Posts

Hi all,
in a custom php procedure I have to change the status of an order from a custom state "Pending" in the "Awaiting check payment" state without sending any email.
How can I do this?
I have updated the column current_state of the ps_orders table and I have inserted an entry in the table ps_order_history, but it seems that it is not sufficient.
Are there other tables involved in changing the status of a order?

Thank you

 

claudio

Link to comment
Share on other sites

I've used this method to change the status of an order (after disabling the sending of email of the satus $ID_ORDER_STATUS) :

                        $newOrderId = Order::getOrderByCartId($newCartId);
                        $oldOrderId = $order->id;
                        $oOrder = new Order($newOrderId);
                        $oOrder->setCurrentState($ID_ORDER_STATUS);
                        $oOrder->save();

I've used this thread:

http://stackoverflow.com/questions/28408612/prestashop-change-order-status-when-payment-is-validated

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...