Question

In the

Magento_Catalog

module i have seen there are three different configuration (xml) files related to the catalog attributes, those three files are

catalog_attributes.xml vs eav_attributes.xml vs extension_attributes.xml

So my question is what is the difference between these three files, what are the specific usages of these three files ?

Was it helpful?

Solution

catalog_attributes.xml

It contains the list of attributes that serve different purposes.

For example, the group used_in_autogeneration is for listing attributes that have the value autogenerated.

The group quote_item represents the attributes that are going to be copied from the product to the quote item.

unassignable contains the list of attributes that cannot be unassigned from any attribute set.

eav_attributes.xml

It provides the EAV attributes configuration.

For example, in vendor/magento/module-catalog/etc/eav_attributes.xml you can see many attributes like sku, status, etc and the configuration says about those attributes like if the attribute is global or it is searchable or filterable. Similar things that we do while creating a custom attribute using the Data Patch.

extension_attributes.xml

Extension Attributes are used to extend functionality and often use more complex data types than custom or eav attributes. These attributes do not appear in the Magento Admin.

extension_attributes.xml is used for declaring the extension attributes for the module.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top