Following this tutorial, I try to get values of multiselect attribute in a product grid.
Products have some selected values for this attribute and the 'filter_condition_callback' for this column work.
In the renderer I use below code but in the grid I get an empty list.
I hope someone can help.
public function render(Varien_Object $row) {
$colors=explode(',',$row->getColors());
$suppstr="";
if(count($colors)>0)
{
$suppstr="<ul>";
foreach($colors as $value)
{
$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'colors');
if ($attribute->usesSource()) {
$suppstr .= "<li>".$attribute->getSource()->getOptionText($value)."</li>";
}
}
$suppstr .= "</ul>";
}
return $suppstr;
}
if ($attribute->usesSource()) {
condition?var_dump($colors)
to check if you get data.