diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Attribute/OptionSelectBuilder.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Attribute/OptionSelectBuilder.php index 958d802682d52..0133960b8f15b 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Attribute/OptionSelectBuilder.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Attribute/OptionSelectBuilder.php @@ -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( @@ -97,6 +101,8 @@ public function getSelect(AbstractAttribute $superAttribute, int $productId, Sco )->where( 'attribute.attribute_id = ?', $superAttribute->getAttributeId() + )->order( + 'attribute_opt.sort_order ASC' ); if (!$superAttribute->getSourceModel()) {