I'm doing some customization on magento 1.9.x website. I need to get all products with in stock and manage stock enabled
I'm using this code
$stockCollection = Mage::getModel('cataloginventory/stock_item')
->getCollection()
->addFieldToFilter('is_in_stock', 1);
$productIds = array();
foreach ($stockCollection as $item) {
$productIds[] = $item->getOrigData('product_id');
}
$productCollection = Mage::getModel('catalog/product')->getCollection()
->addFieldToFilter('entity_id', array('in'=> $productIds));
$productCollection->load();
$i=0;
foreach ($productCollection as $_product) {
$i++;
echo $i.'-'.$_product->getId().'<br/>';
}
But the problem is this list shows the items which not enable manage stock like this
I only need to get products which manage stock enabled and in stock
like below
Anyone know how to get that with my code or using another code, Thank You