Jump to content

Add custom checkbox to category


crimba

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(
            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();
    }
}

 

Link to comment
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...