mariobros
mariobros

Reputation: 899

Get order info by id in Opencart Cms

It's possible to retrieve order info (such as name, price, etc) by order id? I want to replicate confirm table in checkout/checkout to checkout/success.

Thanks

Upvotes: 3

Views: 4780

Answers (1)

shadyyx
shadyyx

Reputation: 16055

Looking in the catalog/model/checkout/order.php Order model you will find a method getOrder() accepting a mandatory parameter $order_id.

So yes, it is possible to get the order data by it's ID, simply by calling this line(s) somewhere in your controller:

$this->load->model('checkout/order'); // call this only if this model is not yet instantiated!
$this->model_checkout_order->getOrder($orderId); // use the desired $orderId here

Upvotes: 6

Related Questions