|
I would like to add (Select All | Unselect All | Select Visible | Unselect Visible | 0 items selected) to the Catalog->Manage Category-> Category Tab “Category Products.
The file for this page is /app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tab/product.php
Please advise what code I would need to add and where add a working subset of these massaction items?
The code for these items copied from the Catalog -> Manage Products Page (app/code/core/Mage/Adminhtml/Block/Catalog/Product/grid.php) is below. However, simply copying this code and pasting it does not work.. Please advise what code I would need to add and where add a working subset of these massaction items?
protected function _prepareMassaction()
{
$this->setMassactionIdField(\’entity_id\’);
$this->getMassactionBlock()->setFormFieldName(\’product\’);
$this->getMassactionBlock()->addItem(\’delete\’, array(
\’label\’=> Mage::helper(\’catalog\’)->__(\’Delete\’),
\’url\’ => $this->getUrl(\’*/*/massDelete\’),
\’confirm\’ => Mage::helper(\’catalog\’)->__(\’Are you sure?\’)
));
$statuses = Mage::getSingleton(\’catalog/product_status\’)->getOptionArray();
array_unshift($statuses, array(\’label\’=>\’\’, \’value\’=>\’\’));
$this->getMassactionBlock()->addItem(\’status\’, array(
\’label\’=> Mage::helper(\’catalog\’)->__(\’Change status\’),
\’url\’ => $this->getUrl(\’*/*/massStatus\’, array(\’_current\’=>true)),
\’additional\’ => array(
\’visibility\’ => array(
\’name\’ => \’status\’,
\’type\’ => \’select\’,
\’class\’ => \’required-entry\’,
\’label\’ => Mage::helper(\’catalog\’)->__(\’Status\’),
\’values\’ => $statuses
)
)
));
if (Mage::getSingleton(\’admin/session\’)->isAllowed(\’catalog/update_attributes\’)){
$this->getMassactionBlock()->addItem(\’attributes\’, array(
\’label\’ => Mage::helper(\’catalog\’)->__(\’Update Attributes\’),
\’url\’ => $this->getUrl(\’*/catalog_product_action_attribute/edit\’, array(\’_current\’=>true))
));
}
Mage::dispatchEvent(\’adminhtml_catalog_product_grid_prepare_massaction\’, array(\’block\’ => $this));
return $this;
}
Image Attachments
Click thumbnail to see full-size image
|