i am trying to get all the product in a order. i have the order details in my observer but i don't know how to get the product details from it. i have the following coding in my observer
public function getProducts($observer){
$order = $observer->getEvent()->getOrder();
$data = $order->getData();
$dumpFile = fopen('observer_working.txt', 'w+'); // file is creating
fwrite($dumpFile, 'Sample text');
return $this;
}
As you can see i am creating a txt file when order is placed. and it is working. and i have the order details also. but i am unable get the product id from it.
i need following data from the order details
1) Order id.
2) array of product id which is available in the order. (only product id is enough)
please help me to get those data.