How to add customer new entity type and customer new fieldhow can we display data from database for all field form custom table in magento?Custom field for new order new customerHow can I add new custom field into customer form and then save it into database in MagentoHow to make state/company field in new customer creation required from admin panel?Set custom field value in customer registrationhow to add an additional field in the client panel / during registrationMagento 2 :- How can i add tab in customer group?How can I split one customer import field on CSV to 2 Magento fields?Magento2 display Fax and Is Active attributes in admin customer edit formHow to display created dynamic attibute into the customer array?

Minimizing with differential evolution

Why do we say ‘pairwise disjoint’, rather than ‘disjoint’?

How does Ehrenfest's theorem apply to the quantum harmonic oscillator?

Why do phishing e-mails use faked e-mail addresses instead of the real one?

Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?

Was it really inappropriate to write a pull request for the company I interviewed with?

Create chunks from an array

Does "Until when" sound natural for native speakers?

What is better: yes / no radio, or simple checkbox?

After `ssh` without `-X` to a machine, is it possible to change `$DISPLAY` to make it work like `ssh -X`?

What is Tony Stark injecting into himself in Iron Man 3?

Conservation of Mass and Energy

Power Strip for Europe

Is a piano played in the same way as a harmonium?

What do you call someone who likes to pick fights?

Can I use a violin G string for D?

Can I negotiate a patent idea for a raise, under French law?

Plausibility of Mushroom Buildings

When a wind turbine does not produce enough electricity how does the power company compensate for the loss?

How do spaceships determine each other's mass in space?

Can one live in the U.S. and not use a credit card?

How to draw dashed arc of a circle behind pyramid?

Windows Server Datacenter Edition - Unlimited Virtual Machines

Confusion about Complex Continued Fraction



How to add customer new entity type and customer new field


how can we display data from database for all field form custom table in magento?Custom field for new order new customerHow can I add new custom field into customer form and then save it into database in MagentoHow to make state/company field in new customer creation required from admin panel?Set custom field value in customer registrationhow to add an additional field in the client panel / during registrationMagento 2 :- How can i add tab in customer group?How can I split one customer import field on CSV to 2 Magento fields?Magento2 display Fax and Is Active attributes in admin customer edit formHow to display created dynamic attibute into the customer array?













0















I want to create a new tab name as "Preference" in customer dashboard and also admin side customer edit page.
I successfully created new tab both side(means Admin and frontend).



Can any one suggest me how to create a two new field and display field in "preference tab" for both side and how i can add, edit field value.










share|improve this question




























    0















    I want to create a new tab name as "Preference" in customer dashboard and also admin side customer edit page.
    I successfully created new tab both side(means Admin and frontend).



    Can any one suggest me how to create a two new field and display field in "preference tab" for both side and how i can add, edit field value.










    share|improve this question


























      0












      0








      0








      I want to create a new tab name as "Preference" in customer dashboard and also admin side customer edit page.
      I successfully created new tab both side(means Admin and frontend).



      Can any one suggest me how to create a two new field and display field in "preference tab" for both side and how i can add, edit field value.










      share|improve this question
















      I want to create a new tab name as "Preference" in customer dashboard and also admin side customer edit page.
      I successfully created new tab both side(means Admin and frontend).



      Can any one suggest me how to create a two new field and display field in "preference tab" for both side and how i can add, edit field value.







      magento-1.7 customer






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 28 mins ago









      Teja Bhagavan Kollepara

      2,98641947




      2,98641947










      asked Nov 29 '13 at 6:28









      krutikruti

      13317




      13317




















          1 Answer
          1






          active

          oldest

          votes


















          1














          Lifted from:



          • https://stackoverflow.com/questions/5961290/adding-attributes-to-customer-entity/5962237#5962237


          This is the code for a basic int attribute with text renderer:



          $installer = $this;
          $installer->startSetup();

          $setup = new Mage_Eav_Model_Entity_Setup('core_setup');

          $entityTypeId = $setup->getEntityTypeId('customer');
          $attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
          $attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);

          $setup->addAttribute('customer', 'your_attribute_code_here', array(
          'input' => 'text',
          'type' => 'int',
          'label' => 'Some textual description',
          'visible' => 1,
          'required' => 0,
          'user_defined' => 1,
          ));

          $setup->addAttributeToGroup(
          $entityTypeId,
          $attributeSetId,
          $attributeGroupId,
          'your_attribute_code_here',
          '999' //sort_order
          );

          $oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'your_attribute_code_here');
          $oAttribute->setData('used_in_forms', array('adminhtml_customer'));
          $oAttribute->save();

          $setup->endSetup();


          The unusual step for adding attributes is the setData('used_in_forms') this seems to be unique to customer attributes. Without it, the field won't get rendered, certainly not in the adminhtml anyway. You can see the valid options for this array in the customer_form_attribute database table.



          In terms of using a select with predefined options, this is what you need:



          $iAttributeId = $installer->getAttributeId($entityTypeId, 'your_attribute_code_here');
          $aClasses = array('TV','DVD','Home Theatre','Air Conditioner','Stereo/Hifi','Game Console','Camcorder','VCR','Set Top Box','PVR');
          $aOption = array();
          $aOption['attribute_id'] = $iAttributeId;

          for($iCount=0;$iCount<sizeof($aClasses);$iCount++)
          $aOption['value']['option'.$iCount][0] = $aClasses[$iCount];

          $setup->addAttributeOption($aOption);


          And here is a walk-through on using a custom source for your drop-down



          Hope this helps,

          JD






          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%2f11324%2fhow-to-add-customer-new-entity-type-and-customer-new-field%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









            1














            Lifted from:



            • https://stackoverflow.com/questions/5961290/adding-attributes-to-customer-entity/5962237#5962237


            This is the code for a basic int attribute with text renderer:



            $installer = $this;
            $installer->startSetup();

            $setup = new Mage_Eav_Model_Entity_Setup('core_setup');

            $entityTypeId = $setup->getEntityTypeId('customer');
            $attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
            $attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);

            $setup->addAttribute('customer', 'your_attribute_code_here', array(
            'input' => 'text',
            'type' => 'int',
            'label' => 'Some textual description',
            'visible' => 1,
            'required' => 0,
            'user_defined' => 1,
            ));

            $setup->addAttributeToGroup(
            $entityTypeId,
            $attributeSetId,
            $attributeGroupId,
            'your_attribute_code_here',
            '999' //sort_order
            );

            $oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'your_attribute_code_here');
            $oAttribute->setData('used_in_forms', array('adminhtml_customer'));
            $oAttribute->save();

            $setup->endSetup();


            The unusual step for adding attributes is the setData('used_in_forms') this seems to be unique to customer attributes. Without it, the field won't get rendered, certainly not in the adminhtml anyway. You can see the valid options for this array in the customer_form_attribute database table.



            In terms of using a select with predefined options, this is what you need:



            $iAttributeId = $installer->getAttributeId($entityTypeId, 'your_attribute_code_here');
            $aClasses = array('TV','DVD','Home Theatre','Air Conditioner','Stereo/Hifi','Game Console','Camcorder','VCR','Set Top Box','PVR');
            $aOption = array();
            $aOption['attribute_id'] = $iAttributeId;

            for($iCount=0;$iCount<sizeof($aClasses);$iCount++)
            $aOption['value']['option'.$iCount][0] = $aClasses[$iCount];

            $setup->addAttributeOption($aOption);


            And here is a walk-through on using a custom source for your drop-down



            Hope this helps,

            JD






            share|improve this answer





























              1














              Lifted from:



              • https://stackoverflow.com/questions/5961290/adding-attributes-to-customer-entity/5962237#5962237


              This is the code for a basic int attribute with text renderer:



              $installer = $this;
              $installer->startSetup();

              $setup = new Mage_Eav_Model_Entity_Setup('core_setup');

              $entityTypeId = $setup->getEntityTypeId('customer');
              $attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
              $attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);

              $setup->addAttribute('customer', 'your_attribute_code_here', array(
              'input' => 'text',
              'type' => 'int',
              'label' => 'Some textual description',
              'visible' => 1,
              'required' => 0,
              'user_defined' => 1,
              ));

              $setup->addAttributeToGroup(
              $entityTypeId,
              $attributeSetId,
              $attributeGroupId,
              'your_attribute_code_here',
              '999' //sort_order
              );

              $oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'your_attribute_code_here');
              $oAttribute->setData('used_in_forms', array('adminhtml_customer'));
              $oAttribute->save();

              $setup->endSetup();


              The unusual step for adding attributes is the setData('used_in_forms') this seems to be unique to customer attributes. Without it, the field won't get rendered, certainly not in the adminhtml anyway. You can see the valid options for this array in the customer_form_attribute database table.



              In terms of using a select with predefined options, this is what you need:



              $iAttributeId = $installer->getAttributeId($entityTypeId, 'your_attribute_code_here');
              $aClasses = array('TV','DVD','Home Theatre','Air Conditioner','Stereo/Hifi','Game Console','Camcorder','VCR','Set Top Box','PVR');
              $aOption = array();
              $aOption['attribute_id'] = $iAttributeId;

              for($iCount=0;$iCount<sizeof($aClasses);$iCount++)
              $aOption['value']['option'.$iCount][0] = $aClasses[$iCount];

              $setup->addAttributeOption($aOption);


              And here is a walk-through on using a custom source for your drop-down



              Hope this helps,

              JD






              share|improve this answer



























                1












                1








                1







                Lifted from:



                • https://stackoverflow.com/questions/5961290/adding-attributes-to-customer-entity/5962237#5962237


                This is the code for a basic int attribute with text renderer:



                $installer = $this;
                $installer->startSetup();

                $setup = new Mage_Eav_Model_Entity_Setup('core_setup');

                $entityTypeId = $setup->getEntityTypeId('customer');
                $attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
                $attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);

                $setup->addAttribute('customer', 'your_attribute_code_here', array(
                'input' => 'text',
                'type' => 'int',
                'label' => 'Some textual description',
                'visible' => 1,
                'required' => 0,
                'user_defined' => 1,
                ));

                $setup->addAttributeToGroup(
                $entityTypeId,
                $attributeSetId,
                $attributeGroupId,
                'your_attribute_code_here',
                '999' //sort_order
                );

                $oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'your_attribute_code_here');
                $oAttribute->setData('used_in_forms', array('adminhtml_customer'));
                $oAttribute->save();

                $setup->endSetup();


                The unusual step for adding attributes is the setData('used_in_forms') this seems to be unique to customer attributes. Without it, the field won't get rendered, certainly not in the adminhtml anyway. You can see the valid options for this array in the customer_form_attribute database table.



                In terms of using a select with predefined options, this is what you need:



                $iAttributeId = $installer->getAttributeId($entityTypeId, 'your_attribute_code_here');
                $aClasses = array('TV','DVD','Home Theatre','Air Conditioner','Stereo/Hifi','Game Console','Camcorder','VCR','Set Top Box','PVR');
                $aOption = array();
                $aOption['attribute_id'] = $iAttributeId;

                for($iCount=0;$iCount<sizeof($aClasses);$iCount++)
                $aOption['value']['option'.$iCount][0] = $aClasses[$iCount];

                $setup->addAttributeOption($aOption);


                And here is a walk-through on using a custom source for your drop-down



                Hope this helps,

                JD






                share|improve this answer















                Lifted from:



                • https://stackoverflow.com/questions/5961290/adding-attributes-to-customer-entity/5962237#5962237


                This is the code for a basic int attribute with text renderer:



                $installer = $this;
                $installer->startSetup();

                $setup = new Mage_Eav_Model_Entity_Setup('core_setup');

                $entityTypeId = $setup->getEntityTypeId('customer');
                $attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
                $attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);

                $setup->addAttribute('customer', 'your_attribute_code_here', array(
                'input' => 'text',
                'type' => 'int',
                'label' => 'Some textual description',
                'visible' => 1,
                'required' => 0,
                'user_defined' => 1,
                ));

                $setup->addAttributeToGroup(
                $entityTypeId,
                $attributeSetId,
                $attributeGroupId,
                'your_attribute_code_here',
                '999' //sort_order
                );

                $oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'your_attribute_code_here');
                $oAttribute->setData('used_in_forms', array('adminhtml_customer'));
                $oAttribute->save();

                $setup->endSetup();


                The unusual step for adding attributes is the setData('used_in_forms') this seems to be unique to customer attributes. Without it, the field won't get rendered, certainly not in the adminhtml anyway. You can see the valid options for this array in the customer_form_attribute database table.



                In terms of using a select with predefined options, this is what you need:



                $iAttributeId = $installer->getAttributeId($entityTypeId, 'your_attribute_code_here');
                $aClasses = array('TV','DVD','Home Theatre','Air Conditioner','Stereo/Hifi','Game Console','Camcorder','VCR','Set Top Box','PVR');
                $aOption = array();
                $aOption['attribute_id'] = $iAttributeId;

                for($iCount=0;$iCount<sizeof($aClasses);$iCount++)
                $aOption['value']['option'.$iCount][0] = $aClasses[$iCount];

                $setup->addAttributeOption($aOption);


                And here is a walk-through on using a custom source for your drop-down



                Hope this helps,

                JD







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited May 23 '17 at 12:37









                Community

                1




                1










                answered Dec 1 '13 at 21:21









                B00MERB00MER

                8,20321645




                8,20321645



























                    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%2f11324%2fhow-to-add-customer-new-entity-type-and-customer-new-field%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

                    Nidaros erkebispedøme

                    Birsay

                    Where did Arya get these scars? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why did Arya refuse to end it?Has the pronunciation of Arya Stark's name changed?Has Arya forgiven people?Why did Arya Stark lose her vision?Why can Arya still use the faces?Has the Narrow Sea become narrower?Does Arya Stark know how to make poisons outside of the House of Black and White?Why did Nymeria leave Arya?Why did Arya not kill the Lannister soldiers she encountered in the Riverlands?What is the current canonical age of Sansa, Bran and Arya Stark?