What new tables need to be created when building module for custom attributes?












0














Magento 2.2 -- I am trying to build a module that would allow for custom attributes to be created in the admin panel. At this point, I'm stuck on what tables need to be created to allow for that functionality. Do I need to create one table that links to another? That's what I've seen elsewhere in the core code...



Thanks!










share|improve this question







New contributor




IsaacP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0














    Magento 2.2 -- I am trying to build a module that would allow for custom attributes to be created in the admin panel. At this point, I'm stuck on what tables need to be created to allow for that functionality. Do I need to create one table that links to another? That's what I've seen elsewhere in the core code...



    Thanks!










    share|improve this question







    New contributor




    IsaacP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0







      Magento 2.2 -- I am trying to build a module that would allow for custom attributes to be created in the admin panel. At this point, I'm stuck on what tables need to be created to allow for that functionality. Do I need to create one table that links to another? That's what I've seen elsewhere in the core code...



      Thanks!










      share|improve this question







      New contributor




      IsaacP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      Magento 2.2 -- I am trying to build a module that would allow for custom attributes to be created in the admin panel. At this point, I'm stuck on what tables need to be created to allow for that functionality. Do I need to create one table that links to another? That's what I've seen elsewhere in the core code...



      Thanks!







      database magento2.2 custom-attributes






      share|improve this question







      New contributor




      IsaacP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      IsaacP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      IsaacP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked yesterday









      IsaacP

      11




      11




      New contributor




      IsaacP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      IsaacP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      IsaacP is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          0














          Magento has different entities: product, customer, category etc. https://magento.stackexchange.com/a/116504/43911



          You don't need to create new tables for these entities to store values of attributes. Attributes can create from admin panel for a product or programmatically with installer Magento 2 : Add Product Attribute Programmatically



          Also if you need to store any other values that don't relate to existing entities or configuration of a module
          ( Magento 2 : Add Product Attribute Programmatically )
          then you need to have a separate new table https://devdocs.magento.com/videos/fundamentals/add-a-new-table-to-database/






          share|improve this answer





















          • Thanks! That helped clarify my thoughts. However, I'm not looking to just save attribute values, but actually create attributes in the admin panel (sorry if I misunderstood something in your answer...). For example, I want to have a page in the admin panel that allows custom attributes to be created for a customers order. Where would those custom attributes be saved? Would I have to create a new table for that?
            – IsaacP
            21 hours ago










          • You need to create programmatically order attribute magento.stackexchange.com/a/131969/43911
            – Anton
            21 hours ago










          • But how would creating a new column in that table help when saving a new, custom attribute in the admin panel? I guess I'm not understanding how the custom attributes, created in the admin panel would get saved by doing that...
            – IsaacP
            20 hours ago










          • You can use this one example and update/save a value of attribute in the Observer yereone.com/magento-2-how-to-add-new-order-attribute
            – Anton
            4 hours ago











          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
          });


          }
          });






          IsaacP is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f256666%2fwhat-new-tables-need-to-be-created-when-building-module-for-custom-attributes%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














          Magento has different entities: product, customer, category etc. https://magento.stackexchange.com/a/116504/43911



          You don't need to create new tables for these entities to store values of attributes. Attributes can create from admin panel for a product or programmatically with installer Magento 2 : Add Product Attribute Programmatically



          Also if you need to store any other values that don't relate to existing entities or configuration of a module
          ( Magento 2 : Add Product Attribute Programmatically )
          then you need to have a separate new table https://devdocs.magento.com/videos/fundamentals/add-a-new-table-to-database/






          share|improve this answer





















          • Thanks! That helped clarify my thoughts. However, I'm not looking to just save attribute values, but actually create attributes in the admin panel (sorry if I misunderstood something in your answer...). For example, I want to have a page in the admin panel that allows custom attributes to be created for a customers order. Where would those custom attributes be saved? Would I have to create a new table for that?
            – IsaacP
            21 hours ago










          • You need to create programmatically order attribute magento.stackexchange.com/a/131969/43911
            – Anton
            21 hours ago










          • But how would creating a new column in that table help when saving a new, custom attribute in the admin panel? I guess I'm not understanding how the custom attributes, created in the admin panel would get saved by doing that...
            – IsaacP
            20 hours ago










          • You can use this one example and update/save a value of attribute in the Observer yereone.com/magento-2-how-to-add-new-order-attribute
            – Anton
            4 hours ago
















          0














          Magento has different entities: product, customer, category etc. https://magento.stackexchange.com/a/116504/43911



          You don't need to create new tables for these entities to store values of attributes. Attributes can create from admin panel for a product or programmatically with installer Magento 2 : Add Product Attribute Programmatically



          Also if you need to store any other values that don't relate to existing entities or configuration of a module
          ( Magento 2 : Add Product Attribute Programmatically )
          then you need to have a separate new table https://devdocs.magento.com/videos/fundamentals/add-a-new-table-to-database/






          share|improve this answer





















          • Thanks! That helped clarify my thoughts. However, I'm not looking to just save attribute values, but actually create attributes in the admin panel (sorry if I misunderstood something in your answer...). For example, I want to have a page in the admin panel that allows custom attributes to be created for a customers order. Where would those custom attributes be saved? Would I have to create a new table for that?
            – IsaacP
            21 hours ago










          • You need to create programmatically order attribute magento.stackexchange.com/a/131969/43911
            – Anton
            21 hours ago










          • But how would creating a new column in that table help when saving a new, custom attribute in the admin panel? I guess I'm not understanding how the custom attributes, created in the admin panel would get saved by doing that...
            – IsaacP
            20 hours ago










          • You can use this one example and update/save a value of attribute in the Observer yereone.com/magento-2-how-to-add-new-order-attribute
            – Anton
            4 hours ago














          0












          0








          0






          Magento has different entities: product, customer, category etc. https://magento.stackexchange.com/a/116504/43911



          You don't need to create new tables for these entities to store values of attributes. Attributes can create from admin panel for a product or programmatically with installer Magento 2 : Add Product Attribute Programmatically



          Also if you need to store any other values that don't relate to existing entities or configuration of a module
          ( Magento 2 : Add Product Attribute Programmatically )
          then you need to have a separate new table https://devdocs.magento.com/videos/fundamentals/add-a-new-table-to-database/






          share|improve this answer












          Magento has different entities: product, customer, category etc. https://magento.stackexchange.com/a/116504/43911



          You don't need to create new tables for these entities to store values of attributes. Attributes can create from admin panel for a product or programmatically with installer Magento 2 : Add Product Attribute Programmatically



          Also if you need to store any other values that don't relate to existing entities or configuration of a module
          ( Magento 2 : Add Product Attribute Programmatically )
          then you need to have a separate new table https://devdocs.magento.com/videos/fundamentals/add-a-new-table-to-database/







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered 23 hours ago









          Anton

          361




          361












          • Thanks! That helped clarify my thoughts. However, I'm not looking to just save attribute values, but actually create attributes in the admin panel (sorry if I misunderstood something in your answer...). For example, I want to have a page in the admin panel that allows custom attributes to be created for a customers order. Where would those custom attributes be saved? Would I have to create a new table for that?
            – IsaacP
            21 hours ago










          • You need to create programmatically order attribute magento.stackexchange.com/a/131969/43911
            – Anton
            21 hours ago










          • But how would creating a new column in that table help when saving a new, custom attribute in the admin panel? I guess I'm not understanding how the custom attributes, created in the admin panel would get saved by doing that...
            – IsaacP
            20 hours ago










          • You can use this one example and update/save a value of attribute in the Observer yereone.com/magento-2-how-to-add-new-order-attribute
            – Anton
            4 hours ago


















          • Thanks! That helped clarify my thoughts. However, I'm not looking to just save attribute values, but actually create attributes in the admin panel (sorry if I misunderstood something in your answer...). For example, I want to have a page in the admin panel that allows custom attributes to be created for a customers order. Where would those custom attributes be saved? Would I have to create a new table for that?
            – IsaacP
            21 hours ago










          • You need to create programmatically order attribute magento.stackexchange.com/a/131969/43911
            – Anton
            21 hours ago










          • But how would creating a new column in that table help when saving a new, custom attribute in the admin panel? I guess I'm not understanding how the custom attributes, created in the admin panel would get saved by doing that...
            – IsaacP
            20 hours ago










          • You can use this one example and update/save a value of attribute in the Observer yereone.com/magento-2-how-to-add-new-order-attribute
            – Anton
            4 hours ago
















          Thanks! That helped clarify my thoughts. However, I'm not looking to just save attribute values, but actually create attributes in the admin panel (sorry if I misunderstood something in your answer...). For example, I want to have a page in the admin panel that allows custom attributes to be created for a customers order. Where would those custom attributes be saved? Would I have to create a new table for that?
          – IsaacP
          21 hours ago




          Thanks! That helped clarify my thoughts. However, I'm not looking to just save attribute values, but actually create attributes in the admin panel (sorry if I misunderstood something in your answer...). For example, I want to have a page in the admin panel that allows custom attributes to be created for a customers order. Where would those custom attributes be saved? Would I have to create a new table for that?
          – IsaacP
          21 hours ago












          You need to create programmatically order attribute magento.stackexchange.com/a/131969/43911
          – Anton
          21 hours ago




          You need to create programmatically order attribute magento.stackexchange.com/a/131969/43911
          – Anton
          21 hours ago












          But how would creating a new column in that table help when saving a new, custom attribute in the admin panel? I guess I'm not understanding how the custom attributes, created in the admin panel would get saved by doing that...
          – IsaacP
          20 hours ago




          But how would creating a new column in that table help when saving a new, custom attribute in the admin panel? I guess I'm not understanding how the custom attributes, created in the admin panel would get saved by doing that...
          – IsaacP
          20 hours ago












          You can use this one example and update/save a value of attribute in the Observer yereone.com/magento-2-how-to-add-new-order-attribute
          – Anton
          4 hours ago




          You can use this one example and update/save a value of attribute in the Observer yereone.com/magento-2-how-to-add-new-order-attribute
          – Anton
          4 hours ago










          IsaacP is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          IsaacP is a new contributor. Be nice, and check out our Code of Conduct.













          IsaacP is a new contributor. Be nice, and check out our Code of Conduct.












          IsaacP is a new contributor. Be nice, and check out our Code of Conduct.
















          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%2f256666%2fwhat-new-tables-need-to-be-created-when-building-module-for-custom-attributes%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

          An IMO inspired problem

          Management

          Investment