PHP/OpenCart 2.2.0-创建自定义主题 [英] PHP / OpenCart 2.2.0 - Creating custom theme

查看:112
本文介绍了PHP/OpenCart 2.2.0-创建自定义主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天开始在OpenCart 2.2中进行主题开发,并且关注本文:

i'm starting today with theme development in OpenCart 2.2 and i'm following this article:

http://code .tutsplus.com/tutorials/create-a-custom-theme-with-opencart-introduction--cms-21786

Wich使用opencart的1.5.6.1版本. (对于2.2版,我对此一无所获,所以我认为它必须相同).

Wich uses the 1.5.6.1 version of opencart. (I can't find nothing about this for version 2.2, so i assumed it must be the same).

据我了解,我们应该在catalog/view/theme中创建主题目录.为了进行测试,我创建了一个"customtheme"目录,并从默认主题复制了dir结构.

As a i understand we should create the theme directory in catalog/view/theme. For test pourposes i created a "customtheme" directory and copied the dir structure from the default theme.

问题在于,当我转到仪表板->设置->常规->主题时,选择框不会显示我创建的新主题.

The problem is that when i go to dashboard -> settings -> general -> Theme, the selectbox doesn't show the new theme i created.

我在做什么错? 我应该修改默认主题吗?这似乎并不是最好的选择.

What am i doing wrong? Should i just modify the default theme? it doesnt seem to be the best path to follow.

谢谢.

推荐答案

将默认主题复制到名为 duplicate 的文件夹时,我遇到了同样的问题,因此我研究了代码.主题的admin扩展实际上是为我没有的新主题寻找控制器.所以我所做的是

I had the same issue when duplicating the default theme into a folder named duplicate, so I looked into the code. The admin extension for theme actually looks for a controller for the new theme which I didn't have; so what I did were

  • /admin/controller/theme/下的默认主题控制器( theme_default.php )复制到 theme_duplicate.php 中,并将其命名为控制器 ControllerThemeThemeDuplicate
  • 将所有键 theme_default 替换为 theme_duplicate
  • 复制默认视图admin/view/template/theme/theme_default.tpl,并将其命名为theme_duplicate.tpl
  • 我还复制了语言文件,并将其命名为 theme_duplicate.php .我还更新了新的重复语言文件中的一些文本.
  • Duplicate the default theme controller (theme_default.php) under /admin/controller/theme/ into theme_duplicate.php and named the controller ControllerThemeThemeDuplicate
  • Replace all the keys theme_default with theme_duplicate
  • Duplicate the default view admin/view/template/theme/theme_default.tpl and named it theme_duplicate.tpl
  • I also duplicated the language file and named it theme_duplicate.php. I also updated a couple of texts inside the new duplicated language file.
  • 现在,如果您查看扩展程序/修改/主题",您将看到您的新主题,并且应该可以在设置下对其进行更新

    Now if you look into the Extensions/Modifications/theme, you will see your new theme and it should so also be ready to be updated under settings

    这篇关于PHP/OpenCart 2.2.0-创建自定义主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆