Jump to content

Add custom checkbox to category


Recommended Posts

This is my class:

class AdminCategoriesController extends AdminCategoriesControllerCore{

    public function renderForm()
        $countries = Country::getCountries(Context::getContext()->language->id);
        $checkboxcountries = array();

        foreach ($countries as $key => $value){
            $checkboxcountries[] = array(
                'check_id' => $value['iso_code'],
                'name' => $value['name'],
                'val' => $value['iso_code']

        $this->fields_form_override =array(
                'type' => 'checkbox',
                'label' => $this->l('Restricted Countries'),
                'name' => 'hide_in_countries',
                'values' => array(
                    'query' => $lesChoix = $checkboxcountries,
                    'id' => 'check_id',
                    'name' => 'name',
                    'desc' => $this->l('Please select')

        return parent::renderForm();


Share this post

Link to post
Share on other sites

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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More