File tree Expand file tree Collapse file tree 2 files changed +5
-15
lines changed
app/code/Magento/ConfigurableProduct/Test/Fixture Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Original file line number Diff line number Diff line change 7
7
8
8
namespace Magento \ConfigurableProduct \Test \Fixture ;
9
9
10
+ use Magento \Catalog \Test \Fixture \SelectAttribute ;
10
11
use Magento \Framework \DataObject ;
11
12
12
- class Attribute extends \ Magento \ Catalog \ Test \ Fixture \Attribute
13
+ class Attribute extends SelectAttribute
13
14
{
14
15
private const DEFAULT_DATA = [
15
- 'frontend_input ' => 'select ' ,
16
- 'options ' => [
17
- [
18
- 'label ' => 'option1%uniqid% ' ,
19
- 'sort_order ' => 0 ,
20
- ],
21
- [
22
- 'label ' => 'option2%uniqid% ' ,
23
- 'sort_order ' => 1 ,
24
- ]
25
- ],
26
16
'scope ' => 'global ' ,
27
17
];
28
18
Original file line number Diff line number Diff line change @@ -197,15 +197,15 @@ static function (array $value) {
197
197
);
198
198
$ variationIndex = 0 ;
199
199
foreach ($ variations as $ variation ) {
200
- foreach ( $ variation as $ attributeId => $ valueInfo ) {
201
- if ( isset ( $ links [ $ variationIndex ]) && $ links [ $ variationIndex ] !== 0 ) {
200
+ if ( isset ( $ links [ $ variationIndex ]) && $ links [ $ variationIndex ] !== 0 ) {
201
+ foreach ( $ variation as $ attributeId => $ valueInfo ) {
202
202
$ attribute = $ this ->eavConfig ->getAttribute (\Magento \Catalog \Model \Product::ENTITY , $ attributeId );
203
203
$ product = $ this ->productRepository ->getById ($ links [$ variationIndex ]);
204
204
$ product ->setCustomAttribute ($ attribute ->getAttributeCode (), $ valueInfo ['value ' ]);
205
205
$ this ->productRepository ->save ($ product );
206
206
}
207
- $ variationIndex ++;
208
207
}
208
+ $ variationIndex ++;
209
209
}
210
210
}
211
211
}
You can’t perform that action at this time.
0 commit comments