Product Attributes: How To Adjust on Magento ®

Sometimes different product groups or categories require an individual set of attributes. In this article, we will review how to change a set of attributes for existing products without additional extensions for Magento ®.

First, you need to open the file app/code/core/Mage/Adminhtml/Block/Catalog/Product/Grid.php.

Then, locate the line $this->getMassactionBlock()->addItem('attributes', array(.

You need to paste the following code above that line:

$sets = Mage::getResourceModel('eav/entity_attribute_set_collection')
  array_unshift($statuses, array('label'=>'', 'value'=>''));
  $this->getMassactionBlock()->addItem('attribute_set', array(
       'label'=> Mage::helper('catalog')->__('Change attribute set'),
       'url'  => $this->getUrl('*/*/massAttributeSet', array('_current'=>true)),
       'additional' => array(
              'visibility' => array(
                   'name' => 'attribute_set',
                   'type' => 'select',
                   'class' => 'required-entry',
                   'label' => Mage::helper('catalog')->__('Change attribute set),
                   'values' => $sets


In order to continue modification - open the file app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php.

Locate the line ‘protected function _isAllowed()’ and paste the following code above that line:

public function massAttributeSetAction()
    $productIds = $this->getRequest()->getParam('product');
    $storeId = (int)$this->getRequest()->getParam('store', 0);
    if(!is_array($productIds)) {
        $this->_getSession()->addError($this->__('Please select product(s)'));
    } else {
        try {
            foreach ($productIds as $productId) {
                $product = Mage::getSingleton('catalog/product')
            Mage::dispatchEvent('catalog_product_massupdate_after', array('products'=>
                $this->__('Total of %d record(s) were successfully updated', 
        } catch (Exception $e) {
    $this->_redirect('*/*/', array('store'=>(int)$this->getRequest()->
    getParam('store', 0)));


After the changes in those files are saved the option ‘Change attribute set’ will appear in Catalog -> Manage products -> Actions menu and you can use it to further make the necessary changes.

If you have any problems or additional questions please feel free to consult with our experts in Magento ®.

Contact us
Fill in the data using social media accounts
Thank you!
We will contact you shortly

Popular Posts

Join 5,246 Magento-obsessed readers in our mailing list