Since Magento 2 features a more developer-friendly’ architecture and offers much more convenient methods to interact with the core & keep away from different kinds of conflicts. Magento 2 has no code pools, so there is no chance of any dispute regarding the right place where to put the code. Following is the right path to put the main files of extension:
app/code/[VendorName]/[ExtensionName]
Crate an extension in this directory based on the above:
app/code/Eecom/CustomAttribute/
A file named as module.xml in the app/code/ Eecom/CustomAttribute directory is required to define our new module by the means of following content:
As you can observe that XML files in Magento 2 features schema definitions that permit to validate your XML in different positions. The node is used to express your extension’s dependencies, same like node is used in Magento 1.x. Now, it is our next step where we require developing the data script through the parameters of the new attribute: