最新下载
热门教程
- 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自己更改。
相关文章
- mcjs网页版即点即玩-mcjs极速秒玩入口 10-23
- 超星学习通网页版登录-超星学习通官网入口 10-23
- poki免费游戏大全-poki免费游戏在线畅玩入口 10-23
- mc.js官方在线入口 10-23
- 海角haijiao社区2025全新网址一键直达-海角社区最新官方入口地址 10-23
- 王者荣耀世界体力上限与恢复方法详解 王者荣耀世界体力机制全面解析 10-20