Why is OpenCart 2.3 custom theme not showing?

帅比萌擦擦* 提交于 2019-11-28 11:35:08
Rashedul Islam Sagor

Opencart 2.3.0 :

Go to Extestions >> Extestions >> Choose the extension type >> Select Themes >> Edit Your themes >> change default theme. See screenshots:

1 : https://postimg.cc/image/ds02xcmbp/

2 : https://postimg.cc/image/bre4q9fk5/

In file <Your project name>/catalog/controller/event/theme.php replace row 16 from:

$theme = $this->config->get('config_theme');

to:

$theme = $this->config->get($this->config->get('config_theme') . '_directory');

I know it's bit late to answer but it can be helpful to others.

In OpenCart 2.3.0.2 creating a custom theme is little complex , finally i found this doc here which helped me a lot http://undefined.gr/site/2016/10/09/custom-opencart-2-3-0-2-theme/

To start with copy the default folder found in upload/catalog/view/theme/default to a new folder in the same directory. Name it “mytheme“.

Then copy the theme_default.php file in upload/admin/controller/extension/theme and place it in same directory. Name it “mytheme.php“.

  • Rename the class to (line 2):

ControllerExtensionThemeMyTheme + Replace all “theme_default” text to “mytheme“. Yes there are a lot (197).

Copy the theme_default.tpl in upload/admin/view/template/extension/theme and place it in the same directory. Name it “mytheme.tpl“.

  • Replace all “theme_default” text to “mytheme“. (48)

Copy theme_default.php in upload/admin/language/en-gb/extension/theme and place it in the same directory. Name it “mytheme.php“.

  • Set the new theme’s title in heading_title (line 3) to “My Theme”.

Finally for the thumnail image to show correctly in store settings rename default.png to mytheme.png in upload/catalog/view/theme/mytheme/image Now go into your Administration > Extensions > Extensions and select Themes in “Choose the extension type”. You should be seeing your new theme. Install it with the green (+) button and edit it to enable it. Also ensure you set the correct theme directory whilst editing the theme!

Then in System > Settings edit your store to use your new theme.

That should do it. You can now go ahead and start chopping and changing the default theme

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!