NeedZoom Posted May 16, 2016 Share Posted May 16, 2016 Hi, I want get data of products in payement hook. I have ready get data of the order : echo ("<br> Ref :".$params['objOrder']->reference."<br/>\n"); echo ("<br> Date: ".$params['objOrder']->invoice_date."<br/>\n"); echo ("<br> Code Client: ".$params['objOrder']->id_customer."<br/>\n"); how i cant get the data of products in this orders?! $order = $params['objOrder']; //$products_with_details = $order->getProductsDetail(); $products = $order->getProducts(); Link to comment Share on other sites More sharing options...
shokinro Posted May 17, 2016 Share Posted May 17, 2016 (edited) your order is correctly, it should get the products of the order. but be noted, the products are in a list of array, not in object. $order = $params['objOrder']; $products = $order->getProducts(); foreach ($products as $p) { echo 'Quantity:" . $p['product_quantity'] . '<BR>'; } Edited May 17, 2016 by shokinro (see edit history) 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