revolve Posted December 28, 2021 Share Posted December 28, 2021 (edited) 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 December 28, 2021 by revolve want to tags add (see edit history) Link to comment Share on other sites More sharing options...
JBW Posted January 4, 2022 Share Posted January 4, 2022 Please check https://devdocs.prestashop.com/1.7/modules/concepts/hooks/list-of-hooks/ e.g. actionValidateOrder could work for your purpose 1 Link to comment Share on other sites More sharing options...
Ress Posted March 1, 2022 Share Posted March 1, 2022 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now