Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8891823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:50:18+00:00 2026-06-14T22:50:18+00:00

I using Magento 1.6.2. Is there any way to set the position for Attribute

  • 0

I using Magento 1.6.2.

Is there any way to set the position for Attribute Option Labels on a Site View Level and not on a global level?
Reason: Here the Values for Color in English and German

Black / Schwarz
Clear / Transparent
Copper / Kupfer
Yellow / Gelb

It is obvious that the sorting is different for different languages.
Overriding the position value and sorting the values in the frontpage code is not possible because there are options where alphanumeric sorting doesn’t make sense:

i.e. Small Medium Large

Please help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T22:50:20+00:00Added an answer on June 14, 2026 at 10:50 pm

    Yes, this is very possible. But it’s a fairly deep change, depending on what you would like to accomplish with this. This will get you started:

    You want to first add a new column to eav/attribute_option_value table. Here is the setup script for that:

    $installer = $this;
    
    $installer->startSetup();
    
    $installer->run("
        ALTER TABLE `{$this->getTable('eav/attribute_option_value')}` ADD COLUMN `sort_order` INT UNSIGNED NULL DEFAULT 0;
    ");
    
    $installer->endSetup();
    

    Next, you need to rewrite Mage_Eav_Model_Mysql4_Entity_Attribute_Option_Collection. When performing the join for the store filter, you need to add your sort_order there:

    public function setStoreFilter($storeId=null, $useDefaultValue=true)
    {
        if (is_null($storeId)) {
            $storeId = Mage::app()->getStore()->getId();
        }
        $sortBy = 'store_default_value';
        if ($useDefaultValue) {
            $this->getSelect()
                ->join(array('store_default_value'=>$this->_optionValueTable),
                'store_default_value.option_id=main_table.option_id',
                array('default_value'=>'value'))
                ->joinLeft(array('store_value'=>$this->_optionValueTable),
                'store_value.option_id=main_table.option_id AND '.$this->getConnection()->quoteInto('store_value.store_id=?', $storeId),
                array('store_value'=>'value',
                    'value' => new Zend_Db_Expr('IF(store_value.value_id>0, store_value.value,store_default_value.value)',
                    'sort_order'))) // ADDED
                ->where($this->getConnection()->quoteInto('store_default_value.store_id=?', 0));
        }
        else {
            $sortBy = 'store_value';
            $this->getSelect()
                ->joinLeft(array('store_value'=>$this->_optionValueTable),
                'store_value.option_id=main_table.option_id AND '.$this->getConnection()->quoteInto('store_value.store_id=?', $storeId),
                'value',
                'sort_order') // ADDED
                ->where($this->getConnection()->quoteInto('store_value.store_id=?', $storeId));
        }
        $this->setOrder("store_value.sort_order", 'ASC'); // CHANGED
    
        return $this;
    }
    

    To show what is going on: each attribute has a source model. The source model is responsible for providing the values in a frontend dropdown-type list (select, multiselect). If the source model is Mage_Eav_Model_Entity_Attribute_Source_Table, which it will be by default if the attribute type is select or multiselect, then this code retrieves the values:

    $collection = Mage::getResourceModel('eav/entity_attribute_option_collection')
        ->setPositionOrder('asc')
        ->setAttributeFilter($this->getAttribute()->getId())
        ->setStoreFilter($this->getAttribute()->getStoreId())
        ->load();
    

    As you can see, we are rewriting the setStoreFilter() function. This is the last one called. You might want to add an unshiftOrder('main_table.sort_order', 'ASC') at the beginning of the rewritten function, just for good measure that the `main_table.sort_order does not get in the way.

    I’ll leave it to you to make the necessary adjustments to the admin panel to provide the option for setting the sort order matrix.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any function in magento to get the category url by using the
In magento collection I want to filter values using store attribute. I have some
I have a Magento site using JS (prototype) to display tabbed content on product
Is there any way to override, or re-add something that was removed via it's
I am using Magento to build an eBooks site. For the release, we plan
I am using a magento for my site. I am facing the some problem
Is there any setting in magento backend to change continue shopping url ? If
Is there any circumstances that would require a Magento developer to use Mage::getResourceModel() ,
Is there a way to programmatically reopen an order in Magento that has already
Are there in the world any I18n alternatives? I just do not like the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.