4

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.

Community
  • 1
  • 1
ForceMan
  • 51
  • 1
  • 3

1 Answers1

0

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.

Peter
  • 1,674
  • 4
  • 27
  • 44