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-catalog-inventory
Model
Plugin
AfterProductLoad.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\CatalogInventory\Model\Plugin
;
8
15
class
AfterProductLoad
16
{
20
private
$stockRegistry;
21
25
public
function
__construct
(
26
\
Magento
\CatalogInventory\Api\
StockRegistryInterface
$stockRegistry
27
) {
28
$this->stockRegistry =
$stockRegistry
;
29
}
30
37
public
function
afterLoad
(\
Magento
\Catalog\Model\Product
$product
)
38
{
39
$productExtension =
$product
->getExtensionAttributes();
40
$productExtension->setStockItem($this->stockRegistry->getStockItem(
$product
->getId()));
41
$product
->setExtensionAttributes($productExtension);
42
return
$product
;
43
}
44
}
Magento\CatalogInventory\Model\Plugin
Definition:
ProductSearchTest.php:9
$stockRegistry
$stockRegistry
Definition:
product_downloadable_with_files.php:158
Magento\CatalogInventory\Model\Plugin\AfterProductLoad\afterLoad
afterLoad(\Magento\Catalog\Model\Product $product)
Definition:
AfterProductLoad.php:37
Magento\CatalogInventory\Model\Plugin\AfterProductLoad
Definition:
AfterProductLoad.php:15
Magento\CatalogInventory\Model\Plugin\AfterProductLoad\__construct
__construct(\Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry)
Definition:
AfterProductLoad.php:25
Magento\CatalogInventory\Api\StockRegistryInterface
Definition:
StockRegistryInterface.php:17
Magento
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22