cancel
Showing results for 
Search instead for 
Did you mean: 

How can I Create New Label Icon Selected Category

How can I Create New Label Icon Selected Category

I need to create New Label Icon for selected categories, How can I create labels like,

 

https://i.stack.imgur.com/yFMyk.png

4 REPLIES 4

Re: How can I Create New Label Icon Selected Category

Hi @Jeeva Rathinam,

 

Maybe you can create a module with install scripts to add a new attribute for your category.

If you only need to show as new (or not) you can create a yes/no attribute for categories:

 

$installer = $this;
 
$installer->startSetup();
 
$installer->addAttribute('catalog_category', 'test_yes_no', array(
                        'type'              => 'int',
                        'backend'           => '',
                        'frontend'          => '',
                        'label'             => 'Test Yes/No',
                        'input'             => 'select',
                        'class'             => '',
                        'source'            => 'eav/entity_attribute_source_boolean',
                        'global'            => 1,
                        'visible'           => 1,
                        'required'          => 0,
                        'user_defined'      => 0,
                        'default'           => '',
                        'searchable'        => 0,
                        'filterable'        => 0,
                        'comparable'        => 0,
                        'visible_on_front'  => 0,
                        'unique'            => 0,
                        'position'          => 1,
                    ));
 
$installer->endSetup();

If you need to add different images/icons, maybe you'll need another type of attribute:

 

$installer = $this;
 
$installer->startSetup();
 
$installer->addAttribute('catalog_category', 'test_picture', array(
                        'type'              => 'varchar',
                        'backend'           => 'catalog/category_attribute_backend_image',
                        'frontend'          => '',
                        'label'             => 'Test Picture',
                        'input'             => 'image',
                        'class'             => '',
                        'source'            => '',
                        'global'            => 0,
                        'visible'           => 1,
                        'required'          => 0,
                        'user_defined'      => 0,
                        'default'           => '',
                        'searchable'        => 0,
                        'filterable'        => 0,
                        'comparable'        => 0,
                        'visible_on_front'  => 0,
                        'unique'            => 0,
                        'position'          => 1,
                    ));
 
$installer->endSetup();

Then you'll need to edit the html part of the menu to show your new value with the category name.

Re: How can I Create New Label Icon Selected Category

I am new for magento, could you pls guide me step by step.

Re: How can I Create New Label Icon Selected Category

@Jeeva Rathinam,

 

If you don't know how to build a module from scratch maybe this post can help you. Is in spanish but you can use GTranslate: http://www.damianculotta.com.ar/2011/08/17/como-agregar-atributos-a-una-categoria-en-magento/

 

With that information you'll be able to add a custom attribute to your categories

Re: How can I Create New Label Icon Selected Category

I did completely what you told, but not working, cached and reindexed. magento ver : 1.9.2.3