how to add attributes for categories in magento

Post on 22-Jan-2017

203 Views

Category:

Technology

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

How To Add Attributes for Categories in Magento

The Magento admin panel lets you add attributes only for products. If you want to add attributes to a category, here’s what you have to do . . .

Step 1 -

Create new module

Initial configuration file is located in - ‘app/etc/modules/Dat_CustomCategoryAttribute’.Dat_CustomCategoryAttribute

It means that the module is active and it is located in the local code pool.

Step 2 -

Configure Module

The configuration file is not large at all, there are only 2 nodes.

The installed script helps us to create a new attribute.

In the node we defined the class for our install script which will be used for the extension.

Working with methods of this class helps us create, update, remove attribute (etc). And the node says that the script must be located in the folder with the same name

Step 3 -

Create Attribute

We create a new attribute in the category with label ‘Custom attribute ‘. This attribute is a text and it must be visible on the frontend.

Step 4 -

Check Results

Let’s clear cache and after this.

Go to Admin Panel –> Catalog –> Manage Categories –> General Information tab you will see a new attribute: ‘Custom attribute’

We create a new attribute in the category with label ‘Custom attribute ‘. This attribute is a text and it must be visible on the frontend.

top related