0

I'm getting all products with this code:

->addAttributeToSelect('*')
->addStoreFilter()
->setVisibility(Mage::getSingleton('catalog/product_visibility')->getVisibleInCatalogIds());
$collection->getSelect()->order('rand()');
$collection->getSelect()->limit(12);

and also I added this code to get products with "size" attribute.

->addAttributeToFilter('size', '13')

And now, I'm asking how can I do that with array. I mean getting products value of size = 13,14,15 like array

0

make an array

$size= array(13,14,15);

and call in array,

$this->_productCollection->addAttributeToFilter('size', array('in'=>$size));

this may help.

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.