0
在Magento中,我尝试创建一个产品属性,该属性将进入产品EAV系统的整数表。但是,当我创建该属性时,它看起来该属性正在变为varchar表。创建进入Magento的catalog_product_entity_int表的产品属性
这里是我使用我的模块设置脚本代码:
<?php
$installer = $this;
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$setup->addAttribute('catalog_product', 'review_index', array(
'type' => 'int',
'backend'=> '',
'visible' => 0,
'required' => 0,
'user_defined' => 1,
));
$installer->endSetup();
编辑:由于请求的内容该行的eav_attribute表:
entity_type_id: 4
attribute_code: review_index
attribute_model: NULL
backend_model: <blank>
backend_type: int
backend_table: <blank>
frontend_model: <blank>
frontend_input: text
frontend_label: <blank>
frontend_class: <blank>
source_model: <blank>
is_required: 0
is_user_defined: 1
default_value: <blank>
is_unique: 0
note: <blank>
任何人都知道我是什么做错了?
查看对上述问题的更改。 –
这很奇怪。数据库数据看起来正确,你想要什么。 我会尝试从数据库中删除,然后通过脚本重新安装,或者尝试使用管理员的属性管理器。 –
事实证明,创建该属性始于int,然后当我在管理面板中更新它时,它将变为varchar。为了时间的缘故,我只是将前导零置入,以便按照我想要的方式进行排序。 –