Post by eft0 » Fri Feb 23, 2018 3:31 am

OC version: 3.0.2.0
I need to use the multi-store feature, the 1st store it's working fine, now I need to create a new one.

I want to duplicate the "default" template, and assign it to a new store in the same OC, what I do so far:

- Upload the "default" version of the theme into /catalog/view/theme/tc/
- Modify the /template/common/header.twig for path issues.
- Duplicate /admin/controller/extension/theme/default.php to /admin/controller/extension/theme/tc.php
- In this file, replacing all the "theme_default" to "theme_tc" and the class name
- Duplicate the language files /admin/language/en-gb/extension/theme/default.php to /admin/language/en-gb/extension/theme/tc.php

Now:
- Goint to admin Panel, Extensions -> Modules -> Themes
- Install and activate the "TC" theme, and fill all data.
- System -> Settings -> Stores -> Add New
- Fill all the data and select theme "TC".
- Save and go to the new URL: http://www.todocalculadoras.cl/
- The theme doesnt change (if you view the source code, header seccion (header.twig) does't change the "default" path).

In my cPanel I use the "aditional domains" setting to assign the new domain on the same hosting account, pointing to the same document root.-

1st store working fine: https://www.doce34.cl/
2nd store: http://www.todocalculadoras.cl

I'm with this issue two days now, don't now what else to do, I read some stuff about layouts, but can't understand well, any help or clue will be aprreciate, thanks to all!

Newbie

Posts

Joined
Thu Apr 22, 2010 5:24 am

Post by jan.hermann » Sat Feb 24, 2018 10:30 pm

Hi.

I've been fighting the same problem for about two weeks, and finally got a breakthrough. I've made my own step-by-step guide so i can repeat this at a later time, and it seems there is one file you are missing: “/admin/view/template/extension/theme/default-twig”
Make a copy of it and rename the copy to “/admin/view/template/extension/theme/THEME_NAME.twig”
Open the file and edit it: Replace “default” with “THEME_NAME”. Save

Hope it helps.
My complete step-by-step guide follows, just in case.

This guide assumes you are copying the default OC theme, and is based off of the following forum thread: viewtopic.php?t=185921, with additions found various other places as well as through trial and error.

The guide is a step-by-step guide, and will enable you to completely redesign your theme, including the stylesheet.css for each store in you multistore setup of OC 3.0.2.0.

1. Creating a new theme folder
1.1. “Create catalog/view/theme/THEME_NAME” where “THEME_NAME” is a name you assign. It can be anything, but avoid blank spaces.

1.2. Copy all the files and subfolders in the folder “catalog/view/theme/default“
(or any other folder you want to use as a source for your new theme) to the catalog created above.

1.2.1. Change name of theme preview image located in
“theme/THEME_NAME/image/defult.png “
must be renamed to
“theme/THEME_NAME/image/THEME_NAME.png” in order for the picture to be displayed in the OC admin panel. Ideally a fresh picture of the theme should replace it so you know you’re seeing the right file in OC admin. Use a company logo or any other image temporarily if you want.

1.2.2. Open “theme/THEME_NAME/template/common/header.twig “ in an editor.
Search for “stylesheet.css” and edit the path to
catalog/view/theme/THEME_NAME/stylesheet/stylesheet.css"
Save

2. Make a copy the following files
2.1. “/admin/controller/extension/theme/default.php”
Rename to
“/admin/controller/extension/theme/THEME_NAME.php”

Open the file and edit it:
Replace “default” with “THEME_NAME”
Save

2.2. ”admin/language/en-gb/extension/theme/default.php”
Rename the copy to
”admin/language/en-gb/extension/theme/THEME_NAME.php

Repeate for other languages too if needed.

This is a language file. Copy and replace the word “default” with “THEME_NAME”

2.3. “/admin/view/template/extension/theme/default-twig”
Rename the copy to
“/admin/view/template/extension/theme/THEME_NAME.twig”

Open the file and edit it:
Replace “default” with “THEME_NAME”
Save


3. You can now go to your OC admin panel
3.1. Navigate to Extensions- Extensions
3.1.1. Filter for Themes and see your new Theme at the end of the list.
3.1.2. Enable the theme
3.1.3. Assign it to your store (click the edit button)
3.1.3.1. choose the directory you uploaded at in step 1 and set all the parameters necessary and save.
3.1.3.2. Set status to “enable”

3.2. Navigate to “System – Settings”
3.2.1. edit the store you want to assign the new theme to
3.2.2. select THEME_NAME in the dropdown.

4. If you do not see your theme, do the following:
4.1. Go to your dashboard main page
4.2. Click on the gear-icon in the upper right corner, just below your name and the log-out button.
4.3. Turn OFF caching for the theme
4.4. Hit refresh
4.5. Go back to “step 5 and try again.

Disclaimer:
This worked for me, but I have not done extensive testing to see if there are any bugs and or glitches. Any feedback is welcomed as that may help us all.

Thanks, Hermann.

Newbie

Posts

Joined
Sat Feb 24, 2018 7:54 pm

Post by Tomit » Mon Mar 26, 2018 8:05 pm

Thanks, this step by step guid has helped me a lot!, the theme / template system is quite a pain to get set up correctly..

Since I will need to copy the default theme a few times, I thought it might be easy to create a simple shellscript to do the work for me :) I only tried it on opencart 3.0.2.0 since that is what I'm working with. and it will only copy the default theme.

I thought I'd share it here, remember, use it at your own risk, with caution and only if you know what you are doing (or ar least create a full backup first) !

The file: https://gist.github.com/tom-it/ea1d64f2 ... 0fbca2fcf9

you need terminal access for this.. just upload the shellscript somewhere and give it execute permissions .
Usage: ./duplicate.sh THEMEDIR ADMINDIR COPYNAME

So if the script is in your root file (temporarily offcourse) and you want it to create a copy called test
./duplicate.sh catalog/view/theme admin test

Image


New member

Posts

Joined
Sat Sep 14, 2013 9:54 pm
Location - Netherlands

Post by d3z1gnr » Fri May 18, 2018 4:41 pm

This is excellent. Thank you :)

Mike Little
Director / Developer / Makes the coffee
Creative Digital Limited
http://www.creativedigital.co.nz


User avatar
Active Member

Posts

Joined
Mon Jan 18, 2010 2:59 pm
Location - Auckland, New Zealand

Post by nightwing » Sun May 10, 2020 8:38 pm

Worked 3.0.3.2 Thanks!
jan.hermann wrote:
Sat Feb 24, 2018 10:30 pm
Hi.

I've been fighting the same problem for about two weeks, and finally got a breakthrough. I've made my own step-by-step guide so i can repeat this at a later time, and it seems there is one file you are missing: “/admin/view/template/extension/theme/default-twig”
Make a copy of it and rename the copy to “/admin/view/template/extension/theme/THEME_NAME.twig”
Open the file and edit it: Replace “default” with “THEME_NAME”. Save

Hope it helps.
My complete step-by-step guide follows, just in case.

This guide assumes you are copying the default OC theme, and is based off of the following forum thread: viewtopic.php?t=185921, with additions found various other places as well as through trial and error.

The guide is a step-by-step guide, and will enable you to completely redesign your theme, including the stylesheet.css for each store in you multistore setup of OC 3.0.2.0.

1. Creating a new theme folder
1.1. “Create catalog/view/theme/THEME_NAME” where “THEME_NAME” is a name you assign. It can be anything, but avoid blank spaces.

1.2. Copy all the files and subfolders in the folder “catalog/view/theme/default“
(or any other folder you want to use as a source for your new theme) to the catalog created above.

1.2.1. Change name of theme preview image located in
“theme/THEME_NAME/image/defult.png “
must be renamed to
“theme/THEME_NAME/image/THEME_NAME.png” in order for the picture to be displayed in the OC admin panel. Ideally a fresh picture of the theme should replace it so you know you’re seeing the right file in OC admin. Use a company logo or any other image temporarily if you want.

1.2.2. Open “theme/THEME_NAME/template/common/header.twig “ in an editor.
Search for “stylesheet.css” and edit the path to
catalog/view/theme/THEME_NAME/stylesheet/stylesheet.css"
Save

2. Make a copy the following files
2.1. “/admin/controller/extension/theme/default.php”
Rename to
“/admin/controller/extension/theme/THEME_NAME.php”

Open the file and edit it:
Replace “default” with “THEME_NAME”
Save

2.2. ”admin/language/en-gb/extension/theme/default.php”
Rename the copy to
”admin/language/en-gb/extension/theme/THEME_NAME.php

Repeate for other languages too if needed.

This is a language file. Copy and replace the word “default” with “THEME_NAME”

2.3. “/admin/view/template/extension/theme/default-twig”
Rename the copy to
“/admin/view/template/extension/theme/THEME_NAME.twig”

Open the file and edit it:
Replace “default” with “THEME_NAME”
Save


3. You can now go to your OC admin panel
3.1. Navigate to Extensions- Extensions
3.1.1. Filter for Themes and see your new Theme at the end of the list.
3.1.2. Enable the theme
3.1.3. Assign it to your store (click the edit button)
3.1.3.1. choose the directory you uploaded at in step 1 and set all the parameters necessary and save.
3.1.3.2. Set status to “enable”

3.2. Navigate to “System – Settings”
3.2.1. edit the store you want to assign the new theme to
3.2.2. select THEME_NAME in the dropdown.

4. If you do not see your theme, do the following:
4.1. Go to your dashboard main page
4.2. Click on the gear-icon in the upper right corner, just below your name and the log-out button.
4.3. Turn OFF caching for the theme
4.4. Hit refresh
4.5. Go back to “step 5 and try again.

Disclaimer:
This worked for me, but I have not done extensive testing to see if there are any bugs and or glitches. Any feedback is welcomed as that may help us all.

Thanks, Hermann.

Regards,
Nightwing
Access to my Free Extensions: https://www.opencart.com/index.php?rout ... =nightwing


Active Member

Posts

Joined
Tue Nov 05, 2019 11:08 pm


Post by straightlight » Sun May 10, 2020 10:45 pm

Added to the FAQ. Thank you.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by oc3 » Wed Aug 26, 2020 10:59 pm

hello,

i followed the steps as described, but what i dont seems getting to work is the default path (stylesheet.css) to the new template. can somebody give me a hint?
thx in advance

oc3
Newbie

Posts

Joined
Fri Aug 21, 2020 9:16 pm

Post by khnaz35 » Sat Aug 29, 2020 12:33 am

oc3 wrote:
Wed Aug 26, 2020 10:59 pm
hello,

i followed the steps as described, but what i dont seems getting to work is the default path (stylesheet.css) to the new template. can somebody give me a hint?
thx in advance
Share your code where are you having an issue.

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by sw!tch » Sat Aug 29, 2020 3:34 am

jan.hermann wrote:
Sat Feb 24, 2018 10:30 pm

1.2.2. Open “theme/THEME_NAME/template/common/header.twig “ in an editor.
Search for “stylesheet.css” and edit the path to
catalog/view/theme/THEME_NAME/stylesheet/stylesheet.css"
Save
Did you do this step?

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by frasergoconsultme » Sat Jun 17, 2023 12:30 am

@nightwing
When you state:-
2. Make a copy the following files
2.1. “/admin/controller/extension/theme/default.php”
Rename to
“/admin/controller/extension/theme/THEME_NAME.php”

Open the file and edit it:
Replace “default” with “THEME_NAME”
Save
Do you mean where the word "default" is part of a path, or is for ever mention of the word "default", eg.
'theme_default_image_wishlist_width'
?

Newbie - OC 3.0.3.8 sites


New member

Posts

Joined
Sun Feb 12, 2023 4:36 am

Post by by mona » Sat Jun 17, 2023 1:01 am

theme_default_image_wishlist_width refers to the size of an image in extensions=>extensions=>theme
in this case the image size for the product in the wishlist view

Some themes would create their own sizes for themes others would not.
The actual words theme_default_image_wishlist_width is for a db look up for that setting.

Nightwing was not suggesting to edit those, he was only referring to files.
Those files will contain theme_default_image_wishlist_width and will use the settings in the db for theme_default_image_wishlist_width in accordance with what is entered into the images sizes in extensions=>extensions=>theme

DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.


https://www.youtube.com/watch?v=zXIxDoCRc84


User avatar
Expert Member

Posts

Joined
Mon Jun 10, 2019 9:31 am

Post by frasergoconsultme » Mon Jun 19, 2023 6:54 pm

by mona wrote:
Sat Jun 17, 2023 1:01 am
theme_default_image_wishlist_width refers to the size of an image in extensions=>extensions=>theme
in this case the image size for the product in the wishlist view

Some themes would create their own sizes for themes others would not.
The actual words theme_default_image_wishlist_width is for a db look up for that setting.

Nightwing was not suggesting to edit those, he was only referring to files.
Those files will contain theme_default_image_wishlist_width and will use the settings in the db for theme_default_image_wishlist_width in accordance with what is entered into the images sizes in extensions=>extensions=>theme
Am still a bit confused...eg:
2.3. “/admin/view/template/extension/theme/default-twig”
Rename the copy to
“/admin/view/template/extension/theme/THEME_NAME.twig”

Open the file and edit it:
Replace “default” with “THEME_NAME”
Save
When I open this twig file, there is no path reference to update, other than entries like "<select name="theme_default_directory" id="input-directory" class="form-control">".

Newbie - OC 3.0.3.8 sites


New member

Posts

Joined
Sun Feb 12, 2023 4:36 am

Post by frasergoconsultme » Mon Jun 19, 2023 8:21 pm

Here is a great video which explains it all, some of the default_template entries have to be changed in the associated files...https://youtu.be/K7TUG6ZEnBo

Newbie - OC 3.0.3.8 sites


New member

Posts

Joined
Sun Feb 12, 2023 4:36 am
Who is online

Users browsing this forum: No registered users and 14 guests