We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d03bc98 commit 1fb3a97Copy full SHA for 1fb3a97
app/code/Magento/Quote/Model/Quote.php
@@ -1444,11 +1444,17 @@ public function hasProductId($productId)
1444
* Retrieve item model object by item identifier
1445
*
1446
* @param int $itemId
1447
- * @return \Magento\Quote\Model\Quote\Item
+ * @return \Magento\Quote\Model\Quote\Item|false
1448
*/
1449
public function getItemById($itemId)
1450
{
1451
- return $this->getItemsCollection()->getItemById($itemId);
+ foreach ($this->getItemsCollection() as $item) {
1452
+ if ($item->getId() == $itemId) {
1453
+ return $item;
1454
+ }
1455
1456
+
1457
+ return false;
1458
}
1459
1460
/**
0 commit comments