【发布时间】:2015-07-20 17:11:53
【问题描述】:
我正在尝试将自定义属性字段添加到 Magento 1.8+ 数据库中的 sales_flat_order 表中。我需要创建一个新的管理员主题吗?
<?php
$installer = $this;
$installer->startSetup();
$installer->addAttribute("order", "my_custom_input_field", array("type"=>"varchar"));
$installer->addAttribute("quote", "my_custom_input_field", array("type"=>"varchar"));
$installer->endSetup();
【问题讨论】:
-
您需要一个设置脚本来将自定义字段添加到数据库。如果您计划对管理模板文件进行大量修改,我建议您创建一个管理主题来限制重写次数、自定义 layout.xml 以重写模板或编辑核心文件。
标签: magento