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-inventory-catalog
Plugin
InventoryConfigurationApi
GetStockItemConfiguration
LoadIsInStockPlugin.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\InventoryCatalog\Plugin\InventoryConfigurationApi\GetStockItemConfiguration
;
9
10
use
Magento\InventoryConfiguration\Model\GetLegacyStockItem
;
11
use
Magento\InventoryConfigurationApi\Api\Data\StockItemConfigurationInterface
;
12
use
Magento\InventoryConfigurationApi\Api\GetStockItemConfigurationInterface
;
13
17
class
LoadIsInStockPlugin
18
{
22
private
$getLegacyStockItem;
23
27
public
function
__construct
(
GetLegacyStockItem
$getLegacyStockItem)
28
{
29
$this->getLegacyStockItem = $getLegacyStockItem;
30
}
31
40
public
function
afterExecute
(
41
GetStockItemConfigurationInterface
$subject,
42
StockItemConfigurationInterface
$result
,
43
string
$sku,
44
int
$stockId
45
) :
StockItemConfigurationInterface
{
46
$legacyStockItem = $this->getLegacyStockItem->execute($sku);
47
$extensionAttributes
=
$result
->getExtensionAttributes();
48
$extensionAttributes
->setIsInStock((
bool
)(
int
)$legacyStockItem->getIsInStock());
49
$result
->setExtensionAttributes(
$extensionAttributes
);
50
51
return
$result
;
52
}
53
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\InventoryCatalog\Plugin\InventoryConfigurationApi\GetStockItemConfiguration\LoadIsInStockPlugin\__construct
__construct(GetLegacyStockItem $getLegacyStockItem)
Definition:
LoadIsInStockPlugin.php:27
Magento\InventoryConfiguration\Model\GetLegacyStockItem
Definition:
GetLegacyStockItem.php:19
$extensionAttributes
$extensionAttributes
Definition:
payment.php:22
Magento\InventoryConfigurationApi\Api\Data\StockItemConfigurationInterface
Definition:
StockItemConfigurationInterface.php:13
Magento\InventoryCatalog\Plugin\InventoryConfigurationApi\GetStockItemConfiguration\LoadIsInStockPlugin
Definition:
LoadIsInStockPlugin.php:17
Magento\InventoryCatalog\Plugin\InventoryConfigurationApi\GetStockItemConfiguration
Definition:
LoadIsInStockPlugin.php:8
Magento\InventoryConfigurationApi\Api\GetStockItemConfigurationInterface
Definition:
GetStockItemConfigurationInterface.php:15
Magento\InventoryCatalog\Plugin\InventoryConfigurationApi\GetStockItemConfiguration\LoadIsInStockPlugin\afterExecute
afterExecute(GetStockItemConfigurationInterface $subject, StockItemConfigurationInterface $result, string $sku, int $stockId)
Definition:
LoadIsInStockPlugin.php:40