我已经看到了类似的问题,但是我没有在这里找到答案:
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。

09-30 17:26
查看更多