Magento 2 : Created Custom Product Attribute but Not showing in Configuration Section












4














I Have Created custom attribute for configurable products. It is Showing in Add configurable Product section.
enter image description here



But I Can't get those attributes in below section.



enter image description here



$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute(
MagentoCatalogModelProduct::ENTITY,
'paper_size',
[
'group' => 'Pricing Calculator',
'type' => 'varchar',
'backend' => '',
'frontend' => '',
'sort_order' => 10,
'label' => 'Card Size',
'input' => 'select',
'class' => '',
'source' => 'LtsMultipleDropdownModelConfigSourceOptionssize',
'global' => MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => '',
'searchable' => true,
'filterable' => true,
'comparable' => false,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to'=>'configurable'
]
);









share|improve this question
















bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Show your custom attribute code
    – Priyank
    Apr 3 '17 at 8:41










  • Have you set this attribute in attribute set?
    – Rakesh Jesadiya
    Apr 3 '17 at 9:07










  • custom attribute code added.
    – Somnath Mondal
    Apr 3 '17 at 9:07










  • Custom Attributes are set in Default Attribute Set.
    – Somnath Mondal
    Apr 3 '17 at 9:11










  • are you created product is contains default attribute set?
    – Rakesh Jesadiya
    Apr 3 '17 at 9:14
















4














I Have Created custom attribute for configurable products. It is Showing in Add configurable Product section.
enter image description here



But I Can't get those attributes in below section.



enter image description here



$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute(
MagentoCatalogModelProduct::ENTITY,
'paper_size',
[
'group' => 'Pricing Calculator',
'type' => 'varchar',
'backend' => '',
'frontend' => '',
'sort_order' => 10,
'label' => 'Card Size',
'input' => 'select',
'class' => '',
'source' => 'LtsMultipleDropdownModelConfigSourceOptionssize',
'global' => MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => '',
'searchable' => true,
'filterable' => true,
'comparable' => false,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to'=>'configurable'
]
);









share|improve this question
















bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Show your custom attribute code
    – Priyank
    Apr 3 '17 at 8:41










  • Have you set this attribute in attribute set?
    – Rakesh Jesadiya
    Apr 3 '17 at 9:07










  • custom attribute code added.
    – Somnath Mondal
    Apr 3 '17 at 9:07










  • Custom Attributes are set in Default Attribute Set.
    – Somnath Mondal
    Apr 3 '17 at 9:11










  • are you created product is contains default attribute set?
    – Rakesh Jesadiya
    Apr 3 '17 at 9:14














4












4








4







I Have Created custom attribute for configurable products. It is Showing in Add configurable Product section.
enter image description here



But I Can't get those attributes in below section.



enter image description here



$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute(
MagentoCatalogModelProduct::ENTITY,
'paper_size',
[
'group' => 'Pricing Calculator',
'type' => 'varchar',
'backend' => '',
'frontend' => '',
'sort_order' => 10,
'label' => 'Card Size',
'input' => 'select',
'class' => '',
'source' => 'LtsMultipleDropdownModelConfigSourceOptionssize',
'global' => MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => '',
'searchable' => true,
'filterable' => true,
'comparable' => false,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to'=>'configurable'
]
);









share|improve this question















I Have Created custom attribute for configurable products. It is Showing in Add configurable Product section.
enter image description here



But I Can't get those attributes in below section.



enter image description here



$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute(
MagentoCatalogModelProduct::ENTITY,
'paper_size',
[
'group' => 'Pricing Calculator',
'type' => 'varchar',
'backend' => '',
'frontend' => '',
'sort_order' => 10,
'label' => 'Card Size',
'input' => 'select',
'class' => '',
'source' => 'LtsMultipleDropdownModelConfigSourceOptionssize',
'global' => MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => false,
'default' => '',
'searchable' => true,
'filterable' => true,
'comparable' => false,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to'=>'configurable'
]
);






magento-2.1.3 magento-2.1.4






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 3 '17 at 9:06

























asked Apr 3 '17 at 7:55









Somnath Mondal

2614




2614





bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • Show your custom attribute code
    – Priyank
    Apr 3 '17 at 8:41










  • Have you set this attribute in attribute set?
    – Rakesh Jesadiya
    Apr 3 '17 at 9:07










  • custom attribute code added.
    – Somnath Mondal
    Apr 3 '17 at 9:07










  • Custom Attributes are set in Default Attribute Set.
    – Somnath Mondal
    Apr 3 '17 at 9:11










  • are you created product is contains default attribute set?
    – Rakesh Jesadiya
    Apr 3 '17 at 9:14


















  • Show your custom attribute code
    – Priyank
    Apr 3 '17 at 8:41










  • Have you set this attribute in attribute set?
    – Rakesh Jesadiya
    Apr 3 '17 at 9:07










  • custom attribute code added.
    – Somnath Mondal
    Apr 3 '17 at 9:07










  • Custom Attributes are set in Default Attribute Set.
    – Somnath Mondal
    Apr 3 '17 at 9:11










  • are you created product is contains default attribute set?
    – Rakesh Jesadiya
    Apr 3 '17 at 9:14
















Show your custom attribute code
– Priyank
Apr 3 '17 at 8:41




Show your custom attribute code
– Priyank
Apr 3 '17 at 8:41












Have you set this attribute in attribute set?
– Rakesh Jesadiya
Apr 3 '17 at 9:07




Have you set this attribute in attribute set?
– Rakesh Jesadiya
Apr 3 '17 at 9:07












custom attribute code added.
– Somnath Mondal
Apr 3 '17 at 9:07




custom attribute code added.
– Somnath Mondal
Apr 3 '17 at 9:07












Custom Attributes are set in Default Attribute Set.
– Somnath Mondal
Apr 3 '17 at 9:11




Custom Attributes are set in Default Attribute Set.
– Somnath Mondal
Apr 3 '17 at 9:11












are you created product is contains default attribute set?
– Rakesh Jesadiya
Apr 3 '17 at 9:14




are you created product is contains default attribute set?
– Rakesh Jesadiya
Apr 3 '17 at 9:14










4 Answers
4






active

oldest

votes


















1














1- Please check that Attribute you have created is assigned to the
attribute set.



2- Please run the reindex command



php bin/magento indexer:reindex


3- flush the cache



php bin/magento cache:flush





share|improve this answer





























    1














    Make sure to add the custom attribute to the 'Attribute Set' the configurable product is using.



    You can have different configurable products using different attribute sets. Check the attribute set used for your configurable product here:




    • Catalog -> Product -> [Edit] -> General -> Attribute Set


    Add the custom attribute to the attribute set used by your configurable product here:




    • Store - Attribute Set -> [Edit] -> drag unsigned attributes to the attribute set






    share|improve this answer





























      0














      See how the attribute grid collection is created in



      MagentoConfigurableProductUiDataProviderAttributes::getData



      then MagentoConfigurableProductModelConfigurableAttributeHandler::getApplicableAttributes



      return $collection->addFieldToFilter(
      'frontend_input',
      'select'
      )->addFieldToFilter(
      'is_user_defined',
      1
      )->addFieldToFilter(
      'is_global',
      MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL
      );


      You should set is_user_defined to true.
      (test on Magento 2.2)






      share|improve this answer





























        0














        This will surely work:



        public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
        {

        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        $eavSetup->addAttribute(
        MagentoCatalogModelProduct::ENTITY,
        'paper_size',
        [
        'type' => 'int',
        'backend' => '',
        'frontend' => '',
        'label' => 'Size',
        'input' => 'select',
        'class' => '',
        'source' => '',
        'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_GLOBAL,
        'visible' => true,
        'required' => false,
        'user_defined' => true,
        'default' => 0,
        'searchable' => true,
        'filterable' => true,
        'comparable' => true,
        'visible_on_front' => true,
        'used_in_product_listing' => true,
        'unique' => false,
        'apply_to' => implode(',', [Type::TYPE_SIMPLE, Type::TYPE_VIRTUAL, Configurable::TYPE_CODE]),
        'is_used_in_grid' => true,
        'is_visible_in_grid' => true,
        'is_filterable_in_grid' => true,
        'visible_in_advanced_search' => true
        ]
        );

        }





        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%2f167354%2fmagento-2-created-custom-product-attribute-but-not-showing-in-configuration-se%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          4 Answers
          4






          active

          oldest

          votes








          4 Answers
          4






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          1- Please check that Attribute you have created is assigned to the
          attribute set.



          2- Please run the reindex command



          php bin/magento indexer:reindex


          3- flush the cache



          php bin/magento cache:flush





          share|improve this answer


























            1














            1- Please check that Attribute you have created is assigned to the
            attribute set.



            2- Please run the reindex command



            php bin/magento indexer:reindex


            3- flush the cache



            php bin/magento cache:flush





            share|improve this answer
























              1












              1








              1






              1- Please check that Attribute you have created is assigned to the
              attribute set.



              2- Please run the reindex command



              php bin/magento indexer:reindex


              3- flush the cache



              php bin/magento cache:flush





              share|improve this answer












              1- Please check that Attribute you have created is assigned to the
              attribute set.



              2- Please run the reindex command



              php bin/magento indexer:reindex


              3- flush the cache



              php bin/magento cache:flush






              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered May 23 '17 at 4:46









              Abhinav Singh

              2,007610




              2,007610

























                  1














                  Make sure to add the custom attribute to the 'Attribute Set' the configurable product is using.



                  You can have different configurable products using different attribute sets. Check the attribute set used for your configurable product here:




                  • Catalog -> Product -> [Edit] -> General -> Attribute Set


                  Add the custom attribute to the attribute set used by your configurable product here:




                  • Store - Attribute Set -> [Edit] -> drag unsigned attributes to the attribute set






                  share|improve this answer


























                    1














                    Make sure to add the custom attribute to the 'Attribute Set' the configurable product is using.



                    You can have different configurable products using different attribute sets. Check the attribute set used for your configurable product here:




                    • Catalog -> Product -> [Edit] -> General -> Attribute Set


                    Add the custom attribute to the attribute set used by your configurable product here:




                    • Store - Attribute Set -> [Edit] -> drag unsigned attributes to the attribute set






                    share|improve this answer
























                      1












                      1








                      1






                      Make sure to add the custom attribute to the 'Attribute Set' the configurable product is using.



                      You can have different configurable products using different attribute sets. Check the attribute set used for your configurable product here:




                      • Catalog -> Product -> [Edit] -> General -> Attribute Set


                      Add the custom attribute to the attribute set used by your configurable product here:




                      • Store - Attribute Set -> [Edit] -> drag unsigned attributes to the attribute set






                      share|improve this answer












                      Make sure to add the custom attribute to the 'Attribute Set' the configurable product is using.



                      You can have different configurable products using different attribute sets. Check the attribute set used for your configurable product here:




                      • Catalog -> Product -> [Edit] -> General -> Attribute Set


                      Add the custom attribute to the attribute set used by your configurable product here:




                      • Store - Attribute Set -> [Edit] -> drag unsigned attributes to the attribute set







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Sep 7 '18 at 11:15









                      Rus Dragos

                      268




                      268























                          0














                          See how the attribute grid collection is created in



                          MagentoConfigurableProductUiDataProviderAttributes::getData



                          then MagentoConfigurableProductModelConfigurableAttributeHandler::getApplicableAttributes



                          return $collection->addFieldToFilter(
                          'frontend_input',
                          'select'
                          )->addFieldToFilter(
                          'is_user_defined',
                          1
                          )->addFieldToFilter(
                          'is_global',
                          MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL
                          );


                          You should set is_user_defined to true.
                          (test on Magento 2.2)






                          share|improve this answer


























                            0














                            See how the attribute grid collection is created in



                            MagentoConfigurableProductUiDataProviderAttributes::getData



                            then MagentoConfigurableProductModelConfigurableAttributeHandler::getApplicableAttributes



                            return $collection->addFieldToFilter(
                            'frontend_input',
                            'select'
                            )->addFieldToFilter(
                            'is_user_defined',
                            1
                            )->addFieldToFilter(
                            'is_global',
                            MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL
                            );


                            You should set is_user_defined to true.
                            (test on Magento 2.2)






                            share|improve this answer
























                              0












                              0








                              0






                              See how the attribute grid collection is created in



                              MagentoConfigurableProductUiDataProviderAttributes::getData



                              then MagentoConfigurableProductModelConfigurableAttributeHandler::getApplicableAttributes



                              return $collection->addFieldToFilter(
                              'frontend_input',
                              'select'
                              )->addFieldToFilter(
                              'is_user_defined',
                              1
                              )->addFieldToFilter(
                              'is_global',
                              MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL
                              );


                              You should set is_user_defined to true.
                              (test on Magento 2.2)






                              share|improve this answer












                              See how the attribute grid collection is created in



                              MagentoConfigurableProductUiDataProviderAttributes::getData



                              then MagentoConfigurableProductModelConfigurableAttributeHandler::getApplicableAttributes



                              return $collection->addFieldToFilter(
                              'frontend_input',
                              'select'
                              )->addFieldToFilter(
                              'is_user_defined',
                              1
                              )->addFieldToFilter(
                              'is_global',
                              MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL
                              );


                              You should set is_user_defined to true.
                              (test on Magento 2.2)







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Dec 20 '17 at 11:28









                              Chuongnh

                              392




                              392























                                  0














                                  This will surely work:



                                  public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
                                  {

                                  $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

                                  $eavSetup->addAttribute(
                                  MagentoCatalogModelProduct::ENTITY,
                                  'paper_size',
                                  [
                                  'type' => 'int',
                                  'backend' => '',
                                  'frontend' => '',
                                  'label' => 'Size',
                                  'input' => 'select',
                                  'class' => '',
                                  'source' => '',
                                  'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_GLOBAL,
                                  'visible' => true,
                                  'required' => false,
                                  'user_defined' => true,
                                  'default' => 0,
                                  'searchable' => true,
                                  'filterable' => true,
                                  'comparable' => true,
                                  'visible_on_front' => true,
                                  'used_in_product_listing' => true,
                                  'unique' => false,
                                  'apply_to' => implode(',', [Type::TYPE_SIMPLE, Type::TYPE_VIRTUAL, Configurable::TYPE_CODE]),
                                  'is_used_in_grid' => true,
                                  'is_visible_in_grid' => true,
                                  'is_filterable_in_grid' => true,
                                  'visible_in_advanced_search' => true
                                  ]
                                  );

                                  }





                                  share|improve this answer


























                                    0














                                    This will surely work:



                                    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
                                    {

                                    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

                                    $eavSetup->addAttribute(
                                    MagentoCatalogModelProduct::ENTITY,
                                    'paper_size',
                                    [
                                    'type' => 'int',
                                    'backend' => '',
                                    'frontend' => '',
                                    'label' => 'Size',
                                    'input' => 'select',
                                    'class' => '',
                                    'source' => '',
                                    'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_GLOBAL,
                                    'visible' => true,
                                    'required' => false,
                                    'user_defined' => true,
                                    'default' => 0,
                                    'searchable' => true,
                                    'filterable' => true,
                                    'comparable' => true,
                                    'visible_on_front' => true,
                                    'used_in_product_listing' => true,
                                    'unique' => false,
                                    'apply_to' => implode(',', [Type::TYPE_SIMPLE, Type::TYPE_VIRTUAL, Configurable::TYPE_CODE]),
                                    'is_used_in_grid' => true,
                                    'is_visible_in_grid' => true,
                                    'is_filterable_in_grid' => true,
                                    'visible_in_advanced_search' => true
                                    ]
                                    );

                                    }





                                    share|improve this answer
























                                      0












                                      0








                                      0






                                      This will surely work:



                                      public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
                                      {

                                      $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

                                      $eavSetup->addAttribute(
                                      MagentoCatalogModelProduct::ENTITY,
                                      'paper_size',
                                      [
                                      'type' => 'int',
                                      'backend' => '',
                                      'frontend' => '',
                                      'label' => 'Size',
                                      'input' => 'select',
                                      'class' => '',
                                      'source' => '',
                                      'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_GLOBAL,
                                      'visible' => true,
                                      'required' => false,
                                      'user_defined' => true,
                                      'default' => 0,
                                      'searchable' => true,
                                      'filterable' => true,
                                      'comparable' => true,
                                      'visible_on_front' => true,
                                      'used_in_product_listing' => true,
                                      'unique' => false,
                                      'apply_to' => implode(',', [Type::TYPE_SIMPLE, Type::TYPE_VIRTUAL, Configurable::TYPE_CODE]),
                                      'is_used_in_grid' => true,
                                      'is_visible_in_grid' => true,
                                      'is_filterable_in_grid' => true,
                                      'visible_in_advanced_search' => true
                                      ]
                                      );

                                      }





                                      share|improve this answer












                                      This will surely work:



                                      public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
                                      {

                                      $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

                                      $eavSetup->addAttribute(
                                      MagentoCatalogModelProduct::ENTITY,
                                      'paper_size',
                                      [
                                      'type' => 'int',
                                      'backend' => '',
                                      'frontend' => '',
                                      'label' => 'Size',
                                      'input' => 'select',
                                      'class' => '',
                                      'source' => '',
                                      'global' => MagentoCatalogModelResourceModelEavAttribute::SCOPE_GLOBAL,
                                      'visible' => true,
                                      'required' => false,
                                      'user_defined' => true,
                                      'default' => 0,
                                      'searchable' => true,
                                      'filterable' => true,
                                      'comparable' => true,
                                      'visible_on_front' => true,
                                      'used_in_product_listing' => true,
                                      'unique' => false,
                                      'apply_to' => implode(',', [Type::TYPE_SIMPLE, Type::TYPE_VIRTUAL, Configurable::TYPE_CODE]),
                                      'is_used_in_grid' => true,
                                      'is_visible_in_grid' => true,
                                      'is_filterable_in_grid' => true,
                                      'visible_in_advanced_search' => true
                                      ]
                                      );

                                      }






                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Jul 5 '18 at 14:29









                                      VIPIN A ROY

                                      17013




                                      17013






























                                          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.





                                          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                          Please pay close attention to the following guidance:


                                          • 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%2f167354%2fmagento-2-created-custom-product-attribute-but-not-showing-in-configuration-se%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

                                          1300-talet

                                          1300-talet

                                          Has there ever been an instance of an active nuclear power plant within or near a war zone?