Jarnail S
Jarnail S

Reputation: 401

Magento: What are attributes TYPES in magento?

I am looking to find "attributes types" in magento. This question was also asked me once in an interview. Color,size and height etc are not 'attribute types' as they are 'attribute set'

Upvotes: 1

Views: 1277

Answers (2)

Alana Storm
Alana Storm

Reputation: 166106

Without context it's hard to say, as Magento is types all the way down, but I'd assume your interviewer was asking about the data types of a Magento EAV attribute.

That is, color, size, and height are attributes, but each attribute also has a data type that's one of the following

  • varchar
  • datetime
  • int
  • text
  • decimal
  • static

In addition to determining what sort of data an attribute holds, an attribute's type also determine where EAV table the attribute value is stored in (catalog_product_entity_datetime, catalog_product_entity_decimal, etc.) That "static" value is a bit of an outlier -- static attributes are attributes that are part of the model's main table.

You can lookup an attribute's type value in the eav_attribute table, under the backend_type column.

Upvotes: 3

Pankaj Pareek
Pankaj Pareek

Reputation: 3836

Attributes:

In Magento, Attributes are the properties of a product like:color, manufacturer, SKU, Size etc. There are two kinds of attributes in Magento:

  1. System Attributes
  2. Custom Attributes

By default, Magento includes all the necessary System Attributes. These cannot be deleted, and every product must have each of these attributes. These types of attributes include Name, Price, and SKU, without which a product would not function.

Custom Attributes, on the other hand, are attributes created from backend Manage Attributes section. These will likely be more specific for individual products, and therefore will not necessarily be included in every Attribute set. For example, if you were to create an attribute for color, with values of blue, green, yellow, etc., you may want to apply this attribute to an Attribute Set for shirts, which you sell in various colors, but you probably would not include it in an Attribute Set for DVDs, for which color is not really an applicable attribute.

Attribute Set:

An attribute set is a collection of attributes. You can customize the default attribute set to have more custom attributes that you have created or create your own new attribute set.

Attribute Group:

There are several default attribute groups assigned to the Default attribute set:

General
Prices
Meta Information
Images
Recurring Profile
Design
Gift Options

You can assign relevant attributes in a Group attribute. you can create entirely new attribute groups and assign them to your attribute sets. That new group will show up when you go to manage your product with that attribute set just like you see General, Prices and the other groups on product add/edit page.

Upvotes: 0

Related Questions