I cannot add the attribute "packaging_unit" to the products on my website.
The attribute does neither apprear in the database table eav_attribute nor on the website on the product page nor in the backend.
I have already read several tutorials, change my code multiple times, but it just doesn't work.
My module.xml looks like this:
In the Magento root folder I run the following commands:
php bin/magento setup:upgrade
php bin/magento setup:di:compile
Both succeed without an error, but as I said it dosen't work.
What am I doing wrong?
I suggest you to consider installing the following Magento customer attributes extension. It's easy and you can customize the different features. It allows you to add 11 different types of fields to either registration or account page or both the pages. You can validate the input from customers, make the fields optional or mandatory, set a default value, hide them from customer after taking value etc.
For all features, visit: Magento Customer Attributes Extension
Its very simple to add customer attribute programetically, take a look this post will help youto add custom attribute.