3

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 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).

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.

Thanks.

José Pinto
  • 161
  • 1
  • 4
  • 8
  • Did you copied all the files from default theme into your new folder? What is the exact path of your customtheme? – Ali Zia Mar 22 '16 at 04:31
  • 2
    You don't need to copy any files into your fresh theme. In the beginning it can be completely empty. No problem. It uses a build in fallback method going back to the default theme if a file is not included. – Klaus Mar 24 '16 at 17:19
  • This is OpenCart 2 Theme development tutorials Written by myself . http://www.kvcodes.com/2016/11/opencart-2-theme-development/ – Kvvaradha Apr 09 '17 at 15:53

4 Answers4

3

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

  • 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

    • thanks i'll try that. I'll up vote the answer if it works and when i test that. Thanks anyway. ;) – José Pinto Mar 24 '16 at 17:33
    • I did this and it kind of works but I have an issue. If I go to Settings->Theme and select the default theme and then go to Extensions->Themes->edit default theme and change the Theme Directory to my custom theme directory then the new theme is reflected in the front end. However if I install my new theme under Extensions->Themes and make sure the Theme Directory is set to the custom theme directory and then go to Settings->Theme and change it to the custom theme then the front end reflects the default theme. What have I missed? Thanks – Bollis May 02 '16 at 03:10
    • The controller thing did it. Opencart sucks big time if such non-obvious things aren't even mentioned in their [documentation](http://docs.opencart.com/developer/module/). – aexl Dec 21 '16 at 13:53
    2

    I had the same problem, the custom theme was not available in the dashboard -> settings -> general -> Theme. I found a detailed solution here: http://undefined.gr/site/2016/10/09/custom-opencart-2-3-0-2-theme .

    Remus
    • 21
    • 2
    0

    You should paste all the files from catalog/view/theme/default/template into catalog/view/theme/default/customtheme. The template folder should be present there.

    Ali Zia
    • 3,539
    • 3
    • 23
    • 63
    0

    As a newbie in opencart who got into this problem after watching the tutorial and downloading opencart 2.3.x, I read that they moved the theme changing thing to

    Extensions >> Extensions >> Themes (in the drop down menu) >> Edit >> Theme Directory.

    Hope this helps a future theme creator who comes here all confused.

    Prasun Jajodia
    • 450
    • 3
    • 14