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-search
Block
Plugin
FrontTabPlugin.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\CatalogSearch\Block\Plugin
;
7
8
use
Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front
as ProductAttributeFrontTabBlock;
9
use
Magento\CatalogSearch\Model\Source\Weight
;
10
use
Magento\Framework\Data\Form
;
11
use
Magento\Framework\Data\Form\Element\Fieldset
;
12
16
class
FrontTabPlugin
17
{
21
private
$weightSource;
22
26
public
function
__construct
(
Weight
$weightSource)
27
{
28
$this->weightSource = $weightSource;
29
}
30
38
public
function
beforeSetForm(ProductAttributeFrontTabBlock $subject,
Form
$form)
39
{
41
$fieldset = $form->
getElement
(
'front_fieldset'
);
42
$fieldset->addField(
43
'search_weight'
,
44
'select'
,
45
[
46
'name'
=>
'search_weight'
,
47
'label'
=>
__
(
'Search Weight'
),
48
'values'
=> $this->weightSource->getOptions()
49
],
50
'is_searchable'
51
);
52
$subject->getChildBlock(
'form_after'
)
53
->addFieldMap(
'search_weight'
,
'search_weight'
)
54
->addFieldDependence(
'search_weight'
,
'searchable'
,
'1'
);
55
}
56
}
Magento\Framework\Data\Form\getElement
getElement($elementId)
Definition:
Form.php:201
Magento\CatalogSearch\Block\Plugin\FrontTabPlugin\__construct
__construct(Weight $weightSource)
Definition:
FrontTabPlugin.php:26
__
__()
Definition:
__.php:13
Magento\CatalogSearch\Model\Source\Weight
Definition:
Weight.php:13
Magento\Framework\Data\Form\Element\Fieldset
Definition:
Fieldset.php:18
Magento\CatalogSearch\Block\Plugin\FrontTabPlugin
Definition:
FrontTabPlugin.php:16
Magento\Framework\Data\Form
Definition:
Form.php:21
Magento\Framework\Data\Form
Definition:
AbstractForm.php:6
Magento\CatalogSearch\Block\Plugin
Definition:
FrontTabPlugin.php:6
Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front
Definition:
Front.php:27