Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How can I Add “Select All” Function to Category --Category Products Tab
 
ncotrona
Sr. Member
 
Total Posts:  161
Joined:  2009-05-15
 

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
Select All.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top