Filter product collection with multiple SKU magento

Suppose, you need product information of more then one product using SKU at that time we can get all information using “array in” with filter.

Below is code for the same. you just need to change SKU name in below code.

$productCollection = Mage::getResourceModel('catalog/product_collection')
->addAttributeToSelect('*')
->addAttributeToFilter( 'sku', array( 'in' => array('sku1', 'sku2', 'sku3' )));
$product = $productCollection->getFirstItem();

By using above code we can get specific product from product collection using SKU.

Tags: Magento1,

No comments

Leave a Reply

Your email address will not be published. Required fields are marked *