I’ve made a simple module which has the option to put in an “Edit” action column in Catalog > Manage Categories > [Catalog Products tab]. The code works fine, however, it places the new column at the beginning of the table and I want it at the end of the table (for aesthetics).
Here’s the rewrite (Product.php):
class [Company]_[Namespace]_Block_Catalog_Category_Tab_Product extends Mage_Adminhtml_Block_Catalog_Category_Tab_Product
{
protected function _prepareColumns() {
$this->addColumn('action',
array(
'header' => Mage::helper('catalog')->__('Action'),
'width' => '50px',
'type' => 'action',
'getter' => 'getId',
'actions' => array(
array(
'caption' => Mage::helper('catalog')->__('Edit'),
'url' => array(
'base'=>'*/catalog_product/edit',
'params'=>array('store'=>$this->getRequest()->getParam('store'))
),
'field' => 'id'
)
),
'filter' => false,
'sortable' => false,
'index' => 'stores',
));
return parent::_prepareColumns();
}
}
If I move return parent::_prepareColumns(); above the new column, then the new column does not show at all.
So my question, again, is how do I move this new column to the END of the table without copying all the columns into the file?
There’s also
addColumnsOrderfunction but it will make no sense here as you are adding column to the very end.