以 Jp_Coupon 模块为例:

目标: 在 System configuration 页面添加一个 JP tab, 在JP中添加 Coupon section, 然后给 Coupon section 添加2个配置项

按照以下步骤:

1. app/code/local/Jp/Coupon/ect/system.xml 文件

添加 jp tab 和 jp_coupon section

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0"?>
<config>
    <tabs>
        <jp translate="label" module="jp_coupon">
            <label>JP Extentions</label>
            <sort_order>200</sort_order>
        </jp>
    </tabs>
    <sections>
        <jp_coupon translate="label" module="jp_coupon">
            <label>jp Coupon</label>
            <tab>jp</tab>
            <frontend_type>text</frontend_type>
            <sort_order>40</sort_order>
            <show_in_default>1</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <general translate="label">
                    <label>General</label>
                    <frontend_type>text</frontend_type>
                    <sort_order>100</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <config_item1 translate="label">
                            <label>Config Item 1</label>
                            <frontend_type>text</frontend_type>
                            <sort_order>1</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </config_item1 >
                        <config_item2 translate="label">
                            <label>Config Item 2</label>
                            <frontend_type>text</frontend_type>
                            <sort_order>2</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </config_item2 >
                    </fields>
                </general>
            </groups>
        </jp_coupon>
    </sections>
</config>

2. app/code/local/Jp/Coupon/ect/adminhtml.xml 文件

设置jp_coupon配置页面的访问权限

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<config>
    <acl>
        <resources>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <jp_coupon translate="title" module="jp_coupon">
                                        <title>jp Coupon</title>
                                    </jp_coupon>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</config>

3. 清除Magento缓存,重新登录

如果您觉得阅读本文对您有帮助,欢迎转载本文,但是转载文章之后必须在文章页面明显位置保留此段声明,否则保留追究法律责任的权利。

作  者:www.jpdou.top

原文链接:http://www.jpdou.top/add-config-in-magento/

在Magento System Configuration页面添加配置项的更多相关文章

  1. 如何给magento的产品页面添加返回按钮

    如何给magento的产品页面添加返回按钮,最模板提供教程 第一步: 打开 E:\xampp\htdocs\magento\skin\frontend\default\bluescale\css\st ...

  2. Magento给新产品页面添加分页

    本文介绍如何让magento创建一个带分页功能的新到产品页面,方便我们在首页或者其它CMS Page调用和展示新到产品. 在Magento我们经常有的做法是建立一个可以调用新产品的block,然后通过 ...

  3. System.Configuration引用后ConfigurationManager方法用不了

    System.Configuration引用后ConfigurationManager方法却用不了,提示没有引用 需手动添加引用 项目-引用-右击-添加引用-找到System.Configuratio ...

  4. 如何给你的ASP.NET页面添加HelpPage

    如何给你的ASP.NET页面添加HelpPage 最近写了一些webAPI,所以需要搞一套API的帮助文档,google了一下,发现这是可以自动生成的,以下就是如何自动生成HelpPage的说明. 参 ...

  5. drupal7为admin/config页面添加自己开发的模块

    1.实现显示模块 //admin/config配置页面添加journal块 $items['admin/config/journal'] = array(//注意格式为'admin/config/模块 ...

  6. 引用了System.Configuration命名空间,却找不到ConfigurationManager类

    用ConfigurationManager类来读取应用程序配置文件的信息时,提示:System.Configuration命名空间下找不到ConfigurationManager类 查过资料后得知:要 ...

  7. 为sharepoint的内部页面添加后台代码

    我们知道,存储在数据库里的SharePoint页面是不能直接添加后台代码的,这给我们带来了很多的不方便,比如想要在页面上实现一些东西,都必 须使用Webpart或者自定义控件的方式,哪怕仅仅是很简单的 ...

  8. Magento获取当前页面URL地址

    Magento获取当前页面URL地址 http://www.sunhaibing.com/?p=1260 在Magento中,可以通过core/url助手类中的getCurrentUrl()方法获取当 ...

  9. System.Configuration.ConfigurationManager.cs

    ylbtech-System.Configuration.ConfigurationManager.cs 1.程序集 System.Configuration, Version=4.0.0.0, Cu ...

随机推荐

  1. [poj3311]Hie with the Pie(Floyd+状态压缩DP)

    题意:tsp问题,经过图中所有的点并回到原点的最短距离. 解题关键:floyd+状态压缩dp,注意floyd时k必须在最外层 转移方程:$dp[S][i] = \min (dp[S \wedge (1 ...

  2. Linux服务器监控工具--Nmon介绍

    一.Nmon介绍(详细请参考百度百科) 是一款分析 AIX 和 Linux 性能的免费工具,这个高效的工具可以工作于任何哑屏幕.telnet 会话.甚至拨号线路.另外,它并不会消耗大量的 CPU 周期 ...

  3. Asp.net 微信企业号网页开发流程

    一.在pageload方法中获取code var code = GetCode(); private string GetCode() { return HttpContext.Current.Req ...

  4. sklearn解决过拟合的例子

    Learning curve 检视过拟合 sklearn.learning_curve 中的 learning curve 可以很直观的看出我们的 model 学习的进度, 对比发现有没有 overf ...

  5. 21. Bypass D盾_防火墙(旧版 and 新版)SQL注入防御(多姿势)

    D盾旧版: 00前言 D盾_IIS防火墙,目前只支持Win2003服务器,前阵子看见官方博客说D盾新版将近期推出,相信功能会更强大,这边分享一下之前的SQL注入防御的测试情况.D盾_IIS防火墙注入防 ...

  6. 【mysql 统计分组之后统计录数条数】

    SELECT count(*) FROM 表名 WHERE 条件 // 这样查出来的是总记录条   SELECT count(*) FROM 表名 WHERE 条件 GROUP BY id //这样统 ...

  7. mobile web页面调试方法

    此文已由作者张含会授权网易云社区发布. 欢迎访问网易云社区,了解更多网易技术产品运营经验. 开发过程问题排查 Chrome Emulation关键词:使用方便 模拟各种设备尺寸.像素比.自定义user ...

  8. Note: File Recipe Compression in Data Deduplication Systems

    Zero-Chunk Suppression 检测全0数据块,将其用预先计算的自身的指纹信息代替. Detect zero chunks and replace them with a special ...

  9. C - Trailing Zeroes (III)(二分)

    You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in d ...

  10. 51nod1489(dfs)

    题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1489 题意:中文题诶- 思路:dfs 首先我们要通过攻击第1 ...