eavSetupFactory = $eavSetupFactory; } public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { $setup->startSetup(); $eavSetup = $this->eavSetupFactory->create(array('setup' => $setup)); $eavSetup->removeAttribute(\Magento\Catalog\Model\Product::ENTITY, 'vente_flash'); $eavSetup->addAttribute( \Magento\Catalog\Model\Product::ENTITY, 'vente_flash_start', [ 'group' => 'Custom Attribute', 'label' => 'Vente flash start', 'type' => 'datetime', 'input' => 'date', 'class' => 'validate-date', 'backend' => 'Magento\Catalog\Model\Attribute\Backend\Startdate', 'required' => false, 'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE, 'visible' => true, 'required' => false, 'user_defined' => true, 'default' => '', 'searchable' => true, 'filterable' => true, 'filterable_in_search' => true, 'visible_in_advanced_search' => true, 'comparable' => false, 'visible_on_front' => false, 'used_in_product_listing' => true, 'unique' => false ] ); $eavSetup->addAttribute( \Magento\Catalog\Model\Product::ENTITY, 'vente_flash_end', [ 'group' => 'Custom Attribute', 'label' => 'Vente flash end', 'type' => 'datetime', 'input' => 'date', 'class' => 'validate-date', 'backend' => 'Magento\Catalog\Model\Attribute\Backend\Startdate', 'required' => false, 'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE, 'visible' => true, 'required' => false, 'user_defined' => true, 'default' => '', 'searchable' => true, 'filterable' => true, 'filterable_in_search' => true, 'visible_in_advanced_search' => true, 'comparable' => false, 'visible_on_front' => false, 'used_in_product_listing' => true, 'unique' => false ] ); $setup->endSetup(); } }