0

I have been searching for documentation on how to create a custom theme in Opencart 2.3.x but this seems to be limited (or non-existent). I have found a couple of posts here but none of them answer the specific issue I'm seeing, which has been raised by others such as here (see comment by @Bollis).

In Opencart 2.3.x it appears themes work slightly differently to previously. Here's what I have done in line with recommendations on how to create a custom theme:

  1. Duplicate the default theme controller (theme_default.php) under /admin/controller/extension/theme/ to theme_mythemename.php and named the controller class ControllerThemeThemeMythemename - replaced all theme_default occurrences within the file to theme_mythemename.
  2. Duplicate the default view admin/view/template/extension/theme/theme_default.tpl and named it theme_mythemename.tpl - again, replaced all theme_default occurrences within the file to theme_mythemename.
  3. Duplicate the default language file in admin/language/extension/theme/theme_default.php and named it theme_mythemename.php - again, replaced all 'default' occurrences within the file to 'mythemename'.
  4. Made a copy of /catalog/view/theme/default directory to mythemename.
  5. Edit catalog/view/theme/mythemename/template/common/header.tpl so that it points to the correct 'copied' stylesheet rather than the default <link href="catalog/view/theme/mythemename/stylesheet/stylesheet.css" rel="stylesheet">

I then installed the theme under Extensions > Themes, enabled it and ensured the directory is set to mythemename. Under my store I then also selected it as the theme. The result is that the default theme still seems to load - I can see in the DOM explorer that it's still loading the default stylesheet and also changes to header.tpl in mythemename are not reflected. It's strange, as if I don't install the theme and I modify the Default Store Theme to point to mythemename directory, all works. But, I want to create a new theme, not modify the default theme.

Any help appreciated.

Thanks.

Community
  • 1
  • 1

0 Answers0