Jump to content

Pretashop get new order details in a custom module


Recommended Posts

I am creating a custom module in Prestashop. In that module I want to get the order details when a new order has been made on the store. So I want to know which hook should I use and how to get new order details along with customer details when a new order has been made. Any help and suggestions will be really appreciable.

Edited by revolve
want to tags add (see edit history)
Link to comment
Share on other sites

  • 1 month later...

You can use displayOrderConfirmation hook, where you receive the order object as a parameter.

public function hookDisplayOrderConfirmation($params)
{
	$order = $params['order']l
}

In the Order object you have the customer id, with which you can create the Customer object, and thus you have access to its properties. Here you can also use the id of delivery and billing addresses, where you can also find the addresses.
For products you can use the $order->getCartProducts() method;

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