37 private $propertyLocker;
55 $this->_yesNo = $yesNo;
56 $this->propertyLocker = $propertyLocker;
68 $attributeObject = $this->_coreRegistry->registry(
'entity_attribute');
71 $form = $this->_formFactory->create(
72 [
'data' => [
'id' =>
'edit_form',
'action' => $this->
getData(
'action'),
'method' =>
'post']]
75 $yesnoSource = $this->_yesNo->toOptionArray();
77 $fieldset = $form->addFieldset(
79 [
'legend' =>
__(
'Storefront Properties'),
'collapsable' => $this->
getRequest()->has(
'popup')]
86 'name' =>
'is_searchable',
87 'label' =>
__(
'Use in Search'),
88 'title' =>
__(
'Use in Search'),
89 'values' => $yesnoSource,
94 'is_visible_in_advanced_search',
97 'name' =>
'is_visible_in_advanced_search',
98 'label' =>
__(
'Visible in Advanced Search'),
99 'title' =>
__(
'Visible in Advanced Search'),
100 'values' => $yesnoSource,
108 'name' =>
'is_comparable',
109 'label' =>
__(
'Comparable on Storefront'),
110 'title' =>
__(
'Comparable on Storefront'),
111 'values' => $yesnoSource,
115 $this->_eventManager->dispatch(
'product_attribute_form_build_front_tab', [
'form' => $form]);
118 'is_used_for_promo_rules',
121 'name' =>
'is_used_for_promo_rules',
122 'label' =>
__(
'Use for Promo Rule Conditions'),
123 'title' =>
__(
'Use for Promo Rule Conditions'),
124 'values' => $yesnoSource,
129 'is_html_allowed_on_front',
132 'name' =>
'is_html_allowed_on_front',
133 'label' =>
__(
'Allow HTML Tags on Storefront'),
134 'title' =>
__(
'Allow HTML Tags on Storefront'),
135 'values' => $yesnoSource,
138 if (!$attributeObject->getId() || $attributeObject->getIsWysiwygEnabled()) {
139 $attributeObject->setIsHtmlAllowedOnFront(1);
143 'is_visible_on_front',
146 'name' =>
'is_visible_on_front',
147 'label' =>
__(
'Visible on Catalog Pages on Storefront'),
148 'title' =>
__(
'Visible on Catalog Pages on Storefront'),
149 'values' => $yesnoSource
154 'used_in_product_listing',
157 'name' =>
'used_in_product_listing',
158 'label' =>
__(
'Used in Product Listing'),
159 'title' =>
__(
'Used in Product Listing'),
160 'note' =>
__(
'Depends on design theme.'),
161 'values' => $yesnoSource
169 'name' =>
'used_for_sort_by',
170 'label' =>
__(
'Used for Sorting in Product Listing'),
171 'title' =>
__(
'Used for Sorting in Product Listing'),
172 'note' =>
__(
'Depends on design theme.'),
173 'values' => $yesnoSource
177 $this->_eventManager->dispatch(
178 'adminhtml_catalog_product_attribute_edit_frontend_prepare_form',
179 [
'form' => $form,
'attribute' => $attributeObject]
188 "is_html_allowed_on_front",
189 'html_allowed_on_front' 192 'frontend_input_type' 197 "is_visible_in_advanced_search",
199 )->addFieldDependence(
207 $form->setValues($attributeObject->getData());
208 $this->propertyLocker->lock($form);
209 return parent::_prepareForm();
getData($key='', $index=null)
__construct(Context $context, Registry $registry, FormFactory $formFactory, Yesno $yesNo, PropertyLocker $propertyLocker, array $data=[])