Okay, so with the Customer attributes, I have a choice of several options that I added to the Client Network Management panel.
$prodCode = Mage::getSingleton('eav/config')->getAttribute('customer','prod_codes');
$prodCodeOptions = $prodCode->getSource()->getAllOptions(false);
$prodOptions = array();
foreach($prodCodeOptions as $k)
$prodOptions[$k['value']] = $k['label'];
$this->addColumn('prod_codes', array(
'header' => Mage::helper('customer')->__('Product Code'),
'width' => '100',
'index' => 'prod_codes',
'type' => 'options',
'options' => $prodOptions,
'filter_condition_callback'
=> array($this, '_filterProdOptionsCondition'),
));
I have my attribute added to the collection at the top of my Grid.php:
->addAttributeToSelect('prod_codes')
Here is my method _filterProdOptionsCondition:
protected function _filterProdOptionsCondition($collection, $column) {
if(!$value = $column->getFilter()->getValue()) {
return;
}
$this->getCollection()->addFieldToFilter('prod_codes', array('finset' => $value));
}
Now this work is fine and dandy, if I have only ONE of the selected options, as soon as I apply several attributes to the client, I will get empty results in the admin grid, however this IS is still searchable.
In close contact with print($collection->getSelectSql());no comment, I can see that the attribute identifier values ββare returned in a comma-separated list.
Magento , ? ? !