是否可以进行一个属性,即文件上传(而不是图像)?我试过这样:
<?php
$installer = $this;
$installer->startSetup();
$attribute = array(
'type' => 'file',
'label'=> 'Catalog Pdf',
'input' => 'file',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => "",
'group' => "General Information"
);
$installer->addAttribute('catalog_category', 'catalog_pdf', $attribute);
$installer->endSetup();
它在类别中显示文件上传,但可能有问题,因为安装后子类别没有显示(ajax问题),在前端类别视图中,我得到"处理您的请求时出错"
文件上传属性类型不存在。因此,在安装时运行的sql正在创建问题
尝试以下操作:'type'=>'varchar',"输入"=>"图像"
这使得输入类型为文件上传,但在默认图像处理中进行处理'backend_model'=>'xxx'
在这里,您可以指定在哪里处理