samedi 28 mai 2016

prestashop checkbox does not save values

I'm can't figure out why the checkbox values not save in the database using helpers and Configuration class.

Trying to save some customers ids from my module's setting :

The array :

$custs = Customer::getCustomers();
foreach ($custs as $key => $value) {
  $options[] = array(
        'id_customer' => (int)$value['id_customer'],
        'infos' => $value['firstname'].' '.$value['lastname'].' | '.$value['email']
    );
}

The checkboxes :

'input' => array(
        array(
            'type' => 'checkbox',
            'label' => $this->l('Customers'),
            'desc' => $this->l('Select the Customers.'),
            'name' => 'MY_MODULE_CUSTOMERS',
            'values' => array(
                'query' => $options,
                'id' => 'id_customer',
                'name' => 'infos',
            ),
        ),
)

Thank you.




Aucun commentaire:

Enregistrer un commentaire