We have round about 1500 products and some of them has no weight, even though it is a required attribute. I think an import in the past was the mistake...

How can i get all products which don't have a weight?

3 Answers 3


For NULL values, not empty ones you can also set condition like

 $collection = Mage::getModel('catalog/product')
        ->addFieldToFilter('weight', array('null'=>true)


$mageProduct = Mage::getModel('catalog/product')
        ->addAttributeToFilter('weight'," ");

you can use collection to load all the product having attribute with null value

$collection = Mage::getModel('catalog/product')
->addFieldToFilter('weight', array('eq'=>''),
->addFieldToFilter('other_attribute_code', array('eq'=>''), //Repeat this for more attributes

foreach($collection as $product){
    //Do something

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.