In the latest version of Magento Community 1.9.1, the configurable product options and dropdowns are not sorted based on the attribute position set. Instead, they use simple product ids to determine the list order.

This may confuse the customer as well as the admin at times. This issue can be fixed by following the steps given below.

Step 1:

By default, we set the attribute position using the following path.

Catalog > Attributes > Manage Attributes > (in the below example we have selected one product attribute called “Shoe size”) > Manage Labels/Options (left side navigation).

In this page, we set the options “Position” like the below image.

magento attribute position set issue

 

Step 2:

Next, we need to add the simple product under one configurable product as given below.

2a

Step 3:

Now check the configurable product attribute option on front-end. It will look like the below image.

magento attribute position set issue

In the above image, the product attribute options list is based on the simple product ids instead of attribute position set.

Step 4:

We can solve this issue by adding the small piece of code in the file Collection.php.

For that copy the file

  app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php

to local folder

   app/code/local/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php

Please add the following code in line 305.

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

foreach ($values as $data) {

$this->getItemById($data[‘product_super_attribute_id’])->addPrice($data);

}

Step 5:

Now clear the cache and check it on front-end. The attribute option looks like the following image.

magento attribute position set issue

Now the product attribute options list will be sorted based on the position and not by the simple product ids.

Even though this is a small issue, it can become an irritant for the admin and affect the user experience of the customer. We faced this issue while working on a client project and wanted to share the same so that the community benefits as a whole.

Please let us know your comments and feedback.

Be the first to Know

Subscribe to our blog to get the latest articles directly to your inbox.

READY TO DRIVE SALES?

Request a Quote Today

Request a Quote

Leave a Reply

4 Comments on "Magento Community – 1.9.1 – Fixing Attribute Position Set Issue"


Guest
yuvaraj
1 year 9 months ago

fantastic

admin
Admin
1 year 8 months ago

Hi Yuvaraj,

Thanks.
Please keeping reading our blogs.

Guest
Alex Plotnikov
1 year 9 months ago

Thanks for keeping up with Magento 1.x.x updates:) Too many blogs these days switched to covering only Magento 2 as it’s the hot new thing. But you guys always have something tasty for the rest of the community: great visuals and thanks for the code snippets.

admin
Admin
1 year 9 months ago

Hi Alex,

Thanks for your comments. Please keep reading our blogs and posting your comments and feedbacks.