I have developed a custom module with a grid. Also added a column named "View Product" to be able to navigate to the current product page. With my current solution all "view" links redirect to products page, not to that particular product. How can I fix that?
Thanks,
$product_id=$this->getRequest()->getParam('id');
$this->addColumn('view',
array(
'header' => Mage::helper('catalog')->__('View Product'),
'width' => '40px',
'type' => 'action',
'getter' => 'getId',
'actions' => array(
array(
'caption' => Mage::helper('catalog')->__('View'),
'url' => array(
'base'=>'adminhtml/catalog_product/edit/id/$product_id',
'params'=>array('store'=>$this->getRequest()->getParam('store'))
),
'field' => 'id'
)
),
'filter' => false,
'sortable' => false,
'index' => 'stores',
));
Solution Type 2: Also tried this solution but it redirects to the "New Product" page instead of the "Edit product" page.
$link= Mage::helper('adminhtml')->getUrl('adminhtml/catalog_product/edit/') .'id/$entity_id';
$this->addColumn('action_edit', array(
'header' => $this->helper('catalog')->__('Action'),
'width' => 15,
'sortable' => false,
'filter' => false,
'type' => 'action',
'actions' => array(
array(
'url' => $link,
'caption' => $this->helper('catalog')->__('Edit'),
),
)
));