Close

     

Our Blog

Adding custom attribute to API response in Magento 2

May 29, 2018 // by Dmytro Cheshun

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 (0)

How to access custom catalog attributes in Magento 2

March 6, 2018 // by Dmytro Cheshun

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)

Adding new category attributes in Magento 2

December 22, 2016 // by Sergiy Vasyutynsky

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 (18)

Adding an attribute programmatically in Magento 2

April 29, 2015 // by Yaroslav Rogoza

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)

Displaying a custom CMS attribute on the Magento frontend

June 5, 2012 // by Nick Kravchuk

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)

Accessing a custom attribute at checkout/cart in Magento

May 7, 2012 // by Volodymyr Vygovskyi

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)

How to get configurable product options and attributes

October 7, 2011 // by Alexander Turiak

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 (27)