Hello Good Day to All

I have Attribute "Malakas","Mahina","Payat"

On a Product Page it will Show

--Choose an Option--
--Choose an Option--
--Choose an Option--

Is this a way to change the Postiton of Super Attribute so the Attribute "Payat" will be first ??

--Choose an Option--
--Choose an Option--
--Choose an Option--

I already try the Position and still not working on product view Page only the Left side bar is working for Postion

the Option Drag and Drop while Create product can be use but is there a way to make it default attribute

or is there a ways to change the code on the configurable Product Option so to use Attribute Position ?


  • you can check here magento.stackexchange.com/questions/45396/… this might help you
    – fmsthird
    Commented Apr 16, 2019 at 1:15
  • which specific magento 1.9 version you are using?
    – fmsthird
    Commented Apr 16, 2019 at 1:20
  • @magefm I'm using the latest one it seems the link that you give for me is for the sorting of Attribute( the choose option )
    – roy phil
    Commented Apr 16, 2019 at 1:21

2 Answers 2


I check the magento collection.php thank you @magefms

     * Set order collection by Position
     * @param string $dir
     * @return Mage_Catalog_Model_Resource_Product_Type_Configurable_Attribute_Collection
    public function orderByPosition($dir = self::SORT_ORDER_ASC)
        $this->setOrder('position ',  $dir);
        return $this;

Lucky for me my Attribute created at the same time so i achieve what i want Ijust change

  public function orderByPosition($dir = self::SORT_ORDER_DESC)



Try this fix:
Copy the file


to local folder


Please add the following code in line 305

$sortOrder = 1;
foreach ($this->_items as $item) {
$productAttribute = $item->getProductAttribute();
if (!($productAttribute instanceof Mage_Eav_Model_Entity_Attribute_Abstract)) {
$options = $productAttribute->getFrontend()->getSelectOptions();
foreach ($options as $option) {
if (!$option['value']) continue;
                    if (isset($values[$item->getId() . ':' . $option['value']])) {
                            $values[$item->getId() . ':' . $option['value']]['order'] = $sortOrder++;
usort($values, function($a, $b) {
return $a['order'] - $b['order'];

The code given should be placed above the code of Magento shown below:

foreach ($values as $data) {



After the above changes, clear the cache and check if it works.

  • Hi magefms thank you for your help still the same the position of super attribute "Malakas","Mahina","Payat" still same is there a way the magento use position so if i save Payat - Position 1 and Malakas as postion 2 and Mahina for position 3 so i will show like this
    – roy phil
    Commented Apr 16, 2019 at 1:45
  • you can set it in Catalog > Attributes > Manage Attributes >
    – fmsthird
    Commented Apr 16, 2019 at 1:48
  • hi magefms thank you for your answer but i believe the position is only work at the left side filter not on the Product view page
    – roy phil
    Commented Apr 16, 2019 at 1:50

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.