Skip to content
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

Fix Configurable attribute options are not sorted #7441 #12420

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ public function getSelect(AbstractAttribute $superAttribute, int $productId, Sco
]
),
[]
)->joinInner(
['attribute_opt' => $this->attributeResource->getTable('eav_attribute_option')],
'attribute_opt.option_id = entity_value.value',
[]
)->joinLeft(
['attribute_label' => $this->attributeResource->getTable('catalog_product_super_attribute_label')],
implode(
Expand All @@ -97,6 +101,8 @@ public function getSelect(AbstractAttribute $superAttribute, int $productId, Sco
)->where(
'attribute.attribute_id = ?',
$superAttribute->getAttributeId()
)->order(
'attribute_opt.sort_order ASC'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes looks good to me.

Please update existing unit test: https://travis-ci.org/magento/magento2/jobs/306413370 and add a separate test method to just check options are returned in correct order.

After that please do an amend commit and force push to the same branch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I already see maybe I add also a integrations test because only PHPUnit test makes not so much sense.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, something involving a real database would be more than appreciated here.

);

if (!$superAttribute->getSourceModel()) {
Expand Down