最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Magento中目录添加自定义属性代码
时间:2022-06-25 18:33:34 编辑:袖梨 来源:一聚教程网
在根目录创建个脚本文件,内容:
| 代码如下 | 复制代码 |
| 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自己更改。
相关文章
- 星火教育app如何开启学习 04-07
- 多闪抖音聊天版网页版入口在哪 04-07
- 微信转账限额每天何时刷新 04-07
- 哪里能免费在线看4k动漫官网 04-07
- 微博网页版隐私设置选项在哪 04-07
- 高德地图怎么预估打车费用 04-07