Php 在Magento中创建进入catalog_product_entity_int表的产品属性
在Magento中,我试图创建一个产品属性,该属性将进入产品EAV系统的整数表。但是,当我创建该属性时,该属性似乎是varchar table 以下是我用于模块设置脚本的代码:Php 在Magento中创建进入catalog_product_entity_int表的产品属性,php,magento,Php,Magento,在Magento中,我试图创建一个产品属性,该属性将进入产品EAV系统的整数表。但是,当我创建该属性时,该属性似乎是varchar table 以下是我用于模块设置脚本的代码: <?php $installer = $this; $setup = new Mage_Eav_Model_Entity_Setup('core_setup'); $installer->startSetup(); $setup->addAttribute('catalog_product
<?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_属性表中。请参见上述问题的更改。这很奇怪。数据库数据看起来符合您的要求。我会尝试从数据库中删除,然后通过脚本重新安装,或者尝试从管理员处使用属性管理器。事实证明,创建属性的开始是一个int,然后当我在管理面板中更新它时,它会被更改为varchar。为了节省时间,我只放了前导零,这样它就会按照我想要的方式排序。
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>