以 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. 使用gradle上传项目到jcenter

    想不想把自己的库也上传到jcenter,然后只需要一名话 compile com.zzb.library:android-common:0.1.0 //(compile group_id:artifa ...

  2. Learning Python 007 基本语句

    Python 基本语句 if - 条件判断 没有什么好说的,直接上代码: age = 3 if age >= 18: print('adult') elif age >= 6: print ...

  3. keras安装windows版

    按照官网成功了.下面没有成功,貌似是 Anacode的问题 http://blog.csdn.net/hweiyi/article/details/70018317 http://blog.csdn. ...

  4. MySQL 文件导入出错

    ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot exec ...

  5. <base target="_self"/>标签的用法

    语法 <base target="value"> 属性值 值 描述 _blank 在新窗口中打开被链接文档. _self 默认.在相同的框架中打开被链接文档. _par ...

  6. Spring-boot 项目中使用 jackson 遇到的一个问题

    jackson介绍 java代码中实现序列化和反序列化的工具类 jackson使用Demo https://github.com/Naylor55/JavaDebrisCode/tree/branch ...

  7. 飘逸的python - 装饰器的本质

    很多人把装饰器搞的很复杂,其实本质很简单. 首先,什么是装饰器呢?在代码中发现戴着@xxx帽子的,就是装饰器. 那要怎么自己定义一个装饰器呢? 其实任何一个接收一个参数的callable都可以用来做装 ...

  8. java工具类学习整理——集合

    好久没有总结一些东西了,同时集合部分的知识点也学习的比较早了,但是从来没有抽时间去研究和学习,今天正好有时间就总结一下map常用的遍历方法: package runningwhile; import ...

  9. poj 2068 Nim

    Nim POJ - 2068 题目大意:多组数据,两人轮流操作,n轮一循环,给出总石子数和这n轮每次两人能取的石子上限(下限为1).取到最后一颗者输. /* f[i][j]表示在第i轮中一共有j个石子 ...

  10. bzoj4200: [Noi2015]小园丁与老司机(可行流+dp)

    传送门 这该死的码农题…… 题解在这儿->这里 //minamoto #include<iostream> #include<cstdio> #include<cs ...