Home is for the experience. Projects are for the ones who are interested!

How To Set Order Status Id Programatically In Prestashop

How To Set Order Status Id Programatically In Prestashop

If you create orders programtically from backend, at a certain step you will need to add an order status to the order depending on the payment method selected. For instance if the client choose to pay by bank wire the status order in admin should be: Awaiting Bank wire check or something like that, in order to add status id to an order you need to add the following paramter to the order object:

$order_object->current_state = (int)Configuration::get('PS_OS_BANKWIRE');

(int)Configuration::get('PS_OS_BANKWIRE'); will return the id of bank wire status, after add this line of code in your order function check in dashboard if everything worked right.

Leave a Reply

Your email address will not be published. Required fields are marked *