Question

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

Was it helpful?

Solution

make an array

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

and call in array,

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

this may help.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top