1

Change into app/code/local/Mage/ImportExport/Model/Export/Entity/Product.php on line 647 in funtion export()

$collection = $this->_prepareEntityCollection(Mage::getResourceModel('catalog/product_collection'));

Replace code in above code

$collection = $this->_customprepareEntityCollection(Mage::getResourceModel('catalog/product_collection'))
                ->addAttributeToFilter('price', array('gt' => 0))
                    //Filter by product name//
                ->addAttributeToFilter('name', array('nlike' => '%T-shirts%'))
                ->addAttributeToFilter('name', array('nlike' => '%Mobile%'))
                ->addAttributeToFilter('name', array('nlike' => '%Watch%'))

                 //Filter by product option value like manufacture attribute have some option//

                ->addAttributeToFilter('manufacturer', 
                array(
                    'nlike' => Mage::getResourceModel('catalog/product')
                    ->getAttribute('manufacturer')
                    ->getSource()
                    ->getOptionId('Sony')
                ))
                ->addAttributeToFilter('manufacturer', 
                array(
                    'nlike' => Mage::getResourceModel('catalog/product')
                    ->getAttribute('manufacturer')
                    ->getSource()
                    ->getOptionId('Microsoft')
                ))
                ->addAttributeToFilter('manufacturer', 
                array(
                    'nlike' => Mage::getResourceModel('catalog/product')
                    ->getAttribute('manufacturer')
                    ->getSource()
                    ->getOptionId('LG')
                ))

                  //Filter by particular attribute set like default attribute set id is 4 //

                ->addAttributeToFilter('attribute_set_id', 
                array('eq' => 4));

Your Answer

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

Browse other questions tagged or ask your own question.