Magento - 属性“输入类型”复选框
我见过类似的问题,但没有在那里找到答案: 如何获取自定义后端 Magento 客户复选框属性来保存我的选择?
$installer->addAttribute('catalog_product', 'tip', array(
'group' => 'ISM',
'input' => 'checkbox',
'type' => 'int',
'label' => 'TIP',
'visible' => 1,
'source' => 'eav/entity_attribute_source_boolean',
'required' => 0,
'user_defined' => 1,
'searchable' => 0,
'filterable' => 0,
'comparable' => 0,
'visible_on_front' => 0,
'visible_in_advanced_search' => 0,
'is_html_allowed_on_front' => 0,
'global' => 1,
'used_in_product_listing' => 0,
'is_html_allowed_on_front' => 1
));
我已经创建了一个属性,但当我编辑-保存或创建-保存产品。
I have seen a similar question but I did not find an answer there :
How can I get my custom backend Magento Customer Checkbox Attribute to save my selection?
$installer->addAttribute('catalog_product', 'tip', array(
'group' => 'ISM',
'input' => 'checkbox',
'type' => 'int',
'label' => 'TIP',
'visible' => 1,
'source' => 'eav/entity_attribute_source_boolean',
'required' => 0,
'user_defined' => 1,
'searchable' => 0,
'filterable' => 0,
'comparable' => 0,
'visible_on_front' => 0,
'visible_in_advanced_search' => 0,
'is_html_allowed_on_front' => 0,
'global' => 1,
'used_in_product_listing' => 0,
'is_html_allowed_on_front' => 1
));
I have created an attribute, but it doesn't save the value when I edit-save or create-save the product.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将“input”用作
int
,因为您始终存储复选框“0”或“1”的值。对于源代码,您已经使用了 0 或 1 的核心选项布尔值。Use 'input' as
int
because you always store the value of the checkbox '0' or '1'. And for source you are already using core options boolean that is 0 or 1.