如何在安装模块期间更改eav属性属性.
具体来说,我想将产品属性从需要更改为不需要.
我目前正在我的模块设置中的getDefaultEntities调用中合并更新的产品属性,但它给出了奇怪的结果.
例如:
public function getDefaultEntities()
{
return array(
'catalog_product' => array(
'entity_attribute_collection' => 'catalog/product_attribute_collection',
'attribute_model' => 'catalog/resource_eav_attribute',
'table' => 'catalog/product',
'entity_model' => 'catalog/product',
'additional_attribute_table' => 'catalog/eav_attribute',
'attributes' => array(
'short_description' => array('required'=> false)
)
)
);
}
Run Code Online (Sandbox Code Playgroud)
short_description字段中的结果会丢失其前端标签
ben*_*rks 19
/* @var $installer Mage_Catalog_Model_Resource_Setup */
$installer->updateAttribute('catalog_product','short_description','is_required',0);
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
5426 次 |
最近记录: |