我已經成功創建了自定義產品類型(測試)。現在我已經按照以下方式爲目錄部分添加了一個屬性。產品類型未針對magento中的custum屬性進行更新
$installer = $this;
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$data=array(
'type'=>'decimal',
'input'=>'text',
'label'=>'Rent Price',
'global'=>Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'is_required'=>'0',
'is_comparable'=>'0',
'is_searchable'=>'0',
'is_unique'=>'0',
'is_configurable'=>'0',
'use_defined'=>'0',
'apply_to' => array('test')
);
$attributeId = $setup->addAttribute('catalog_product','custum_price',$data);
,任何東西都可以正常使用,但該屬性顯示在每一個products.I剛纔檢查的表結構,發現「catalog_eav_attribute」表正在針對此attribute.When我編輯在apply_to場「空」手動設置此字段的值並設置值「test」,屬性開始在測試類型產品中顯示。 但我不想以這種方式更新。請指導我我做錯了什麼。
我找到了solution.check這個http://stackoverflow.com/questions/12051305/adding-attributes-to-custom-product-only?rq=1 – mjdevloper