Showing posts with label addAttributeToFilter. Show all posts
Showing posts with label addAttributeToFilter. Show all posts

Tuesday 10 September 2019

How to get null attribute product value in magento 1 addAttributeToFilter Filter Query | Where condition

$collection = Mage::getModel('catalog/product')->getCollection()
        ->addAttributeToSelect(['entity_id'])
        ->addAttributeToFilter(
        array(
            array('attribute'=> 'pricegroup','null' => true),
            array('attribute'=> 'pricegroup','eq' => ''),
            array('attribute'=> 'pricegroup','eq' => 'NO FIELD')
        ),
        '',
        'left')
        ->addAttributeToFilter('status', ['eq' => 1]);
echo $collection->getSelect();
echo '<pre>';print_r($collection->getData());exit;