Jump to content

Prestashop get all statuses for order


hakeryk2

Recommended Posts

Hello,

 

I am developing my first module and I would love to know if there is any prebuild function that is checking history of statuses for order. If not how to write one? Any help?

 

EDIT

 

I created function like this 

  public function getStatusHistory($id)
    {
        $sql = 'SELECT `id_order_state` FROM `'._DB_PREFIX_.'order_history`
                WHERE `id_order`='.$id;

        $status_array = array();
        if ($results = Db::getInstance()->ExecuteS($sql))
            foreach ($results as $row)
                $status_array[] = $row['id_order_state'];

        return $status_array;
    }

And it works but maybe someone knows better method or can improve mine it will be cool.

Edited by hakeryk2 (see edit history)
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...