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!
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.
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
Mike Little
Director / Developer / Makes the coffee
Creative Digital Limited
http://www.creativedigital.co.nz
jan.hermann wrote: ↑Sat Feb 24, 2018 10:30 pmHi.
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
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Share your code where are you having an issue.
Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature
Did you do this step?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
Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!
When you state:-
Do you mean where the word "default" is part of a path, or is for ever mention of the word "default", eg.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
?'theme_default_image_wishlist_width'
Newbie - OC 3.0.3.8 sites
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
Am still a bit confused...eg:by mona wrote: ↑Sat Jun 17, 2023 1:01 amtheme_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
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">".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
Newbie - OC 3.0.3.8 sites
Newbie - OC 3.0.3.8 sites
Users browsing this forum: No registered users and 14 guests