I have a third party module in my magento 1 which is fetching products like this: $products = Mage::getModel('catalog/product')->getCollection(); So I want to replace it with selective products which are ordered in last 24 hrs. but the issue is I know how to fetch last 24 hrs orders but they are not returning items(products) ID or SKU. PLease let me know how to get products of last 24 hrs orders.
Here is my query of getting the orders:
$products = Mage::getResourceModel('sales/order_item_collection') ->addAttributeToSelect('*') ->addFieldToFilter('created_at', array( 'from' => strtotime('-1 day', time()), 'to' => time(), 'datetime' => true )) ->load();
So how can I edit this to fetch product items instead of order items?