如何给magento的产品分类创建一个自定义属性?
来源:互联网 发布:oracle数据库迁移文档 编辑:程序博客网 时间:2024/05/23 10:17
在根目录创建个脚本文件,内容:
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自己更改。
脚本跑一遍,就在magento后台分类编辑页面的General Information组里新加了自定义属性。
0 0
- 如何给magento的产品分类创建一个自定义属性?
- 如何给magento的产品分类创建一个自定义属性?
- 给分类添加一个属性,模块sql的方式 -- magento
- magento -- 如何取得一个分类的所有产品
- 如何去掉magento产品的系统属性
- magento -- 如何为商品分类(category)添加自定义属性
- magento -- 如何为商品分类(category)添加自定义属性
- Magento如何获取产品所在的所有分类?
- magento add product attribute set sql 通过插件的sql部分,给产品增加一个属性代码
- Bigcommerce: 给模板添加一个自定义的产品属性,使用$GLOBALS全局变量调用
- magento - 如何给magento中的产品随机定义相关产品和交叉产品,推荐产品
- magento -- 获得产品所属于的分类
- Magento获取指定分类下的产品
- magento - 通过如何在magento的模板中获取到产品或产品分类的instance呢谈magento的helper类机制
- magento 获取产品分类
- 如何给分类增加一个属性(后台)
- 如何利用运行时给系统分类添加一个属性?
- OC运行时语言--如何给一个分类添加属性
- Android中的Selector
- Intent
- android:duplicateParentState 让子View跟随其Parent的状态
- 3.java设计模式(读书笔记)适配器模式
- (一)RecyclerView简单使用总结
- 如何给magento的产品分类创建一个自定义属性?
- Linux入门:常用命令:rpm、yum
- 帮助命令
- CUDA 学习(十一)、共享内存
- php请求url过长改用curl
- 打开文件练习
- android:includeFontPadding的使用:清除TextView字体周边空白
- oracle表的创建及管理 主键自增 外键等
- 转载获取路径C#中AppDomain.CurrentDomain.BaseDirectory与Application.StartupPath的区别