Sharing some useful tips, solutions and notes for Geeks.

Wednesday, February 8, 2017

Get all configurable products with out of stock status Magento

$_productCollection = Mage::getResourceModel('catalog/product_collection')
            ->addAttributeToSelect('*')
            ->addAttributeToFilter('type_id','configurable');
    $_productCollection->joinField('is_in_stock',
                'cataloginventory/stock_item',
                'is_in_stock',
                'product_id=entity_id',
                'is_in_stock=0',
                '{{table}}.stock_id=1',
                'left');

No comments: