gpt4 book ai didi

Magento - 属性 "input-type"复选框

转载 作者:行者123 更新时间:2023-12-05 01:13:53 26 4
gpt4 key购买 nike

我看过一个类似的问题,但我没有在那里找到答案:
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
));

我创建了一个属性,但是当我编辑保存或创建保存产品时它没有保存值。

最佳答案

使用“输入”作为 int因为您总是存储复选框“0”或“1”的值。对于源代码,您已经在使用 0 或 1 的核心选项 bool 值。

关于Magento - 属性 "input-type"复选框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7812163/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com