07-26-2023, 11:31 PM
I am POSTing the Cart id to my module method. From that I can obviously create the Cart object using that id. But how do I access the Order object that corresponds to that Cart object?
I've tried something like;
$cart = new Cart($_POST['id']);
var_dump($this->context->order);
And also trying to do a sort of where() query on the Order (where id_cart is equal to the id in my Cart object);
$order = new Order('id_cart', $cart->id);
It is probably really obvious but I just don't know Prestashop very well.
The reason I am trying to do this is so I change the status of an Order if the payment has timed out.
I've tried something like;
$cart = new Cart($_POST['id']);
var_dump($this->context->order);
And also trying to do a sort of where() query on the Order (where id_cart is equal to the id in my Cart object);
$order = new Order('id_cart', $cart->id);
It is probably really obvious but I just don't know Prestashop very well.
The reason I am trying to do this is so I change the status of an Order if the payment has timed out.