Jump to content

Hook when order has been delivered


AlexWehe

Recommended Posts

Hi.
Did you mean to start your function when you change the status of the order to delivered in the administration?

 

public function hookActionOrderStatusPostUpdate($params)
{
    $idOrder = $params['id_order']; // ID Order
    $oldOs = $params['oldOrderStatus']; // previous Order status
    $newOs = $params['newOrderStatus']; // current ID Order status
    $myOsShipped = 4; // Shipped
    $myOsDelivered = 5; // Delivered


    if ($newOs == $myOsShipped) {
        // your function after change state to shipped
    }

    if ($newOs == $myOsDelivered) {
        // your function after change state to delivered
    }
}

 

Edited by ps8moduly.cz (see edit history)
  • Like 1
Link to comment
Share on other sites

3 hours ago, ps8moduly.cz said:

Hi.
Did you mean to start your function when you change the status of the order to delivered in the administration?

 

public function hookActionOrderStatusPostUpdate($params)
{
    $idOrder = $params['id_order']; // ID Order
    $oldOs = $params['oldOrderStatus']; // previous Order status
    $newOs = $params['newOrderStatus']; // current ID Order status
    $myOsShipped = 4; // Shipped
    $myOsDelivered = 5; // Delivered


    if ($newOs == $myOsShipped) {
        // your function after change state to shipped
    }

    if ($newOs == $myOsDelivered) {
        // your function after change state to delivered
    }
}

 

Thank you ps8moduly.cz,

That's what I was looking for, I thought there was a specific hook for it but I see that I have to use hookActionOrderStatusPostUpdate.

  • Like 1
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...