我創建了一個名爲sales_index的Magento屬性。我已經在我創建的模塊中將該屬性創建爲安裝腳本中的一個整數。這是我已經把我的安裝腳本:Varien_Data_Form_Element_Int未在Magento中找到
$installer = $this;
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$installer->startSetup();
$setup->addAttribute('catalog_product', 'sales_index', array(
'input' => 'int',
'type' => 'int',
'backend' => '',
'visible' => 0,
'required' => 0,
'user_defined' => 1,
));
$installer->endSetup();
屬性似乎沒有錯誤,從安裝程序給出正確地創建。然而,當我移動sales_index屬性默認產品屬性組和負載的產品之一在管理面板我得到以下錯誤:
Fatal error: Class 'Varien_Data_Form_Element_Int' not found in /var/www/vhosts/workingperson.com/magento/lib/Varien/Data/Form/Abstract.php on line 129
所以我想我可以利用這個屬性被默認的屬性組,並罰款。無論如何,我正計劃在後臺設置這個值。但是,當我加載一個產品時,這個值不會隨之而來。該值正在數據庫中設置,它只是沒有被加載。
我假設我在創建不容易察覺的屬性時做了錯誤。
有誰知道我必須做些什麼才能使其正常工作?
如果您想要在產品的編輯頁面上看到文本框,請將其更改爲「text」。 – clockworkgeek 2011-04-19 18:10:25