Skip to content

Commit 64bb2d2

Browse files
author
Valeriy Nayda
committed
MAGETWO-50409: Changing order of configurable attributes is ignored on frontend
1 parent 951694c commit 64bb2d2

File tree

2 files changed

+4
-2
lines changed
  • app/code/Magento/ConfigurableProduct

2 files changed

+4
-2
lines changed

app/code/Magento/ConfigurableProduct/Block/Adminhtml/Product/Edit/Tab/Variations/Config/Matrix.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ protected function prepareVariations()
321321
if ($variations) {
322322
$usedProductAttributes = $this->getUsedAttributes();
323323
$productByUsedAttributes = $this->getAssociatedProducts();
324+
$configurableAttributes = $this->getAttributes();
324325
foreach ($variations as $variation) {
325326
$attributeValues = [];
326327
foreach ($usedProductAttributes as $attribute) {
@@ -337,7 +338,7 @@ protected function prepareVariations()
337338
'code' => $attribute->getAttributeCode(),
338339
'label' => $attribute->getStoreLabel(),
339340
'id' => $attribute->getAttributeId(),
340-
'position' => $attribute->getPosition(),
341+
'position' => $configurableAttributes[$attribute->getAttributeId()]['position'],
341342
'chosen' => [],
342343
];
343344
foreach ($attribute->getOptions() as $option) {

app/code/Magento/ConfigurableProduct/Ui/DataProvider/Product/Form/Modifier/Data/AssociatedProducts.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ protected function prepareVariations()
231231
$usedProductAttributes = $this->getUsedAttributes();
232232
$productByUsedAttributes = $this->getAssociatedProducts();
233233
$currency = $this->localeCurrency->getCurrency($this->locator->getBaseCurrencyCode());
234+
$configurableAttributes = $this->getAttributes();
234235
foreach ($variations as $variation) {
235236
$attributeValues = [];
236237
foreach ($usedProductAttributes as $attribute) {
@@ -247,7 +248,7 @@ protected function prepareVariations()
247248
'code' => $attribute->getAttributeCode(),
248249
'label' => $attribute->getStoreLabel(),
249250
'id' => $attribute->getAttributeId(),
250-
'position' => $attribute->getPosition(),
251+
'position' => $configurableAttributes[$attribute->getAttributeId()]['position'],
251252
'chosen' => [],
252253
];
253254
foreach ($attribute->getOptions() as $option) {

0 commit comments

Comments
 (0)