how to add new filter magento admin order filter by country
please give me php code for magento
C:xampphtdocsmappcodelocalPkmoduleRewardBlockAdminhtmlRewardGrid.php
protected function _prepareCollection()
{
$collection = Mage::getModel(“reward/reward”)->getCollection();
$this->setCollection($collection);
return parent::_prepareCollection();
}
protected function _prepareColumns()
{
$groups = array(“value”,”puneet”,”kumar”);
$this->addColumn(“id”, array(
“header” => Mage::helper(“reward”)->__(“ID”),
“align” =>”right”,
“width” => “50px”,
“type” => “number”,
“index” => “id”,
));
$this->addColumn(“name”, array(
“header” => Mage::helper(“reward”)->__(“NAME”),
“align” =>”left”,
“width” => “50px”,
“type” => “options”,
‘options’ => $groups,
“index” => “name”,
));
$this->addColumn(“order”, array(
“header” => Mage::helper(“reward”)->__(“order”),
“align” =>”left”,
“width” => “50px”,
“type” => “options”,
‘options’ => $groups,
“index” => “order”,
));
$this->addRssList(‘reward/adminhtml_rss_rss/reward’, Mage::helper(‘reward’)->__(‘RSS’));
$this->addExportType(‘*/*/exportCsv’, Mage::helper(‘sales’)->__(‘CSV’));
$this->addExportType(‘*/*/exportExcel’, Mage::helper(‘sales’)->__(‘Excel’));
return parent::_prepareColumns();
}
public function getRowUrl($row)
{
return $this->getUrl(“*/*/edit”, array(“id” => $row->getId()));
}
protected function _prepareMassaction()
{
$this->setMassactionIdField(‘id’);
$this->getMassactionBlock()->setFormFieldName(‘ids’);
$this->getMassactionBlock()->setUseSelectAll(true);
$this->getMassactionBlock()->addItem(‘remove_reward’, array(
‘label’=> Mage::helper(‘reward’)->__(‘Remove Reward’),
‘url’ => $this->getUrl(‘*/adminhtml_reward/massRemove’),
‘confirm’ => Mage::helper(‘reward’)->__(‘Are you sure?’)
));
return $this;
}
}
Leave a Reply
Want to join the discussion?Feel free to contribute!