Exemple #1
0
 /**
  * @param \Magento\Framework\Data\Form\Element\Factory $factoryElement
  * @param \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection
  * @param \Magento\Framework\Escaper $escaper
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param \Magento\Framework\Locale\CurrencyInterface $localeCurrency
  * @param \Magento\Tax\Helper\Data $taxData
  * @param array $data
  */
 public function __construct(\Magento\Framework\Data\Form\Element\Factory $factoryElement, \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection, \Magento\Framework\Escaper $escaper, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Locale\CurrencyInterface $localeCurrency, \Magento\Tax\Helper\Data $taxData, array $data = [])
 {
     $this->_localeCurrency = $localeCurrency;
     $this->_storeManager = $storeManager;
     $this->_taxData = $taxData;
     parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
 }
Exemple #2
0
 /**
  * @param \Magento\Framework\Data\Form\Element\Factory $factoryElement
  * @param \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection
  * @param \Magento\Framework\Escaper $escaper
  * @param \Magento\Catalog\Helper\Product $helper
  * @param array $data
  */
 public function __construct(\Magento\Framework\Data\Form\Element\Factory $factoryElement, \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection, \Magento\Framework\Escaper $escaper, \Magento\Catalog\Helper\Product $helper, array $data = [])
 {
     $this->_helper = $helper;
     $this->_virtual = $factoryElement->create('checkbox');
     $this->_virtual->setId(self::VIRTUAL_FIELD_HTML_ID)->setName('is_virtual')->setLabel($this->_helper->getTypeSwitcherControlLabel());
     $data['class'] = 'validate-number validate-zero-or-greater validate-number-range number-range-0-99999999.9999';
     parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
 }
Exemple #3
0
 /**
  * @param \Magento\Framework\Data\Form\Element\Factory $factoryElement
  * @param \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection
  * @param \Magento\Framework\Escaper $escaper
  * @param \Magento\Framework\Locale\Format $localeFormat
  * @param \Magento\Directory\Helper\Data $directoryHelper
  * @param array $data
  */
 public function __construct(\Magento\Framework\Data\Form\Element\Factory $factoryElement, \Magento\Framework\Data\Form\Element\CollectionFactory $factoryCollection, \Magento\Framework\Escaper $escaper, \Magento\Framework\Locale\Format $localeFormat, \Magento\Directory\Helper\Data $directoryHelper, array $data = [])
 {
     $this->directoryHelper = $directoryHelper;
     $this->localeFormat = $localeFormat;
     $this->weightSwitcher = $factoryElement->create('radios');
     $this->weightSwitcher->setValue(WeightResolver::HAS_WEIGHT)->setValues([['value' => WeightResolver::HAS_WEIGHT, 'label' => __('Yes')], ['value' => WeightResolver::HAS_NO_WEIGHT, 'label' => __('No')]])->setId('weight-switcher')->setName('product_has_weight')->setLabel(__('Does this have a weight?'));
     parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
     $this->addClass('validate-zero-or-greater');
 }