In this post I am going to explain how to get order details by id in PrestaShop 1.7.
// 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;
}
Write an article about ecommerce that help people to grow their ecommerce business. You’ll find best ecommerce guide, news, tips & more!



May 6, 2020 at 12:13 pm
Great worked and good for share great Blog. Thanks