0

I'm using Magento 2.1.3

I would like to change the order status to custom "waiting for courier" after shipping and invoice is created instead of "complete".

Right now I'm using event "sales_order_shipment_save_after" but it's not enough.

Where can I find it?

1

For that you do not need development. You can do this in your backend directly:

Step 1 : Add new status
- In Stores > Settings > Order Status
- Create new status
- Status code : waiting_for_courier
- Status label : Waiting for courier
- Save status

Step 2 : Assign status to state
- Assign Status to State button
- Order status : Waiting for courier
- Order state : Complete
- Use Order Status As Default : Yes => important
- Visible On Storefront : Yes - Save Status Assignment

With that you defined the waiting_for_courier status as the new defaut complete state status instead of complete.

If you want more informations about status / state management here is a article about that : http://www.magestore.com/magento-2-tutorial/manage-order-status-in-magento-2/

  • Thanks :) It help me a lot and almost works. There is one problem - I don't want set state complete yet. I need to set state 'complete' after package is delivered to customer. – Konrad Siamro Jan 23 '17 at 10:19
  • What is triggering the change from waiting for courier to complete ? Is that the shipment is completed ? How do you have this information ? – Matthéo Geoffray Jan 23 '17 at 10:22
  • Couriers Api provide this information – Konrad Siamro Jan 23 '17 at 11:25
  • In this case you can do this : use my answer solution and then at the API response you can set the complete status to the order. Depeding on your other developments but the fact that both of the status are with the state complete is not an issue. It is native that Magento set complete state when the invoice and shipment are created. – Matthéo Geoffray Jan 23 '17 at 12:10
  • Is that OK for you ? – Matthéo Geoffray Jan 24 '17 at 13:15

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.