【发布时间】:2009-12-09 05:44:45
【问题描述】:
我已向客户地址实体添加了一个属性。属性设置代码如下-
'entity_type_id'=>$customer_address_type_id,
'attribute_code'=>'signature_required',
'backend_type'=>'int',
'frontend_input'=>'boolean',
'frontend_label' => 'Signature required',
'is_global' => '1',
'is_visible' => '1',
'is_required' => '0',
'is_user_defined' => '0',
然后-
- 为model\entity\setup.php添加了属性
- 在编辑表单上添加了一个 HTML 字段
当复选框被选中时,我现在将属性保存到数据库中。但是,未选中复选框时不会取消设置(我猜是由于未选中复选框输入不是“发布”。
取消选中此选项的最佳方法是什么?我应该添加默认值 0 吗?或者在保存到控制器之前取消设置/删除属性?我应该向模型添加 get/set 方法吗?
【问题讨论】:
标签: magento attributes boolean street-address