-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable attribute options are not sorted #7441
Comments
@dmaciej thank you for your feedback. |
@veloraven updated |
2.1.1 CE / CentOS 6.7 / PHP 7 |
For the solution please visit on the link: http://magento.stackexchange.com/questions/141899/configurable-product-attribute-sort-order-in-dropdown-2-12/146858#146858 OR As I checked this issue and found that while fetching the attribute options, there is no sorting filter added in the query by default in Magento 2.1.2, So to fix this issue need to add the below code to add the ORDER By in function getAttributeOptions on line no 282 in file: vendor/magento/module-configurable-product/Model/ResourceModel/Product/Type/Configurable.php Now, it's working fine for me.
If unable to edit the code then please replace this getAttributeOptions function with code as below: `public function getAttributeOptions($superAttribute, $productId)
}` |
@dmaciej thank you for your feedback. |
@slopukhov Is there a way for the Magento community to see the progress on an internal issue? If I decide to work on a fix for this issue, how do I know Magento has not already fixed this issue elsewhere but has not updated this ticket? |
is there any update about this issue? |
@slopukhov Any update about this issue ? |
Any updates regarding this issue? |
@dmatthew this GitHub issue will be updated unless the bug is fixed in scope of another internal ticket. For now the process is:
071ba86#diff-64f271ca81aa683e5df1a23c862458d8 looks like an attempt to fix this issue on client side, but as it is a part of |
@DariuszMaciejewski, thank you for your report. |
@duffner it's a less than ideal workaround, but works great upon a second save! Thanks! |
@alen12345 and @BigTonni, glad it helps! @magento-engcom-team, is there any update on this? |
In case others using Magento 2.1.x would bump into this, here's a patch-file including the solution developed by @jagdishram: Updated the patch file to include required changes to related unit tests as well. |
See github issue magento#7441, internal ticket MAGETWO-61484 and PR magento#12420.
When fetching configurable options using the configurable product option select builder, the sort_order of each option should be taken into account as well, making sure the desired sorting is passed to the frontend. See github issue magento#7441, internal ticket MAGETWO-61484 and PR#12420 for more on this.
When fetching configurable options using the configurable product option select builder, the sort_order of each option should be taken into account as well, making sure the desired sorting is passed to the frontend. See github issue magento#7441, internal ticket MAGETWO-61484 and PR#12420 for more on this.
Not fixed in 2.2.2 it looks like. I've asked for a patch from support. But I made a simple patch based on the commit 9794d38 referenced above too, and it seems to work well. I'll attached it as a TXT file. You should be able to run |
sorting bug will be fixed with 2.2.5 or do we have to wait for 2.3 ? |
@splendidinternet from commit mentioned in #7441 (comment) you can that it is already fixed in 2.2.4. |
I checked the code for my 2.2.5 installation, the changes mentioned in comment #7441 are there but I still don't have control over the order of my configurable values. Anyone else having this issue? |
This is caching issue (2.2.4+). If var/cache is cleared after reordering attribute option values in the backend, then the changes are in effect on the frontend. Maybe automatic tests should take a caching layer into account? |
I figured it out. You have to change your website to developer mode then switch it back to production. Once I did that I was able to control the configurable values. |
Someone has any solution for Magento 2.2.5? |
Experiencing the same issue in Magento 2.2.5, All solution mentioned above is not working for Magento 2.2.5, They suggested code changes are added in Magento 2.2.5 files but sort order is still not fixed. Any news on this issue, is it fixed in Magento 2.2.6 release? |
Open File \Magento\ConfigurableProduct\Model\ConfigurableAttributeData.php Update Function getAttributesData() $attributes[$attributeId] = [ |
I have been having this issue (Magento 2.2.6, these attributes were created back in Mage 2.0.*) myself and none of the fixes in this thread worked because of a single issue:
I will manually assign each one with a sort order. I wonder if this could have been done with the Mage REST API? |
In the Magento version 2.2.6 the order can be modified from the Admin, in the Manage Options (Values of Your Attribute) tab of the attribute |
If you have some trubles with attributes on configurable products try to flash cache and run indexer:
|
Turns out we had the same problem like @aluckyar - what's a bit confusing is that the admin sorted display and the frontend sorted display differs, if sort_order = 0 for all the field (in our case we use a 3rd party importer which does not seem to write the sort_order field). |
Configurable attribute options are not sorted on the product page.
Preconditions
Steps to reproduce
Expected result
Actual result
The issue is related to the method
ConfigurableAttributeData::getAttributeOptionsData()
in the fileapp/code/Magento/ConfigurableProduct/Model/ConfigurableAttributeData.php
.I think you should load options sort order here and sort the output array.
The text was updated successfully, but these errors were encountered: