In this post I am going to explain how to get order details by id in PrestaShop 1.7.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | // Your order id $id_order = 5; // Load order object $order = new Order((int) $id_order); // Validate customer object if (Validate::isLoadedObject($order)) { // Get Order Payment Method Name echo $order->payment; // Get Order Date echo $order->date_add; // Get Order Customer Id echo $order->id_customer; // Get Order Total Payment echo $order->total_paid; // Print Order Object echo "<pre>"; print_r($order); echo "</pre>"; // Get customer details from current order $customer = new Customer($order->id_customer); // Get Customer First Name echo $customer->firstname; // Get Customer Last Name echo $customer->lastname; // Get Customer Email echo $customer->email; } |
Team HiddenTechiesWrite an article about ecommerce that help people to grow their ecommerce business. You’ll find best ecommerce guide, news, tips & more!
Recent Comments