Catalog Attributes in Magento 2

Quite often Magento developers face a problem with accessing custom attributes during product collection loading. For example, when you try to get a product from a quote or a wishlist item. As the result, we’ve noticed some interesting workarounds to bypass the problem and to access the attribute value at any price, like repetitive product loading etc. However, there is a proper way to make these attributes accessible. We would like to tell more about it.

Adding new category attributes in Magento 2

In this post we want to share our expertise on how to create a category attribute in Magento 2. As you may have noticed, we need to change (add or customize) category attributes from time to time. We have done it many times for Magento 1 and now we faced the same task in Magento 2. This process is very similar for both Magento versions, however there are some differences. So let’s check how we can do it step by step.

Adding an attribute programmatically in Magento 2

Upon creating an extension for Magento, quite often you face with a necessity to create a custom attribute for product, category, customer etc. Of course, you can add a description somewhere in the extension’s documentation how to do it and do not bother you head. However, all Magento versions allow you to create an attribute on the fly during an extension’s installation. There were many topics how to do that in Magento 1.x, and let’s check what is the difference in the next major version of Magento.