Jump to content

Adding fields to category in backoffice


ilerna

Recommended Posts

Hello,

 

I need to add some HTML fields to categories.

 

I've added custom fields into ps_category_lang table.

Then overrided Category.php controller adding these fields to it.

 

But still can't see them in backoffice form. Do I need something else?

 

Thanks in advantage

Link to comment
Share on other sites

I've found editing AdminCategoriesController.php can add custom form fields to Backoffice, but when I save the form I get error updating category() object

 

I have already added the field to database table and Category.php

 

class CategoryCore extends ObjectModel
{
public $myfield;
...
public static $definition = array(
'table' => 'category',
'primary' => 'id_category',
'multilang' => true,
'multilang_shop' => true,
'fields' => array(
...
'myfield' =>  array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'),
),
);
...
}

 

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...