Jump to content

Order History and state


Recommended Posts

Hi everyone,

I'm developing a PHP script to change order status and order history. This code works fine in PS 1.6, but not in 1.7. This is the error in log file:

Quote

Argument 1 passed to PrestaShop\PrestaShop\Core\Cart\Calculator::__construct()

My code:
 

Quote

 

$objOrder = new Order($this->id_order);

                            $history = new OrderHistory();

                            $history->id_order = (int)$objOrder->id;

                            $history->changeIdOrderState($this->update_to_state, (int)($objOrder->id));

                            $history->addWithemail(true); ---> Al llegar aquí muestra el error y detiene todo el proceso

 

All the values (parameters) are correct. I had tried to copy and paste the code from another module with the same functionality, but still does not work.

 

Thanks.

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...