Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-checkout
Model
Cart
ImageProvider.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Checkout\Model\Cart
;
7
8
use
Magento\Checkout\CustomerData\DefaultItem
;
9
use
Magento\Framework\App\ObjectManager
;
10
15
class
ImageProvider
16
{
20
protected
$itemRepository
;
21
27
protected
$itemPool
;
28
30
protected
$customerDataItem
;
31
37
public
function
__construct
(
38
\
Magento
\
Quote
\Api\CartItemRepositoryInterface
$itemRepository
,
39
\
Magento
\Checkout\CustomerData\ItemPoolInterface
$itemPool
,
40
\
Magento
\Checkout\CustomerData\
DefaultItem
$customerDataItem
=
null
41
) {
42
$this->itemRepository =
$itemRepository
;
43
$this->itemPool =
$itemPool
;
44
$this->customerDataItem =
$customerDataItem
?:
ObjectManager::getInstance
()->get(DefaultItem::class);
45
}
46
50
public
function
getImages(
$cartId
)
51
{
52
$itemData = [];
53
55
$items
= $this->itemRepository->getList(
$cartId
);
57
foreach
(
$items
as
$cartItem
) {
58
$allData = $this->customerDataItem->getItemData(
$cartItem
);
59
$itemData[
$cartItem
->getItemId()] = $allData[
'product_image'
];
60
}
61
return
$itemData;
62
}
63
}
Magento\Checkout\Model\Cart\ImageProvider
Definition:
ImageProvider.php:15
Magento\Framework\App\ObjectManager\getInstance
static getInstance()
Definition:
ObjectManager.php:33
Magento\Checkout\Model\Cart
Definition:
CartInterface.php:6
Magento\Checkout\Model\Cart\ImageProvider\$itemRepository
$itemRepository
Definition:
ImageProvider.php:20
Magento\Checkout\Model\Cart\ImageProvider\$customerDataItem
$customerDataItem
Definition:
ImageProvider.php:30
Magento\Framework\App\ObjectManager
Definition:
ConfigCache.php:8
Magento\Checkout\CustomerData\DefaultItem
Definition:
DefaultItem.php:15
Magento\Checkout\Model\Cart\ImageProvider\$itemPool
$itemPool
Definition:
ImageProvider.php:27
$cartId
$cartId
Definition:
quote.php:22
Magento
Magento\Framework\DB\Platform\Quote
Definition:
Quote.php:13
$cartItem
$cartItem
Definition:
quote_with_product_and_custom_options.php:35
$items
$items
Definition:
order_rollback.php:21
Magento\Checkout\Model\Cart\ImageProvider\__construct
__construct(\Magento\Quote\Api\CartItemRepositoryInterface $itemRepository, \Magento\Checkout\CustomerData\ItemPoolInterface $itemPool, \Magento\Checkout\CustomerData\DefaultItem $customerDataItem=null)
Definition:
ImageProvider.php:37