jeudi 1 septembre 2016

How to get value in checkbox Prestashop?

i have a function renderForm

$this->fields_form = array(
        'tinymce' => true,
        'legend' => array(
            'title' => $this->l('Category'),
            'icon' => 'icon-folder'
        ),
        'input' => array(

            array(
                'type' => 'checkbox',
                'label' => $this->l('Group access'),
                'name' => 'checkBox',
                'values' => array(
                    'query' => Group::getGroups($this->id_lang),
                    'id' => 'id_group',
                    'name' => 'name'
                ),
                'unidentified' => $unidentified_group_information,
                'guest' => $guest_group_information,
                'customer' => $default_group_information,
                'info_introduction' => $this->l('You now have three default customer groups.'),
                'hint' => $this->l('Mark all of the customer groups which you would like to have access to this category.')
            )
        ),
        'submit' => array(
            'title' => $this->l('Save'),
            'class' => 'btn btn-large btn-success pull-right'
        )
    );

i need get value of checkbox for insert into database

i print_r($_POST) it show checkBox_1 => on, checkBox_2 => on

this class extends ModuleAdminController

thanks!!!




Aucun commentaire:

Enregistrer un commentaire