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 ($ entity ->getEntityId ()) {
314
+ $ skuParts [] = $ entity ->getSku ();
315
+ }
313
316
}
314
317
}
315
318
}
Original file line number Diff line number Diff line change @@ -1595,7 +1595,7 @@ public function testGetSkuWithoutType()
1595
1595
->disableOriginalConstructor ()
1596
1596
->getMock ();
1597
1597
$ selectionItemMock = $ this ->getMockBuilder (\Magento \Framework \DataObject::class)
1598
- ->setMethods (['getSku ' , '__wakeup ' ])
1598
+ ->setMethods (['getSku ' , 'getEntityId ' , ' __wakeup ' ])
1599
1599
->disableOriginalConstructor ()
1600
1600
->getMock ();
1601
1601
@@ -1623,9 +1623,12 @@ public function testGetSkuWithoutType()
1623
1623
->will ($ this ->returnValue ($ serializeIds ));
1624
1624
$ selectionMock = $ this ->getSelectionsByIdsMock ($ selectionIds , $ productMock , 5 , 6 );
1625
1625
$ selectionMock ->expects (($ this ->any ()))
1626
- ->method ('getItems ' )
1627
- ->will ($ this ->returnValue ([$ selectionItemMock ]));
1628
- $ selectionItemMock ->expects ($ this ->any ())
1626
+ ->method ('getItemByColumnValue ' )
1627
+ ->will ($ this ->returnValue ($ selectionItemMock ));
1628
+ $ selectionItemMock ->expects ($ this ->at (0 ))
1629
+ ->method ('getEntityId ' )
1630
+ ->will ($ this ->returnValue (1 ));
1631
+ $ selectionItemMock ->expects ($ this ->once ())
1629
1632
->method ('getSku ' )
1630
1633
->will ($ this ->returnValue ($ itemSku ));
1631
1634
You can’t perform that action at this time.
0 commit comments