Page 1 of 1

Changing Themes in 3.0.2.0

Posted: Wed Jul 19, 2017 6:42 am
by SoccerGuy3
New to OpenCart, but surely this isn't that hard... I want to make some simple changes to the default theme. I created a new directory at catalog >> view >> theme called "newtheme". Created image, stylesheet and template directories inside that. When I go into the admin at System >> Settings >> select my store I only see the default theme there for selection under Themes. There isn't really any info on this on the web yet (since 3.0 is so new I guess). Help!

Re: Changing Themes in 3.0.2.0

Posted: Thu Jul 20, 2017 1:42 am
by cyclops12
Try going into extensions/extensions and choose Themes from the dropdown
Edit your theme and you should be able to select your new theme in the Theme Directory dropdown

Re: Changing Themes in 3.0.2.0

Posted: Wed Jul 26, 2017 1:17 am
by MarcPinnell
I had to change usernames as my other user can't reply for some reason...

Anyway, I can see the newtheme under extensions >> Themes >> edit >> Theme Directory

However, if I go to System >> Settings >> "Store" Edit >> General, it shows the default theme and only the default theme under the drop in the Theme section. The preview is the default theme as well.

The public side of the store is showing the "newtheme" design. This doesn't make any sense.

Re: Changing Themes in 3.0.2.0

Posted: Wed Jul 26, 2017 3:22 am
by labeshops
There are a lot of things it seems where "enabling" does not stick. Themes are one of them for me.

Re: Changing Themes in 3.0.2.0

Posted: Mon Jul 31, 2017 2:44 am
by cyclops12
MarcPinnell wrote:
Wed Jul 26, 2017 1:17 am
I had to change usernames as my other user can't reply for some reason...

Anyway, I can see the newtheme under extensions >> Themes >> edit >> Theme Directory

However, if I go to System >> Settings >> "Store" Edit >> General, it shows the default theme and only the default theme under the drop in the Theme section. The preview is the default theme as well.

The public side of the store is showing the "newtheme" design. This doesn't make any sense.
Yes if you look at the code for the settings page it is not coded to show what actual theme you have installed.....only the text "Default Store Theme"

Re: Changing Themes in 3.0.2.0

Posted: Thu Aug 31, 2017 7:38 pm
by BigSoft
To install or make installable a new theme THEMENAME for Opencart 3 (may not be the complete intention of developers but it just worked for me - i hope i recall all the steps):

1. Copy all the files to catalog/view/theme/THEMENAME
2. Create the files
./admin/language/en-gb/extension/theme/THEMENAME.php (other languages too if needed)
./admin/view/template/extension/theme/THEMENAME.twig
./admin/controller/extension/theme/THEMENAME.php
as the respective default theme files and replacing theme_default with theme_THEMENAME, heading title on language files etc
3. You can now go to Extensions- Extensions Filter Themes and see your new Theme. Enable, choose the directory you uploaded at in step 1 and set all the parameters necessary and save
4. You can now go to System Settings edit your store(s) and select the NEWTHEME

You should now be seeing your new theme (assuming client/server caches are set to renew)

Hope it helps

Re: Changing Themes in 3.0.2.0

Posted: Wed Sep 13, 2017 12:35 am
by jon.mosier@mac.com
Thank you for your post. It has helped me get a bit further.

I simply duplicated the Default theme and tried to change everything to jon instead of default (...public_html/catalog/view/theme/jon/). After applying the steps from your post, I'm able to select the theme in the admin now, but get the following error when I try to apply it to my store.

Fatal error: Uncaught Error: Class 'Controllerextensionthemejon' not found in .../storage/modification/system/engine/action.php:71 Stack trace: #0 .../storage/modification/system/engine/loader.php(48): Action->execute(Object(Registry), Array) #1 .../public_html/admin/controller/extension/extension/theme.php(44): Loader->controller('extension/theme...') #2 .../storage/modification/system/engine/action.php(79): ControllerExtensionExtensionTheme->uninstall() #3 .../public_html/admin/controller/startup/router.php(26): Action->execute(Object(Registry), Array) #4 .../storage/modification/system/engine/action.php(79): ControllerStartupRouter->index() #5 .../public_html/system/engine/router.php(67): Action->execute(Object(Registry)) #6 .../public_html/system/engine/router.php(56): Router->execute(Object(Action)) #7 /v in .../storage/modification/system/engine/action.php on line 71

Any ideas would be greatly appreciated.

Thanks,
Jon

Re: Changing Themes in 3.0.2.0

Posted: Sun Sep 24, 2017 4:34 pm
by justcurious
Try changing the second line of the file admin/controller/extension/theme/your_theme.php from:

class ControllerExtensionThemeDefault extends Controller {

to:
class ControllerExtensionThemeYourTheme extends Controller {

Note the capitalisation of the theme name !

.

Re: Changing Themes in 3.0.2.0

Posted: Tue Oct 03, 2017 8:21 am
by archaeopteryx
In the newly created mytheme.twig template do i replace all 48 occurrences of theme_default_* mentioned in all the name attributes for different elements? I have followed the steps to the "T" and when i try to enable my theme i get an internal server error... you can see my post where i go through the steps here viewtopic.php?f=202&t=187122#top

Re: Changing Themes in 3.0.2.0

Posted: Tue Oct 03, 2017 3:19 pm
by justcurious
To turn on error reporting edit the file 'php.ini' and add the following lines (or uncomment them). Make sure also that error reporting is set to 'display' in your Opencart (Server) settings.
display_errors = 1
error_reporting = E_ALL


The problem is almost certainly the second line of the file admin/controller/extension/theme/MyTheme.php (see my previous post).

.

Re: Changing Themes in 3.0.2.0

Posted: Tue Oct 03, 2017 8:17 pm
by straightlight
justcurious wrote:
Tue Oct 03, 2017 3:19 pm
To turn on error reporting edit the file 'php.ini' and add the following lines (or uncomment them). Make sure also that error reporting is set to 'display' in your Opencart (Server) settings.
display_errors = 1
error_reporting = E_ALL


The problem is almost certainly the second line of the file admin/controller/extension/theme/MyTheme.php (see my previous post).

.
Do NOT operate these commands if running on a production network. This is strongly suggested to use in a development environment network or with virtual tools.

As for replacing the controller name, take note that the URLs as well as some possible key names inside the custom extension theme file may also need to be changed since they may work in an associative way.

Re: Changing Themes in 3.0.2.0

Posted: Wed Oct 04, 2017 2:35 am
by justcurious
Straightlight is of course correct. You should not use those commands if it is a production environment.

I should also have made clear that I was replying directly to archaeopteryx who had indicated that he had created the controller file in question from a copy of an existing controller file and had already made the necessary changes to urls and relevant key names.

.

Re: Changing Themes in 3.0.2.0

Posted: Fri Oct 06, 2017 5:43 pm
by somjai007
Try visiting the extension / extension and selecting a theme from the drop-down menu.
Edit your theme and you'll be able to choose a new theme in the Themes drop-down menu.


สูตรบาคาร่า