Here is what I have so far, to get IN STOCK items:
$productCollection = Mage::getModel('cataloginventory/stock_item')
->getCollection()
->addQtyFilter('>', 0);
echo $productCollection->getSelect();
foreach ( $productCollection as $currentProduct ) {
$categoryIds = $currentProduct->getCategoryIds();
print_r( $categoryIds );
}
It gets the products just fine, however I need to get each item's current category ID's, so in the above code $currentProduct->getCategoryIds()
isn't working.
Does anyone has an idea how can I retrieve IN STOCK items along with it's category ID's?
Thank you.