在Magento System Configuration页面添加配置项


以 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"?>
>
    >
        translate="label" module="jp_coupon">
            >
JP Extentions>
            >200>
        >
    >
    >
        translate="label" module="jp_coupon">
            >
jp Coupon>
            >jp>
            >text>
            >40>
            >1>
            >1>
            >1>
            >
                translate="label">
                    >
General>
                    >text>
                    >100>
                    >1>
                    >1>
                    >1>
                    >
                        translate="label">
                            >
Config Item 1>
                            >text>
                            >1>
                            >1>
                            >1>
                            >1>
                        >
                        translate="label">
                            >
Config Item 2>

                            >text>
                            >2>
                            >1>
                            >1>
                            >1>
                        >
                    >

                >
            >
        >
    >
>

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
>
    >
        >
            >
                >
                    >
                        >
                            >
                                >
                                    translate="title" module="jp_coupon">
                                        >
jp Coupon>
                                    >
                                >
                            >
                        >
                    >
                >
            >
        >
    >
>

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

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

作  者:www.jpdou.top

原文链接:在Magento System Configuration页面添加配置项