File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -308,8 +308,11 @@ public function getSku($product)
308
308
$ selectionIds = $ this ->serializer ->unserialize ($ customOption ->getValue ());
309
309
if (!empty ($ selectionIds )) {
310
310
$ selections = $ this ->getSelectionsByIds ($ selectionIds , $ product );
311
- foreach ($ selections ->getItems () as $ selection ) {
312
- $ skuParts [] = $ selection ->getSku ();
311
+ foreach ($ selectionIds as $ selectionId ) {
312
+ $ entity = $ selections ->getItemByColumnValue ('selection_id ' , $ selectionId );
313
+ if (isset ($ entity ) && $ entity ->getEntityId ()) {
314
+ $ skuParts [] = $ entity ->getSku ();
315
+ }
313
316
}
314
317
}
315
318
}
Original file line number Diff line number Diff line change @@ -1583,7 +1583,7 @@ public function testGetSkuWithoutType()
1583
1583
->disableOriginalConstructor ()
1584
1584
->getMock ();
1585
1585
$ selectionItemMock = $ this ->getMockBuilder (\Magento \Framework \DataObject::class)
1586
- ->setMethods (['getSku ' , '__wakeup ' ])
1586
+ ->setMethods (['getSku ' , 'getEntityId ' , ' __wakeup ' ])
1587
1587
->disableOriginalConstructor ()
1588
1588
->getMock ();
1589
1589
@@ -1611,9 +1611,12 @@ public function testGetSkuWithoutType()
1611
1611
->will ($ this ->returnValue ($ serializeIds ));
1612
1612
$ selectionMock = $ this ->getSelectionsByIdsMock ($ selectionIds , $ productMock , 5 , 6 );
1613
1613
$ selectionMock ->expects (($ this ->any ()))
1614
- ->method ('getItems ' )
1615
- ->will ($ this ->returnValue ([$ selectionItemMock ]));
1616
- $ selectionItemMock ->expects ($ this ->any ())
1614
+ ->method ('getItemByColumnValue ' )
1615
+ ->will ($ this ->returnValue ($ selectionItemMock ));
1616
+ $ selectionItemMock ->expects ($ this ->at (0 ))
1617
+ ->method ('getEntityId ' )
1618
+ ->will ($ this ->returnValue (1 ));
1619
+ $ selectionItemMock ->expects ($ this ->once ())
1617
1620
->method ('getSku ' )
1618
1621
->will ($ this ->returnValue ($ itemSku ));
1619
1622
You can’t perform that action at this time.
0 commit comments