prestashop多个复选框不保存值 [英] prestashop multiple checkboxes do not save values

查看:132
本文介绍了prestashop多个复选框不保存值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法弄清为什么复选框的值不是使用助手保存在数据库中。

I can't figure out why the checkbox values are not saved in the database using helpers.

尝试从我的模块设置中保存一些客户ID:

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

数组:

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

复选框:

'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',
            ),
        ),
)

$ _POST始终为空,但可与其他输入正常工作。

The $_POST is always empty but works well with another input. Any help will be appreciated.

谢谢。

推荐答案

代码是正确的,我尝试它,这是结果
http://screencast.com/t/wfsW86iJj

Your code is correct, I tried it and this is result http://screencast.com/t/wfsW86iJj


  1. 您必须至少点击一个复选框。

  2. 显示数据在服务器上:

  1. You have to click at least one checkbox.
  2. Show data on server :

    print_r($_POST);
    die();


这篇关于prestashop多个复选框不保存值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆