Create product custom image attribute module in magento2.1.9Create a sortable and filterable custom attribute to stand-alone entityHow to create an image upload product attribute in magento?How to “reload” a custom module after code changesmain.CRITICAL: Plugin class doesn't existMagento 2 add custom product attribute validation from install scriptMagento 2 Add new field to Magento_User admin formMagento 2.2.1: Add Custom Upload file attribute in CheckoutCustom backend model for multiselect attributes causes exceptionMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?How to change “input file” storage location in customer account edit form

Is refreshing multiple times a test case for web applications?

Performance of a branch and bound algorithm VS branch-cut-heuristics

Could one become a successful researcher by writing some really good papers while being outside academia?

Is it really ~648.69 km/s delta-v to "land" on the surface of the Sun?

Does this Foo machine halt?

English - Acceptable use of parentheses in an author's name

Why should we care about syntactic proofs if we can show semantically that statements are true?

How many different ways are there to checkmate in the early game?

How can you evade tax by getting employment income just in equity, then using this equity as collateral to take out loan?

How do I explain to a team that the project they will work on for six months will certainly be cancelled?

What word can be used to describe a bug in a movie?

How do we avoid CI-driven development...?

How can I iterate this process?

In Pokémon Go, why does one of my Pikachu have an option to evolve, but another one doesn't?

Ex-contractor published company source code and secrets online

During the Space Shuttle Columbia Disaster of 2003, Why Did The Flight Director Say, "Lock the doors."?

Am I overreacting to my team leader's unethical requests?

Non-OR journals which regularly publish OR research

What are the uses and limitations of Persuasion, Insight, and Deception against other PCs?

Table content alignment to centre using tabular

Can I legally make a real mobile app based on a fictional app from a TV show?

TColorBox and Tikz, arrows are not on the diagram

Left switch on gang light pair not getting power

Unique combinations of a list of tuples



Create product custom image attribute module in magento2.1.9


Create a sortable and filterable custom attribute to stand-alone entityHow to create an image upload product attribute in magento?How to “reload” a custom module after code changesmain.CRITICAL: Plugin class doesn't existMagento 2 add custom product attribute validation from install scriptMagento 2 Add new field to Magento_User admin formMagento 2.2.1: Add Custom Upload file attribute in CheckoutCustom backend model for multiselect attributes causes exceptionMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?How to change “input file” storage location in customer account edit form






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















How to write the custom image attribute I do not know please help me out. I used below code but in backend form field showing but image functionality not working.



In product_form.php:



<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<fieldset name="file_uploader_attribute_fieldset">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="label" xsi:type="string" translate="true">Slider Images</item>
<item name="collapsible" xsi:type="boolean">true</item>
<item name="opened" xsi:type="boolean">true</item>
<item name="sortOrder" xsi:type="string">2</item>
<item name="canShow" xsi:type="boolean">true</item>
<item name="componentType" xsi:type="string">fieldset</item>
</item>
</argument>

<field name="custom_image2">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="dataType" xsi:type="string">string</item>
<!-- <item name="source" xsi:type="string">category</item>-->
<item name="label" xsi:type="string" translate="true">Custom Image2</item>
<item name="visible" xsi:type="boolean">true</item>
<item name="formElement" xsi:type="string">fileUploader</item>
<item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
<item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item>
<item name="required" xsi:type="boolean">false</item>
<item name="sortOrder" xsi:type="number">40</item>
<item name="uploaderConfig" xsi:type="array">
<item name="url" xsi:type="url" path="module/catelog_image/upload"/>
</item>
</item>
</argument>
</field>
<field name="custom_image1">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="dataType" xsi:type="string">string</item>
<!-- <item name="source" xsi:type="string">category</item>-->
<item name="label" xsi:type="string" translate="true">Custom Image1</item>
<item name="visible" xsi:type="boolean">true</item>
<item name="formElement" xsi:type="string">fileUploader</item>
<item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
<item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item>
<item name="required" xsi:type="boolean">false</item>
<item name="sortOrder" xsi:type="number">40</item>
<item name="uploaderConfig" xsi:type="array">
<item name="url" xsi:type="url" path="module/catelog_image/upload"/>
</item>
</item>
</argument>
</field>

</fieldset>
</form>


And installData.php used this code:



<?php

namespace RokanthemesImageSlidingSetup;
use MagentoEavSetupEavSetup;
use MagentoEavSetupEavSetupFactory /* For Attribute create */;
use MagentoFrameworkSetupInstallDataInterface;
use MagentoFrameworkSetupModuleContextInterface;
use MagentoFrameworkSetupModuleDataSetupInterface;

class InstallData implements InstallDataInterface
/**
* EAV setup factory
*
* @var EavSetupFactory
*/
private $_eavSetupFactory;

/**
* Init
*
* @param EavSetupFactory $eavSetupFactory
*/
public function __construct(EavSetupFactory $eavSetupFactory)
$this->_eavSetupFactory = $eavSetupFactory;


public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
/** @var EavSetup $eavSetup */
$eavSetup = $this->_eavSetupFactory->create(['setup' => $setup]);

/**
* Add attributes to the eav/attribute
*/
$eavSetup->addAttribute(
MagentoCatalogModelProduct::ENTITY, 'custom_image1', [
'type' => 'varchar',
'backend' => 'RokanthemesImageSlidingModelAttributeProductImage', //'RokanthemesImageSlidingModelAttributeProductImage',
'frontend' => '',
'label' => 'custom image1',
'input' => 'image',
'class' => '',
'source' => '',
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => 0,
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to' => ''
]
);
$eavSetup->addAttribute(
MagentoCatalogModelProduct::ENTITY, 'custom_image2', [
'type' => 'varchar',
'backend' => 'RokanthemesImageSlidingModelAttributeProductImage', //'RokanthemesImageSlidingModelAttributeProductImage',
'frontend' => '',
'label' => 'custom image2',
'input' => 'image',
'class' => '',
'source' => '',
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => 0,
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to' => ''
]
);





Please help me. Very new to Magento










share|improve this question
































    0















    How to write the custom image attribute I do not know please help me out. I used below code but in backend form field showing but image functionality not working.



    In product_form.php:



    <form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="file_uploader_attribute_fieldset">
    <argument name="data" xsi:type="array">
    <item name="config" xsi:type="array">
    <item name="label" xsi:type="string" translate="true">Slider Images</item>
    <item name="collapsible" xsi:type="boolean">true</item>
    <item name="opened" xsi:type="boolean">true</item>
    <item name="sortOrder" xsi:type="string">2</item>
    <item name="canShow" xsi:type="boolean">true</item>
    <item name="componentType" xsi:type="string">fieldset</item>
    </item>
    </argument>

    <field name="custom_image2">
    <argument name="data" xsi:type="array">
    <item name="config" xsi:type="array">
    <item name="dataType" xsi:type="string">string</item>
    <!-- <item name="source" xsi:type="string">category</item>-->
    <item name="label" xsi:type="string" translate="true">Custom Image2</item>
    <item name="visible" xsi:type="boolean">true</item>
    <item name="formElement" xsi:type="string">fileUploader</item>
    <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
    <item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item>
    <item name="required" xsi:type="boolean">false</item>
    <item name="sortOrder" xsi:type="number">40</item>
    <item name="uploaderConfig" xsi:type="array">
    <item name="url" xsi:type="url" path="module/catelog_image/upload"/>
    </item>
    </item>
    </argument>
    </field>
    <field name="custom_image1">
    <argument name="data" xsi:type="array">
    <item name="config" xsi:type="array">
    <item name="dataType" xsi:type="string">string</item>
    <!-- <item name="source" xsi:type="string">category</item>-->
    <item name="label" xsi:type="string" translate="true">Custom Image1</item>
    <item name="visible" xsi:type="boolean">true</item>
    <item name="formElement" xsi:type="string">fileUploader</item>
    <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
    <item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item>
    <item name="required" xsi:type="boolean">false</item>
    <item name="sortOrder" xsi:type="number">40</item>
    <item name="uploaderConfig" xsi:type="array">
    <item name="url" xsi:type="url" path="module/catelog_image/upload"/>
    </item>
    </item>
    </argument>
    </field>

    </fieldset>
    </form>


    And installData.php used this code:



    <?php

    namespace RokanthemesImageSlidingSetup;
    use MagentoEavSetupEavSetup;
    use MagentoEavSetupEavSetupFactory /* For Attribute create */;
    use MagentoFrameworkSetupInstallDataInterface;
    use MagentoFrameworkSetupModuleContextInterface;
    use MagentoFrameworkSetupModuleDataSetupInterface;

    class InstallData implements InstallDataInterface
    /**
    * EAV setup factory
    *
    * @var EavSetupFactory
    */
    private $_eavSetupFactory;

    /**
    * Init
    *
    * @param EavSetupFactory $eavSetupFactory
    */
    public function __construct(EavSetupFactory $eavSetupFactory)
    $this->_eavSetupFactory = $eavSetupFactory;


    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    /** @var EavSetup $eavSetup */
    $eavSetup = $this->_eavSetupFactory->create(['setup' => $setup]);

    /**
    * Add attributes to the eav/attribute
    */
    $eavSetup->addAttribute(
    MagentoCatalogModelProduct::ENTITY, 'custom_image1', [
    'type' => 'varchar',
    'backend' => 'RokanthemesImageSlidingModelAttributeProductImage', //'RokanthemesImageSlidingModelAttributeProductImage',
    'frontend' => '',
    'label' => 'custom image1',
    'input' => 'image',
    'class' => '',
    'source' => '',
    'visible' => true,
    'required' => false,
    'user_defined' => false,
    'default' => 0,
    'searchable' => false,
    'filterable' => false,
    'comparable' => false,
    'visible_on_front' => true,
    'used_in_product_listing' => true,
    'unique' => false,
    'apply_to' => ''
    ]
    );
    $eavSetup->addAttribute(
    MagentoCatalogModelProduct::ENTITY, 'custom_image2', [
    'type' => 'varchar',
    'backend' => 'RokanthemesImageSlidingModelAttributeProductImage', //'RokanthemesImageSlidingModelAttributeProductImage',
    'frontend' => '',
    'label' => 'custom image2',
    'input' => 'image',
    'class' => '',
    'source' => '',
    'visible' => true,
    'required' => false,
    'user_defined' => false,
    'default' => 0,
    'searchable' => false,
    'filterable' => false,
    'comparable' => false,
    'visible_on_front' => true,
    'used_in_product_listing' => true,
    'unique' => false,
    'apply_to' => ''
    ]
    );





    Please help me. Very new to Magento










    share|improve this question




























      0












      0








      0








      How to write the custom image attribute I do not know please help me out. I used below code but in backend form field showing but image functionality not working.



      In product_form.php:



      <form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
      <fieldset name="file_uploader_attribute_fieldset">
      <argument name="data" xsi:type="array">
      <item name="config" xsi:type="array">
      <item name="label" xsi:type="string" translate="true">Slider Images</item>
      <item name="collapsible" xsi:type="boolean">true</item>
      <item name="opened" xsi:type="boolean">true</item>
      <item name="sortOrder" xsi:type="string">2</item>
      <item name="canShow" xsi:type="boolean">true</item>
      <item name="componentType" xsi:type="string">fieldset</item>
      </item>
      </argument>

      <field name="custom_image2">
      <argument name="data" xsi:type="array">
      <item name="config" xsi:type="array">
      <item name="dataType" xsi:type="string">string</item>
      <!-- <item name="source" xsi:type="string">category</item>-->
      <item name="label" xsi:type="string" translate="true">Custom Image2</item>
      <item name="visible" xsi:type="boolean">true</item>
      <item name="formElement" xsi:type="string">fileUploader</item>
      <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
      <item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item>
      <item name="required" xsi:type="boolean">false</item>
      <item name="sortOrder" xsi:type="number">40</item>
      <item name="uploaderConfig" xsi:type="array">
      <item name="url" xsi:type="url" path="module/catelog_image/upload"/>
      </item>
      </item>
      </argument>
      </field>
      <field name="custom_image1">
      <argument name="data" xsi:type="array">
      <item name="config" xsi:type="array">
      <item name="dataType" xsi:type="string">string</item>
      <!-- <item name="source" xsi:type="string">category</item>-->
      <item name="label" xsi:type="string" translate="true">Custom Image1</item>
      <item name="visible" xsi:type="boolean">true</item>
      <item name="formElement" xsi:type="string">fileUploader</item>
      <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
      <item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item>
      <item name="required" xsi:type="boolean">false</item>
      <item name="sortOrder" xsi:type="number">40</item>
      <item name="uploaderConfig" xsi:type="array">
      <item name="url" xsi:type="url" path="module/catelog_image/upload"/>
      </item>
      </item>
      </argument>
      </field>

      </fieldset>
      </form>


      And installData.php used this code:



      <?php

      namespace RokanthemesImageSlidingSetup;
      use MagentoEavSetupEavSetup;
      use MagentoEavSetupEavSetupFactory /* For Attribute create */;
      use MagentoFrameworkSetupInstallDataInterface;
      use MagentoFrameworkSetupModuleContextInterface;
      use MagentoFrameworkSetupModuleDataSetupInterface;

      class InstallData implements InstallDataInterface
      /**
      * EAV setup factory
      *
      * @var EavSetupFactory
      */
      private $_eavSetupFactory;

      /**
      * Init
      *
      * @param EavSetupFactory $eavSetupFactory
      */
      public function __construct(EavSetupFactory $eavSetupFactory)
      $this->_eavSetupFactory = $eavSetupFactory;


      public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
      /** @var EavSetup $eavSetup */
      $eavSetup = $this->_eavSetupFactory->create(['setup' => $setup]);

      /**
      * Add attributes to the eav/attribute
      */
      $eavSetup->addAttribute(
      MagentoCatalogModelProduct::ENTITY, 'custom_image1', [
      'type' => 'varchar',
      'backend' => 'RokanthemesImageSlidingModelAttributeProductImage', //'RokanthemesImageSlidingModelAttributeProductImage',
      'frontend' => '',
      'label' => 'custom image1',
      'input' => 'image',
      'class' => '',
      'source' => '',
      'visible' => true,
      'required' => false,
      'user_defined' => false,
      'default' => 0,
      'searchable' => false,
      'filterable' => false,
      'comparable' => false,
      'visible_on_front' => true,
      'used_in_product_listing' => true,
      'unique' => false,
      'apply_to' => ''
      ]
      );
      $eavSetup->addAttribute(
      MagentoCatalogModelProduct::ENTITY, 'custom_image2', [
      'type' => 'varchar',
      'backend' => 'RokanthemesImageSlidingModelAttributeProductImage', //'RokanthemesImageSlidingModelAttributeProductImage',
      'frontend' => '',
      'label' => 'custom image2',
      'input' => 'image',
      'class' => '',
      'source' => '',
      'visible' => true,
      'required' => false,
      'user_defined' => false,
      'default' => 0,
      'searchable' => false,
      'filterable' => false,
      'comparable' => false,
      'visible_on_front' => true,
      'used_in_product_listing' => true,
      'unique' => false,
      'apply_to' => ''
      ]
      );





      Please help me. Very new to Magento










      share|improve this question
















      How to write the custom image attribute I do not know please help me out. I used below code but in backend form field showing but image functionality not working.



      In product_form.php:



      <form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
      <fieldset name="file_uploader_attribute_fieldset">
      <argument name="data" xsi:type="array">
      <item name="config" xsi:type="array">
      <item name="label" xsi:type="string" translate="true">Slider Images</item>
      <item name="collapsible" xsi:type="boolean">true</item>
      <item name="opened" xsi:type="boolean">true</item>
      <item name="sortOrder" xsi:type="string">2</item>
      <item name="canShow" xsi:type="boolean">true</item>
      <item name="componentType" xsi:type="string">fieldset</item>
      </item>
      </argument>

      <field name="custom_image2">
      <argument name="data" xsi:type="array">
      <item name="config" xsi:type="array">
      <item name="dataType" xsi:type="string">string</item>
      <!-- <item name="source" xsi:type="string">category</item>-->
      <item name="label" xsi:type="string" translate="true">Custom Image2</item>
      <item name="visible" xsi:type="boolean">true</item>
      <item name="formElement" xsi:type="string">fileUploader</item>
      <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
      <item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item>
      <item name="required" xsi:type="boolean">false</item>
      <item name="sortOrder" xsi:type="number">40</item>
      <item name="uploaderConfig" xsi:type="array">
      <item name="url" xsi:type="url" path="module/catelog_image/upload"/>
      </item>
      </item>
      </argument>
      </field>
      <field name="custom_image1">
      <argument name="data" xsi:type="array">
      <item name="config" xsi:type="array">
      <item name="dataType" xsi:type="string">string</item>
      <!-- <item name="source" xsi:type="string">category</item>-->
      <item name="label" xsi:type="string" translate="true">Custom Image1</item>
      <item name="visible" xsi:type="boolean">true</item>
      <item name="formElement" xsi:type="string">fileUploader</item>
      <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
      <item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item>
      <item name="required" xsi:type="boolean">false</item>
      <item name="sortOrder" xsi:type="number">40</item>
      <item name="uploaderConfig" xsi:type="array">
      <item name="url" xsi:type="url" path="module/catelog_image/upload"/>
      </item>
      </item>
      </argument>
      </field>

      </fieldset>
      </form>


      And installData.php used this code:



      <?php

      namespace RokanthemesImageSlidingSetup;
      use MagentoEavSetupEavSetup;
      use MagentoEavSetupEavSetupFactory /* For Attribute create */;
      use MagentoFrameworkSetupInstallDataInterface;
      use MagentoFrameworkSetupModuleContextInterface;
      use MagentoFrameworkSetupModuleDataSetupInterface;

      class InstallData implements InstallDataInterface
      /**
      * EAV setup factory
      *
      * @var EavSetupFactory
      */
      private $_eavSetupFactory;

      /**
      * Init
      *
      * @param EavSetupFactory $eavSetupFactory
      */
      public function __construct(EavSetupFactory $eavSetupFactory)
      $this->_eavSetupFactory = $eavSetupFactory;


      public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
      /** @var EavSetup $eavSetup */
      $eavSetup = $this->_eavSetupFactory->create(['setup' => $setup]);

      /**
      * Add attributes to the eav/attribute
      */
      $eavSetup->addAttribute(
      MagentoCatalogModelProduct::ENTITY, 'custom_image1', [
      'type' => 'varchar',
      'backend' => 'RokanthemesImageSlidingModelAttributeProductImage', //'RokanthemesImageSlidingModelAttributeProductImage',
      'frontend' => '',
      'label' => 'custom image1',
      'input' => 'image',
      'class' => '',
      'source' => '',
      'visible' => true,
      'required' => false,
      'user_defined' => false,
      'default' => 0,
      'searchable' => false,
      'filterable' => false,
      'comparable' => false,
      'visible_on_front' => true,
      'used_in_product_listing' => true,
      'unique' => false,
      'apply_to' => ''
      ]
      );
      $eavSetup->addAttribute(
      MagentoCatalogModelProduct::ENTITY, 'custom_image2', [
      'type' => 'varchar',
      'backend' => 'RokanthemesImageSlidingModelAttributeProductImage', //'RokanthemesImageSlidingModelAttributeProductImage',
      'frontend' => '',
      'label' => 'custom image2',
      'input' => 'image',
      'class' => '',
      'source' => '',
      'visible' => true,
      'required' => false,
      'user_defined' => false,
      'default' => 0,
      'searchable' => false,
      'filterable' => false,
      'comparable' => false,
      'visible_on_front' => true,
      'used_in_product_listing' => true,
      'unique' => false,
      'apply_to' => ''
      ]
      );





      Please help me. Very new to Magento







      magento2 attributes






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jul 31 at 4:50









      Mohit Rane

      1,20918 bronze badges




      1,20918 bronze badges










      asked Nov 21 '17 at 8:52









      ganeshganesh

      1




      1























          1 Answer
          1






          active

          oldest

          votes


















          0














          Try to replace varchar to file:



          $eavSetup->addAttribute(
          MagentoCatalogModelProduct::ENTITY, 'custom_image1', [
          'type' => 'file',
          'backend' => 'RokanthemesImageSlidingModelAttributeProductImage', //'RokanthemesImageSlidingModelAttributeProductImage',
          'frontend' => '',
          'label' => 'custom image1',
          'input' => 'image',
          'class' => '',
          'source' => '',
          'visible' => true,
          'required' => false,
          'user_defined' => false,
          'default' => 0,
          'searchable' => false,
          'filterable' => false,
          'comparable' => false,
          'visible_on_front' => true,
          'used_in_product_listing' => true,
          'unique' => false,
          'apply_to' => ''
          ]
          );





          share|improve this answer



























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f202494%2fcreate-product-custom-image-attribute-module-in-magento2-1-9%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Try to replace varchar to file:



            $eavSetup->addAttribute(
            MagentoCatalogModelProduct::ENTITY, 'custom_image1', [
            'type' => 'file',
            'backend' => 'RokanthemesImageSlidingModelAttributeProductImage', //'RokanthemesImageSlidingModelAttributeProductImage',
            'frontend' => '',
            'label' => 'custom image1',
            'input' => 'image',
            'class' => '',
            'source' => '',
            'visible' => true,
            'required' => false,
            'user_defined' => false,
            'default' => 0,
            'searchable' => false,
            'filterable' => false,
            'comparable' => false,
            'visible_on_front' => true,
            'used_in_product_listing' => true,
            'unique' => false,
            'apply_to' => ''
            ]
            );





            share|improve this answer





























              0














              Try to replace varchar to file:



              $eavSetup->addAttribute(
              MagentoCatalogModelProduct::ENTITY, 'custom_image1', [
              'type' => 'file',
              'backend' => 'RokanthemesImageSlidingModelAttributeProductImage', //'RokanthemesImageSlidingModelAttributeProductImage',
              'frontend' => '',
              'label' => 'custom image1',
              'input' => 'image',
              'class' => '',
              'source' => '',
              'visible' => true,
              'required' => false,
              'user_defined' => false,
              'default' => 0,
              'searchable' => false,
              'filterable' => false,
              'comparable' => false,
              'visible_on_front' => true,
              'used_in_product_listing' => true,
              'unique' => false,
              'apply_to' => ''
              ]
              );





              share|improve this answer



























                0












                0








                0







                Try to replace varchar to file:



                $eavSetup->addAttribute(
                MagentoCatalogModelProduct::ENTITY, 'custom_image1', [
                'type' => 'file',
                'backend' => 'RokanthemesImageSlidingModelAttributeProductImage', //'RokanthemesImageSlidingModelAttributeProductImage',
                'frontend' => '',
                'label' => 'custom image1',
                'input' => 'image',
                'class' => '',
                'source' => '',
                'visible' => true,
                'required' => false,
                'user_defined' => false,
                'default' => 0,
                'searchable' => false,
                'filterable' => false,
                'comparable' => false,
                'visible_on_front' => true,
                'used_in_product_listing' => true,
                'unique' => false,
                'apply_to' => ''
                ]
                );





                share|improve this answer













                Try to replace varchar to file:



                $eavSetup->addAttribute(
                MagentoCatalogModelProduct::ENTITY, 'custom_image1', [
                'type' => 'file',
                'backend' => 'RokanthemesImageSlidingModelAttributeProductImage', //'RokanthemesImageSlidingModelAttributeProductImage',
                'frontend' => '',
                'label' => 'custom image1',
                'input' => 'image',
                'class' => '',
                'source' => '',
                'visible' => true,
                'required' => false,
                'user_defined' => false,
                'default' => 0,
                'searchable' => false,
                'filterable' => false,
                'comparable' => false,
                'visible_on_front' => true,
                'used_in_product_listing' => true,
                'unique' => false,
                'apply_to' => ''
                ]
                );






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 21 '17 at 9:07









                Nero PhungNero Phung

                9301 gold badge8 silver badges20 bronze badges




                9301 gold badge8 silver badges20 bronze badges






























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f202494%2fcreate-product-custom-image-attribute-module-in-magento2-1-9%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

                    Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?