【www.bbyears.com--magento】
在根目录创建个脚本文件,内容:
代码如下 require_once("app/Mage.php");Mage::app()->setCurrentStore(Mage::getModel("core/store")->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$installer = new Mage_Sales_Model_Mysql4_Setup;
$attribute = array(
"type" => "int",
"label"=> "Discount(%)",
"input" => "text",
"global" => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
"visible" => true,
"required" => false,
"user_defined" => true,
"default" => "",
"group" => "General Information"
);
$installer->addAttribute("catalog_category", "category_attribute_code ", $attribute);
//$installer->removeAttribute("catalog_category", "category_attribute_hottest");
$installer->endSetup();
自定义属性的label和category_attribute_code自己更改。