/**
  * @param Front $subject
  * @param callable $proceed
  * @param Form $form
  * @return Front
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function aroundSetForm(Front $subject, \Closure $proceed, Form $form)
 {
     $block = $proceed($form);
     /** @var Fieldset $fieldset */
     $fieldset = $form->getElement('front_fieldset');
     $fieldset->addField('search_weight', 'select', ['name' => 'search_weight', 'label' => __('Search Weight'), 'values' => $this->weightSource->getOptions()], 'is_searchable');
     $subject->getChildBlock('form_after')->addFieldMap('search_weight', 'search_weight')->addFieldDependence('search_weight', 'searchable', '1');
     return $block;
 }
 /**
  * @param FrontTab $subject
  * @param callable $proceed
  * @param Form $form
  * @return Front
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  */
 public function aroundSetForm(FrontTab $subject, \Closure $proceed, Form $form)
 {
     $block = $proceed($form);
     /** @var Fieldset $fieldset */
     $fieldset = $form->getElement('front_fieldset');
     $fieldset->addField('advanced_search_store_ids', 'multiselect', ['name' => 'advanced_search_store_ids[]', 'label' => __('Advanced Search Store(s)'), 'title' => __('Advanced Search Store(s)'), 'value' => 0, 'values' => $this->_systemStore->getStoreValuesForForm(false, true)], 'is_visible_in_advanced_search');
     $subject->getChildBlock('form_after')->addFieldMap('advanced_search_store_ids', 'advanced_search_store_ids')->addFieldDependence('advanced_search_store_ids', 'advanced_search', '1')->addFieldDependence('advanced_search_store_ids', 'searchable', '1');
     return $block;
 }
Example #3
0
 /**
  * @param $attributeCode
  * @dataProvider toHtmlDataProvider
  */
 public function testToHtml($attributeCode)
 {
     /** @var \Magento\Catalog\Model\Resource\Eav\Attribute $model */
     $model = $this->objectManager->create('Magento\\Catalog\\Model\\Resource\\Eav\\Attribute');
     $model->loadByCode(\Magento\Catalog\Model\Product::ENTITY, $attributeCode);
     /** @var \Magento\Framework\Registry $coreRegistry */
     $coreRegistry = $this->objectManager->get('\\Magento\\Framework\\Registry');
     $coreRegistry->unregister('entity_attribute');
     $coreRegistry->register('entity_attribute', $model);
     $this->assertRegExp('/<select\\sid="is_searchable".*disabled="disabled"/', $this->block->toHtml());
 }
Example #4
0
 /**
  * {@inheritdoc}
  */
 public function setForm(\Magento\Framework\Data\Form $form)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'setForm');
     if (!$pluginInfo) {
         return parent::setForm($form);
     } else {
         return $this->___callPlugins('setForm', func_get_args(), $pluginInfo);
     }
 }
Example #5
0
 /**
  * Append the "Slider Display Configuration" fieldset to the tab.
  *
  * @param Form  $form    Target form.
  * @param Front $subject Target tab.
  *
  * @return Fieldset
  */
 private function createDisplayFieldset(Form $form, Front $subject)
 {
     $fieldset = $form->addFieldset('elasticsuite_catalog_attribute_display_fieldset', ['legend' => __('Slider Display Configuration'), 'collapsable' => $subject->getRequest()->has('popup')], 'elasticsuite_catalog_attribute_fieldset');
     return $fieldset;
 }