What is the purpose of set_order in Magento2?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





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







up vote
1
down vote

favorite












I'm trying to add a new attribute set and I have this data:



$data = [
'attribute_set_name' => 'Sample attribute set',
'entity_type_id' => $entityTypeId,
'sort_order' => 200,
];


Could someone explain what the sort_order means here? I just started to learn Magento 2, so it's a little confusing.







share|improve this question


























    up vote
    1
    down vote

    favorite












    I'm trying to add a new attribute set and I have this data:



    $data = [
    'attribute_set_name' => 'Sample attribute set',
    'entity_type_id' => $entityTypeId,
    'sort_order' => 200,
    ];


    Could someone explain what the sort_order means here? I just started to learn Magento 2, so it's a little confusing.







    share|improve this question






















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I'm trying to add a new attribute set and I have this data:



      $data = [
      'attribute_set_name' => 'Sample attribute set',
      'entity_type_id' => $entityTypeId,
      'sort_order' => 200,
      ];


      Could someone explain what the sort_order means here? I just started to learn Magento 2, so it's a little confusing.







      share|improve this question












      I'm trying to add a new attribute set and I have this data:



      $data = [
      'attribute_set_name' => 'Sample attribute set',
      'entity_type_id' => $entityTypeId,
      'sort_order' => 200,
      ];


      Could someone explain what the sort_order means here? I just started to learn Magento 2, so it's a little confusing.









      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 10 at 7:25









      HELPME

      497




      497




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          Basically this sort_order is a field where you put a number in order to sort the object or xml fields.



          You can define ascendent or descendent but most of the places I've seen are ascendent.



          EDITED:



          These are 4 fields that we created with the layout. Have a look at the code and see one of the parameters is sort_order.



          enter image description here



           <group id="customer">

          <field id="permission_info" translate="label" type="select" sortOrder="100"
          showInDefault="1" showInWebsite="1" showInStore="1">
          <label>Allow edit customer data</label>
          <source_model>MagentoConfigModelConfigSourceYesno</source_model>
          </field>

          <field id="permission_freetext" translate="label" type="select" sortOrder="110"
          showInDefault="1" showInWebsite="1" showInStore="1">
          <label>Show free text field</label>
          <source_model>MagentoConfigModelConfigSourceYesno</source_model>
          </field>

          <field id="permission_payment" translate="label" type="select" sortOrder="120"
          showInDefault="1" showInWebsite="1" showInStore="1">
          <label>Allow edit condition and payment method</label>
          <source_model>MagentoConfigModelConfigSourceYesno</source_model>
          </field>

          <field id="permission_bank" translate="label" type="select" sortOrder="130"
          showInDefault="1" showInWebsite="1" showInStore="1">
          <label>Allow edit bank data and payment days</label>
          <source_model>MagentoConfigModelConfigSourceYesno</source_model>
          </field>

          </group>


          If I change the values of the field with the id="permission_bank" and I put in the sort_order parameter a value between 101 and 109, this field will go between Allow edit customer data and Show free text field:



          enter image description here



          It's just a tool to sort.






          share|improve this answer






















          • I still didn't quite get it...
            – HELPME
            Aug 10 at 8:16










          • Have a look again, I edited a bit. :D
            – Raül
            Aug 10 at 8:43

















          up vote
          0
          down vote













          sort_order is added to tell the system where you want to display the field in the form.

          Higher the sort_order lower it will be displayed in the form.






          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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            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%2f237924%2fwhat-is-the-purpose-of-set-order-in-magento2%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote



            accepted










            Basically this sort_order is a field where you put a number in order to sort the object or xml fields.



            You can define ascendent or descendent but most of the places I've seen are ascendent.



            EDITED:



            These are 4 fields that we created with the layout. Have a look at the code and see one of the parameters is sort_order.



            enter image description here



             <group id="customer">

            <field id="permission_info" translate="label" type="select" sortOrder="100"
            showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Allow edit customer data</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>

            <field id="permission_freetext" translate="label" type="select" sortOrder="110"
            showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Show free text field</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>

            <field id="permission_payment" translate="label" type="select" sortOrder="120"
            showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Allow edit condition and payment method</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>

            <field id="permission_bank" translate="label" type="select" sortOrder="130"
            showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Allow edit bank data and payment days</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>

            </group>


            If I change the values of the field with the id="permission_bank" and I put in the sort_order parameter a value between 101 and 109, this field will go between Allow edit customer data and Show free text field:



            enter image description here



            It's just a tool to sort.






            share|improve this answer






















            • I still didn't quite get it...
              – HELPME
              Aug 10 at 8:16










            • Have a look again, I edited a bit. :D
              – Raül
              Aug 10 at 8:43














            up vote
            2
            down vote



            accepted










            Basically this sort_order is a field where you put a number in order to sort the object or xml fields.



            You can define ascendent or descendent but most of the places I've seen are ascendent.



            EDITED:



            These are 4 fields that we created with the layout. Have a look at the code and see one of the parameters is sort_order.



            enter image description here



             <group id="customer">

            <field id="permission_info" translate="label" type="select" sortOrder="100"
            showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Allow edit customer data</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>

            <field id="permission_freetext" translate="label" type="select" sortOrder="110"
            showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Show free text field</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>

            <field id="permission_payment" translate="label" type="select" sortOrder="120"
            showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Allow edit condition and payment method</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>

            <field id="permission_bank" translate="label" type="select" sortOrder="130"
            showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Allow edit bank data and payment days</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>

            </group>


            If I change the values of the field with the id="permission_bank" and I put in the sort_order parameter a value between 101 and 109, this field will go between Allow edit customer data and Show free text field:



            enter image description here



            It's just a tool to sort.






            share|improve this answer






















            • I still didn't quite get it...
              – HELPME
              Aug 10 at 8:16










            • Have a look again, I edited a bit. :D
              – Raül
              Aug 10 at 8:43












            up vote
            2
            down vote



            accepted







            up vote
            2
            down vote



            accepted






            Basically this sort_order is a field where you put a number in order to sort the object or xml fields.



            You can define ascendent or descendent but most of the places I've seen are ascendent.



            EDITED:



            These are 4 fields that we created with the layout. Have a look at the code and see one of the parameters is sort_order.



            enter image description here



             <group id="customer">

            <field id="permission_info" translate="label" type="select" sortOrder="100"
            showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Allow edit customer data</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>

            <field id="permission_freetext" translate="label" type="select" sortOrder="110"
            showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Show free text field</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>

            <field id="permission_payment" translate="label" type="select" sortOrder="120"
            showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Allow edit condition and payment method</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>

            <field id="permission_bank" translate="label" type="select" sortOrder="130"
            showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Allow edit bank data and payment days</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>

            </group>


            If I change the values of the field with the id="permission_bank" and I put in the sort_order parameter a value between 101 and 109, this field will go between Allow edit customer data and Show free text field:



            enter image description here



            It's just a tool to sort.






            share|improve this answer














            Basically this sort_order is a field where you put a number in order to sort the object or xml fields.



            You can define ascendent or descendent but most of the places I've seen are ascendent.



            EDITED:



            These are 4 fields that we created with the layout. Have a look at the code and see one of the parameters is sort_order.



            enter image description here



             <group id="customer">

            <field id="permission_info" translate="label" type="select" sortOrder="100"
            showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Allow edit customer data</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>

            <field id="permission_freetext" translate="label" type="select" sortOrder="110"
            showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Show free text field</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>

            <field id="permission_payment" translate="label" type="select" sortOrder="120"
            showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Allow edit condition and payment method</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>

            <field id="permission_bank" translate="label" type="select" sortOrder="130"
            showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Allow edit bank data and payment days</label>
            <source_model>MagentoConfigModelConfigSourceYesno</source_model>
            </field>

            </group>


            If I change the values of the field with the id="permission_bank" and I put in the sort_order parameter a value between 101 and 109, this field will go between Allow edit customer data and Show free text field:



            enter image description here



            It's just a tool to sort.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Aug 10 at 8:43

























            answered Aug 10 at 7:38









            Raül

            42413




            42413











            • I still didn't quite get it...
              – HELPME
              Aug 10 at 8:16










            • Have a look again, I edited a bit. :D
              – Raül
              Aug 10 at 8:43
















            • I still didn't quite get it...
              – HELPME
              Aug 10 at 8:16










            • Have a look again, I edited a bit. :D
              – Raül
              Aug 10 at 8:43















            I still didn't quite get it...
            – HELPME
            Aug 10 at 8:16




            I still didn't quite get it...
            – HELPME
            Aug 10 at 8:16












            Have a look again, I edited a bit. :D
            – Raül
            Aug 10 at 8:43




            Have a look again, I edited a bit. :D
            – Raül
            Aug 10 at 8:43












            up vote
            0
            down vote













            sort_order is added to tell the system where you want to display the field in the form.

            Higher the sort_order lower it will be displayed in the form.






            share|improve this answer
























              up vote
              0
              down vote













              sort_order is added to tell the system where you want to display the field in the form.

              Higher the sort_order lower it will be displayed in the form.






              share|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                sort_order is added to tell the system where you want to display the field in the form.

                Higher the sort_order lower it will be displayed in the form.






                share|improve this answer












                sort_order is added to tell the system where you want to display the field in the form.

                Higher the sort_order lower it will be displayed in the form.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Aug 10 at 9:11









                Anshu Mishra

                4,43032350




                4,43032350



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f237924%2fwhat-is-the-purpose-of-set-order-in-magento2%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    Long meetings (6-7 hours a day): Being “babysat” by supervisor

                    Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                    Confectionery