Jump to content

Hook get products ref in payement


NeedZoom

Recommended Posts

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

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 by shokinro (see edit history)
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...