cancel
Showing results for 
Search instead for 
Did you mean: 

Adding custom attributes to admin category's

Adding custom attributes to admin category's

I'm wanting to add a couple of custom attributes to manage category / category / category products, so I can add products by not just filtering with title or sku but by my own
4 REPLIES

Re: Adding custom attributes to admin category's

Your question is kinda confusing.

 

Are you trying to add a new attribute to categories, as the title suggests?

 

Or are you trying to add an attribute column to the admin grid when you're viewing a list of products?

Re: Adding custom attributes to admin category's

Looks to me like you would like to add attributes for additional filters in the left side of your shop ?

 

If so

All attributes can be open under Catalog > Manage Attributes > Find your desired attribute and then selection the Option > Use for layered navigation under Frontend.

 

If you would like to have new attributes simply create them, assign like above and assign the to the desired Attribute Set. 

Enter the products affected by the new attribute, fill out the new attributes and save the products.

 

Run a re-index and empty your cache and check the your frontend.

 

Let me know if I misunderstood your question Smiley Happy

 

 

-- Best regards --
Kent Christiansen / @KentChrDK / Magento Certified Solution Specialist / Visit my site (DK)

Re: Adding custom attributes to admin category's

If you are looking for the custom attributes in admin Grid Filter then this Extension will be helpful ot you
http://www.magentocommerce.com/magento-connect/admin-grid-category.html

SeverTek
Email:support@severtek.com
Website:http://www.severtek.com/

Re: Adding custom attributes to admin category's

Hi Beermonster

 

I think I think i understand your question, and I'm not sure it have been answered this far so here goes :-)

 

What you are looking for is a way to add more attributes to the grid where you add products to a category from. First of all there are many extensions you can use to get a better product mangement in your categories. But if you want to do it youself here is how:

 

The block that controls that grid is: Mage_Adminhtml_Block_Catalog_Category_Tab_Product, this block renders both the columns that are visible and chooses what collection is utialized to be shown in it. So this is the block you need to make a rewrite for. In your new object, go and create two functions.

 

  • public function setCollection()
  • protected function _prepareColumns()
Spoiler
Disclaimer: untestet code ahead, there might be a wrong semicolon or comma ;-)

 

You need the first one becaouse this is an EAV collection you are we are dealing with in this grid. In the first function we are going to add our own attribute to select for this before sending it to its parent like this.

 

    public function setCollection($collection)
    {
        $collection->addAttributeToSelect('my_attribute');
        return parent::setCollection($collection);
    }
 

 

For the other method, (again in your own object), add the following method:

 

    protected function _prepareColumns()
    {
        $this->addColumn('my_attribute', array(
            'header'    => Mage::helper('catalog')->__('My Attribute Name'),
            'index'     => 'name'
        ));
        return parent::_prepareColumns();
    }

 

This will add the extra columns to your grid view. And allow you to search for the attribute in question.

 

I hope this helps :-)