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-grouped-product-admin-ui
Plugin
Ui
DataProvider
Product
Form
AddColumnQuantityPerSource.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\InventoryGroupedProductAdminUi\Plugin\Ui\DataProvider\Product\Form
;
9
10
use
Magento\GroupedProduct\Ui\DataProvider\Product\GroupedProductDataProvider
;
11
use
Magento\InventoryCatalogApi\Model\IsSingleSourceModeInterface
;
12
use
Magento\Ui\Component\Form\Element\DataType\Text
;
13
use
Magento\Ui\Component\Listing\Columns\Column
;
14
18
class
AddColumnQuantityPerSource
19
{
23
private
$isSingleSourceMode;
24
28
public
function
__construct
(
29
IsSingleSourceModeInterface
$isSingleSourceMode
30
) {
31
$this->isSingleSourceMode = $isSingleSourceMode;
32
}
33
43
public
function
afterGetMeta
(
GroupedProductDataProvider
$subject, array
$result
): array
44
{
45
if
(!$this->isSingleSourceMode->execute()) {
46
$result
= array_replace_recursive(
$result
, [
47
'product_columns'
=> [
48
'children'
=> [
49
'quantity_per_source'
=> $this->getQuantityPerSourceMeta(),
50
'qty'
=> [
51
'arguments'
=>
null
,
52
],
53
],
54
],
55
]);
56
}
57
58
return
$result
;
59
}
60
66
private
function
getQuantityPerSourceMeta(): array
67
{
68
$jsComponent =
'Magento_InventoryGroupedProductAdminUi/js/form/element/grid-column-quantity-per-source'
;
69
70
return
[
71
'arguments'
=> [
72
'data'
=> [
73
'config'
=> [
74
'filter'
=>
false
,
75
'sortable'
=>
false
,
76
'label'
=>
__
(
'Quantity per Source'
),
77
'dataType'
=>
Text::NAME
,
78
'componentType'
=>
Column::NAME
,
79
'component'
=> $jsComponent,
80
]
81
],
82
],
83
];
84
}
85
}
$result
$result
Definition:
product_configurable_not_available_rollback.php:26
Magento\InventoryGroupedProductAdminUi\Plugin\Ui\DataProvider\Product\Form\AddColumnQuantityPerSource\__construct
__construct(IsSingleSourceModeInterface $isSingleSourceMode)
Definition:
AddColumnQuantityPerSource.php:28
Magento\GroupedProduct\Ui\DataProvider\Product\GroupedProductDataProvider
Definition:
GroupedProductDataProvider.php:16
__
__()
Definition:
__.php:13
Magento\InventoryCatalogApi\Model\IsSingleSourceModeInterface
Definition:
IsSingleSourceModeInterface.php:15
Magento\InventoryGroupedProductAdminUi\Plugin\Ui\DataProvider\Product\Form
Definition:
AddColumnQuantityPerSource.php:8
Magento\InventoryGroupedProductAdminUi\Plugin\Ui\DataProvider\Product\Form\AddColumnQuantityPerSource
Definition:
AddColumnQuantityPerSource.php:18
Magento\Ui\Component\Listing\Columns\Column\NAME
const NAME
Definition:
Column.php:19
Magento\Ui\Component\Listing\Columns\Column
Definition:
Column.php:17
Magento\Ui\Component\Form\Element\DataType\Text\NAME
const NAME
Definition:
Text.php:14
Magento\Ui\Component\Form\Element\DataType\Text
Definition:
Text.php:12
Magento\InventoryGroupedProductAdminUi\Plugin\Ui\DataProvider\Product\Form\AddColumnQuantityPerSource\afterGetMeta
afterGetMeta(GroupedProductDataProvider $subject, array $result)
Definition:
AddColumnQuantityPerSource.php:43