I can get from collection "sales/order" customer ids, but when customer is unregistered, value is "null". What can I do to show in grid which customer is registered, with filter "true" or "false". My code:
protected function _prepareCollection()
{
$collection = Mage::getModel('sales/order')->getCollection()
->addAttributeToSelect('customer_id');
foreach($collection as $coll)
{
if ($coll['customer_id'] != '')
{
$coll['customer_id'] = 'yes';
}else{
$coll['customer_id'] = 'no';
}
}
...
protected function _prepareColumns()
{
$this->addColumn("customer_id", array(
"header" => Mage::helper("mymodule")->__("Registered"),
'type' => 'options',
'options' => array(
'yes' => 'True',
'no' => 'False'
),
"index" => "customer_id",
));
...
This option was destroy grid filter. Is any better solution?