José Pinto
José Pinto

Reputation: 151

PHP / OpenCart 2.2.0 - Creating custom theme

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.

Upvotes: 3

Views: 3355

Answers (4)

Remus
Remus

Reputation: 21

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 .

Upvotes: 2

Prasun Jajodia
Prasun Jajodia

Reputation: 470

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.

Upvotes: 0

Phuc Nguyen
Phuc Nguyen

Reputation: 31

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

    Upvotes: 3

    Ali Zia
    Ali Zia

    Reputation: 3875

    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.

    Upvotes: 0

    Related Questions