Jump to content

Каким способом можно манипулировать чекбоксом через контроллер в Prestashop 1.7 ?


Recommended Posts

public function renderView()
{
    $this->table = 'feature'; // SQL table name, will be prefixed with _DB_PREFIX_
    $this->identifier = 'id_feature'; // SQL column to be used as primary key
    $this->className = 'Feature'; // PHP class name
    $this->lang = true;
    $this->allow_export = true; // allow export in CSV, XLS..

    $this->_defaultOrderBy = 'id_feature'; // the table alias is always `a`
    $this->_defaultOrderWay = 'ASC';
    $featuregoup = Tools::getValue('id'); // id_featuregroup   [enter image description here][1]

    $this->fields_list = [
        'id_feature' => array(
            'title' => $this->trans('ID', array(), 'Admin.Global'),
            'align' => 'center',
            'class' => 'fixed-width-xs',
        ),
        "$featuregoup" => array(
            'title' => $this->trans('ID Groups', array(), 'Admin.Global'),
            'align' => 'center',
            'class' => 'fixed-width-xs',
        ),
        'name' => [
            'title' => $this->trans('Name', [], 'Admin.Global'),
            'width' => 'auto',
            'filter_key' => 'b!name',
        ],
    ];

    $this->bulk_actions = array(
        'hash' => array(
            'text' => 'Save',
            'icon' => 'done_all',
            'confirm' => $this->trans('Save', array(), 'Admin.Notifications.Info'),
        ),
    );

    return parent::renderList();
}

 

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