Blog

Magento knowledge sharing.

Articles about Magento development, tips and tricks, Atwix office life. Also 1000 bla-bla-bla to fill this huge block. You’re just waisting your time reading this message.

Adding custom attribute to API response in Magento 2

Magento 2 implements the service contracts design pattern – a set of PHP interfaces that are defined for a module. A service contract includes service and data interfaces, which hide business logic details from service requestors such as controllers, web services, and other modules.

Comments (5) Read More
Catalog Attributes in Magento 2

How to access custom 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.

Comments (0) Read More
Adding new category attributes in Magento 2

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.

Comments (19) Read More

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.

Comments (27) Read More
Displaying a custom CMS attribute on the Magento frontend

Displaying a custom CMS attribute on the Magento frontend

In this article we would like to share with the community one of the ways to display a custom CMS attribute on the Magento frontend. In my previous article I have explained how to add a CMS attribute at the backend. Check it out here (Adding a custom attribute to the CMS page).

Comments (2) Read More
Accessing a custom attribute at checkout/cart in Magento

Accessing a custom attribute at checkout/cart in Magento

So you have added a new custom product attribute. It is not a problem to access and use it in Product View. And you probably know that you should enable it under the attribute settings page of Magento backend in order to make it available for the Product List (or category view) section. But what about checkout/cart area?

Comments (13) Read More
How to get configurable product options and attributes

How to get configurable product options and attributes

Getting all options of a specific attribute in Magento is fairly easy:

$attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'color');  
foreach ($attribute->getSource()->getAllOptions(true) as $option) {
    echo $option['value'] . ' ' . $option['label'] . "\n";
}
Comments (28) Read More

Subscribe to our blog

Interested
in Atwix?

Contact us

Migrate
to Magento 2

Start Coutdown