moduleDataSetup = $moduleDataSetup; $this->eavSetupFactory = $eavSetupFactory; } /** * {@inheritdoc} */ public function apply() { /** @var EavSetup $eavSetup */ $eavSetup = $this->eavSetupFactory->create(['setup' => $this->moduleDataSetup]); /** * Install eav entity types to the eav/entity_type table */ $eavSetup->addAttribute( 'catalog_product', 'swatch_image', [ 'type' => 'varchar', 'label' => 'Swatch', 'input' => 'media_image', 'frontend' => Image::class, 'required' => false, 'sort_order' => 3, 'global' => ScopedAttributeInterface::SCOPE_STORE, 'used_in_product_listing' => true ] ); } /** * {@inheritdoc} */ public static function getDependencies() { return []; } /** * {@inheritdoc} */ public static function getVersion() { return '2.0.0'; } /** * {@inheritdoc} */ public function getAliases() { return []; } }