Search This Blog

Tuesday 15 May 2012

Add Multiple Select field / attribute to filter in Magento

 


Using addAttributeToFilter() with a multi-select attribute:

$this->_productCollection->addAttributeToFilter("stv_school", array("finset" => $allowedSchool);

OR

$allowedSchools = array(
  array(
    "finset" => array(348)
  ),
  array(
    "finset" => array(350)
  ),
);$this->_productCollection->addAttributeToFilter("stv_school", $allowedSchools);
Reference URLs:

2 comments:

  1. change the text color 0000bb, he is not readable

    ReplyDelete
  2. Nice tutorial :D

    ReplyDelete