[Magento 2] Adding custom category attribute (with scopes)

Creating a new category attribute should be easy in Magento 2. It is, more or less. Follow these steps and you will get to it: Files you will need to create A quick screenshot of how your module will look once you create it: YourCompany/YourModule/registration.php YourCompany/YourModule/etc/module.xml YourCompany/YourModule/Setup/InstallData.php YourCompany/YourModule/view/adminhtml/ui_component/category_form.xml This code Read more…

[Magento 2] Update product attribute programmatically

It’s pretty easy when you have the eavSetup in your setup module. It’s only necessary to execute: $eavSetup->updateAttribute(Product::ENTITY, $attributeCode, $attributeField, $value); For example, if I want to change the ‘position’ field value of the ‘price’ product attribute: $eavSetup->updateAttribute(‘catalog_product’, ‘price’, ‘position’, 100);