What new tables need to be created when building module for custom attributes?
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
New contributor
add a comment |
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
New contributor
add a comment |
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
New contributor
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
database magento2.2 custom-attributes
New contributor
New contributor
New contributor
asked yesterday
IsaacP
11
11
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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/
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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/
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
add a comment |
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/
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
add a comment |
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/
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/
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
add a comment |
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
add a comment |
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.
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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