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
Block
Adminhtml
Product
Edit
Tab
Price
Tier.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Price
;
7
11
class
Tier
extends
Group\AbstractGroup
12
{
16
protected
$_template
=
'Magento_Catalog::catalog/product/edit/price/tier.phtml'
;
17
23
protected
function
_getInitialCustomerGroups
()
24
{
25
return
[$this->_groupManagement->getAllCustomersGroup()->getId() =>
__
(
'ALL GROUPS'
)];
26
}
27
34
protected
function
_sortValues
(
$data
)
35
{
36
usort(
$data
, [$this,
'_sortTierPrices'
]);
37
return
$data
;
38
}
39
48
protected
function
_sortTierPrices
($a, $b)
49
{
50
if
($a[
'website_id'
] != $b[
'website_id'
]) {
51
return
$a[
'website_id'
] < $b[
'website_id'
] ? -1 : 1;
52
}
53
if
($a[
'cust_group'
] != $b[
'cust_group'
]) {
54
return
$this->getCustomerGroups($a[
'cust_group'
]) < $this->getCustomerGroups($b[
'cust_group'
]) ? -1 : 1;
55
}
56
if
($a[
'price_qty'
] != $b[
'price_qty'
]) {
57
return
$a[
'price_qty'
] < $b[
'price_qty'
] ? -1 : 1;
58
}
59
60
return
0;
61
}
62
69
protected
function
_prepareLayout
()
70
{
71
$button = $this->
getLayout
()->createBlock(
72
\
Magento
\Backend\Block\
Widget
\Button::class
73
)->setData(
74
[
'label'
=>
__
(
'Add Price'
),
'onclick'
=>
'return tierPriceControl.addItem()'
,
'class'
=>
'add'
]
75
);
76
$button->setName(
'add_tier_price_item_button'
);
77
78
$this->
setChild
(
'add_button'
, $button);
79
return
parent::_prepareLayout();
80
}
81
}
Magento\Backend\Block\Widget
Definition:
Widget.php:15
Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Price\Group\AbstractGroup
Definition:
AbstractGroup.php:18
Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Price\Tier\_sortValues
_sortValues($data)
Definition:
Tier.php:34
Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Price\Tier
Definition:
Tier.php:11
__
__()
Definition:
__.php:13
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Price\Tier\_prepareLayout
_prepareLayout()
Definition:
Tier.php:69
Magento\Framework\View\Element\AbstractBlock\getLayout
getLayout()
Definition:
AbstractBlock.php:295
Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Price\Tier\_getInitialCustomerGroups
_getInitialCustomerGroups()
Definition:
Tier.php:23
Magento
Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Price
Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Price\Tier\_sortTierPrices
_sortTierPrices($a, $b)
Definition:
Tier.php:48
Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Price\Tier\$_template
$_template
Definition:
Tier.php:16
Magento\Framework\View\Element\AbstractBlock\setChild
setChild($alias, $block)
Definition:
AbstractBlock.php:358