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-low-quantity-notification
Model
SourceItemConfiguration
GetDefaultValues.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\InventoryLowQuantityNotification\Model\SourceItemConfiguration
;
9
10
use
Magento\Framework\App\Config\ScopeConfigInterface
;
11
use
Magento\InventoryLowQuantityNotificationApi\Api\Data\SourceItemConfigurationInterface
;
12
16
class
GetDefaultValues
17
{
21
const
XML_PATH_NOTIFY_STOCK_QTY
=
'cataloginventory/item_options/notify_stock_qty'
;
22
26
private
$scopeConfig;
27
31
public
function
__construct
(
32
ScopeConfigInterface
$scopeConfig
33
) {
34
$this->scopeConfig = $scopeConfig;
35
}
36
42
public
function
execute
(
string
$sourceCode
,
string
$sku) : array
43
{
44
$inventoryNotifyQty = (float)$this->scopeConfig->getValue(self::XML_PATH_NOTIFY_STOCK_QTY);
45
46
$defaultConfiguration = [
47
SourceItemConfigurationInterface::SOURCE_CODE
=>
$sourceCode
,
48
SourceItemConfigurationInterface::SKU
=> $sku,
49
SourceItemConfigurationInterface::INVENTORY_NOTIFY_QTY
=> $inventoryNotifyQty,
50
];
51
return
$defaultConfiguration;
52
}
53
}
Magento\InventoryLowQuantityNotificationApi\Api\Data\SourceItemConfigurationInterface\INVENTORY_NOTIFY_QTY
const INVENTORY_NOTIFY_QTY
Definition:
SourceItemConfigurationInterface.php:24
Magento\InventoryLowQuantityNotification\Model\SourceItemConfiguration\GetDefaultValues\__construct
__construct(ScopeConfigInterface $scopeConfig)
Definition:
GetDefaultValues.php:31
$sourceCode
$sourceCode
Definition:
inventory.phtml:11
Magento\InventoryLowQuantityNotification\Model\SourceItemConfiguration\GetDefaultValues
Definition:
GetDefaultValues.php:16
Magento\InventoryLowQuantityNotification\Model\SourceItemConfiguration\GetDefaultValues\execute
execute(string $sourceCode, string $sku)
Definition:
GetDefaultValues.php:42
Magento\InventoryLowQuantityNotificationApi\Api\Data\SourceItemConfigurationInterface
Definition:
SourceItemConfigurationInterface.php:17
Magento\Framework\App\Config\ScopeConfigInterface
Definition:
ScopeConfigInterface.php:15
Magento\InventoryLowQuantityNotificationApi\Api\Data\SourceItemConfigurationInterface\SKU
const SKU
Definition:
SourceItemConfigurationInterface.php:23
Magento\InventoryLowQuantityNotificationApi\Api\Data\SourceItemConfigurationInterface\SOURCE_CODE
const SOURCE_CODE
Definition:
SourceItemConfigurationInterface.php:22
Magento\InventoryLowQuantityNotification\Model\SourceItemConfiguration
Definition:
DeleteMultiple.php:8
Magento\InventoryLowQuantityNotification\Model\SourceItemConfiguration\GetDefaultValues\XML_PATH_NOTIFY_STOCK_QTY
const XML_PATH_NOTIFY_STOCK_QTY
Definition:
GetDefaultValues.php:21