File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
app/code/Magento/ConfigurableProduct
Block/Adminhtml/Product/Edit/Tab/Variations/Config
Ui/DataProvider/Product/Form/Modifier/Data Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -321,6 +321,7 @@ protected function prepareVariations()
321
321
if ($ variations ) {
322
322
$ usedProductAttributes = $ this ->getUsedAttributes ();
323
323
$ productByUsedAttributes = $ this ->getAssociatedProducts ();
324
+ $ configurableAttributes = $ this ->getAttributes ();
324
325
foreach ($ variations as $ variation ) {
325
326
$ attributeValues = [];
326
327
foreach ($ usedProductAttributes as $ attribute ) {
@@ -337,7 +338,7 @@ protected function prepareVariations()
337
338
'code ' => $ attribute ->getAttributeCode (),
338
339
'label ' => $ attribute ->getStoreLabel (),
339
340
'id ' => $ attribute ->getAttributeId (),
340
- 'position ' => $ attribute ->getPosition () ,
341
+ 'position ' => $ configurableAttributes [ $ attribute ->getAttributeId ()][ ' position ' ] ,
341
342
'chosen ' => [],
342
343
];
343
344
foreach ($ attribute ->getOptions () as $ option ) {
Original file line number Diff line number Diff line change @@ -231,6 +231,7 @@ protected function prepareVariations()
231
231
$ usedProductAttributes = $ this ->getUsedAttributes ();
232
232
$ productByUsedAttributes = $ this ->getAssociatedProducts ();
233
233
$ currency = $ this ->localeCurrency ->getCurrency ($ this ->locator ->getBaseCurrencyCode ());
234
+ $ configurableAttributes = $ this ->getAttributes ();
234
235
foreach ($ variations as $ variation ) {
235
236
$ attributeValues = [];
236
237
foreach ($ usedProductAttributes as $ attribute ) {
@@ -247,7 +248,7 @@ protected function prepareVariations()
247
248
'code ' => $ attribute ->getAttributeCode (),
248
249
'label ' => $ attribute ->getStoreLabel (),
249
250
'id ' => $ attribute ->getAttributeId (),
250
- 'position ' => $ attribute ->getPosition () ,
251
+ 'position ' => $ configurableAttributes [ $ attribute ->getAttributeId ()][ ' position ' ] ,
251
252
'chosen ' => [],
252
253
];
253
254
foreach ($ attribute ->getOptions () as $ option ) {
You can’t perform that action at this time.
0 commit comments