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-bundle
Ui
DataProvider
Product
Form
Modifier
BundlePrice.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Bundle\Ui\DataProvider\Product\Form\Modifier
;
7
8
use
Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier
;
9
use
Magento\Catalog\Api\Data\ProductAttributeInterface
;
10
use
Magento\Framework\Stdlib\ArrayManager
;
11
use
Magento\Catalog\Model\Locator\LocatorInterface
;
12
16
class
BundlePrice
extends
AbstractModifier
17
{
18
const
CODE_PRICE_TYPE
=
'price_type'
;
19
const
CODE_TAX_CLASS_ID
=
'tax_class_id'
;
20
24
protected
$arrayManager
;
25
29
protected
$locator
;
30
35
public
function
__construct
(
36
LocatorInterface
$locator
,
37
ArrayManager
$arrayManager
38
) {
39
$this->locator =
$locator
;
40
$this->arrayManager =
$arrayManager
;
41
}
42
46
public
function
modifyMeta
(array $meta)
47
{
48
$meta = $this->arrayManager->merge(
49
$this->arrayManager->findPath(static::CODE_PRICE_TYPE, $meta,
null
,
'children'
) . static::META_CONFIG_PATH,
50
$meta,
51
[
52
'disabled'
=> (bool)$this->locator->getProduct()->getId(),
53
'valueMap'
=> [
54
'false'
=>
'1'
,
55
'true'
=>
'0'
56
],
57
'validation'
=> [
58
'required-entry'
=>
false
59
]
60
]
61
);
62
63
$meta = $this->arrayManager->merge(
64
$this->arrayManager->findPath(
65
ProductAttributeInterface::CODE_PRICE
,
66
$meta,
67
null
,
68
'children'
69
) . static::META_CONFIG_PATH,
70
$meta,
71
[
72
'imports'
=> [
73
'disabled'
=>
'ns = ${ $.ns }, index = '
. static::CODE_PRICE_TYPE .
':checked'
74
]
75
]
76
);
77
78
$meta = $this->arrayManager->merge(
79
$this->arrayManager->findPath(
80
static::CODE_TAX_CLASS_ID,
81
$meta,
82
null
,
83
'children'
84
) . static::META_CONFIG_PATH,
85
$meta,
86
[
87
'imports'
=> [
88
'disabled'
=>
'ns = ${ $.ns }, index = '
. static::CODE_PRICE_TYPE .
':checked'
89
]
90
]
91
);
92
93
return
$meta;
94
}
95
99
public
function
modifyData
(array
$data
)
100
{
101
return
$data
;
102
}
103
}
Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePrice\$locator
$locator
Definition:
BundlePrice.php:29
false
return false
Definition:
gallery.phtml:36
Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePrice\CODE_TAX_CLASS_ID
const CODE_TAX_CLASS_ID
Definition:
BundlePrice.php:19
Magento\Catalog\Api\Data\ProductAttributeInterface\CODE_PRICE
const CODE_PRICE
Definition:
ProductAttributeInterface.php:18
Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePrice\$arrayManager
$arrayManager
Definition:
BundlePrice.php:24
Magento\Bundle\Ui\DataProvider\Product\Form\Modifier
Definition:
BundleAdvancedPricing.php:6
Magento\Catalog\Api\Data\ProductAttributeInterface
Definition:
ProductAttributeInterface.php:13
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Catalog\Model\Locator\LocatorInterface
Definition:
LocatorInterface.php:17
Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePrice\modifyMeta
modifyMeta(array $meta)
Definition:
BundlePrice.php:46
Magento\Framework\Stdlib\ArrayManager
Definition:
ArrayManager.php:14
Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\AbstractModifier
Definition:
AbstractModifier.php:19
Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePrice\CODE_PRICE_TYPE
const CODE_PRICE_TYPE
Definition:
BundlePrice.php:18
Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePrice\modifyData
modifyData(array $data)
Definition:
BundlePrice.php:99
Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePrice
Definition:
BundlePrice.php:16
Magento\Bundle\Ui\DataProvider\Product\Form\Modifier\BundlePrice\__construct
__construct(LocatorInterface $locator, ArrayManager $arrayManager)
Definition:
BundlePrice.php:35