1

How do i update/change the sort order for existing product attribute using upgrade scripts?

I want to change the order in which the product attributes are listed in the admin. Is there any other way to do that through upgrade scripts

1 Answer 1

2

Use bellow update scripts

<?php
require_once('app/Mage.php');
Mage::app('default');

class Attribute
{
    public function index()    
    {    

        $installer = new Mage_Eav_Model_Entity_Setup('core_setup');
        $installer->startSetup(); 
        $installer->updateAttribute('catalog_product','name', array(''),null,2); //entity Type Id, Attribute id or Attribute code, field, value = null, sortOrder = null)
        $installer->endSetup();
    }
}

$obj = new Attribute();
$obj->index();
?>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.