Hello. I installed OpenCart Theme Example. Folder of theme example appeared in extensions.
I would like to use its controller - header.php and CSS files for new theme. I need just transfer file from controller/common folder to extension/oc_theme_example folder?
I would like to use its controller - header.php and CSS files for new theme. I need just transfer file from controller/common folder to extension/oc_theme_example folder?
No. It won't use a new ../controller/header.php in the extension folder.
-
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS
What made you think a template in OC4 is different from previous OC versions?
From what I understand from your post you have created an extension not a theme.
Themes are in extension extension themes and selected in settings
I am sure if you search google you will find other "tutorials", this seems pretty comprehensive (I have only had a quick glance) and it is for OC2, but the methodology is the same.
https://blog.templatetoaster.com/how-to ... art-theme/
1. You use css by using selectors and stylesheets.
2. You edit controllers with events for OC4, instead of ocmod in OC3 and OC2 and vqmod in OC1 and OC2 (and is still used in OC3 and OC4 although not globally)
From what I understand from your post you have created an extension not a theme.
Themes are in extension extension themes and selected in settings
I am sure if you search google you will find other "tutorials", this seems pretty comprehensive (I have only had a quick glance) and it is for OC2, but the methodology is the same.
https://blog.templatetoaster.com/how-to ... art-theme/
1. You use css by using selectors and stylesheets.
2. You edit controllers with events for OC4, instead of ocmod in OC3 and OC2 and vqmod in OC1 and OC2 (and is still used in OC3 and OC4 although not globally)
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
Thanks for link. I already went over some articles.by mona wrote: ↑Tue Aug 20, 2024 3:47 pmWhat made you think a template in OC4 is different from previous OC versions?
From what I understand from your post you have created an extension not a theme.
Themes are in extension extension themes and selected in settings
I am sure if you search google you will find other "tutorials", this seems pretty comprehensive (I have only had a quick glance) and it is for OC2, but the methodology is the same.
https://blog.templatetoaster.com/how-to ... art-theme/
1. You use css by using selectors and stylesheets.
2. You edit controllers with events for OC4, instead of ocmod in OC3 and OC2 and vqmod in OC1 and OC2 (and is still used in OC3 and OC4 although not globally)
For theme in:
extension/theme/catalog/controller/startup/theme.php
need add common/header in:
Code: Select all
public function event(string &$route, array &$args, mixed &$output): void
{
$override = [
'common/header',
];
if (in_array($route, $override)) {
$route = 'extension/theme/' . $route;
}
}
For example if add common/footer code in startup controller and put footer.twig in to extension/theme/catalog/view/template/common, there will be possibility to change a design of footer.twig
According stylesheet.css:
Code: Select all
<link href="extension/webocreation4/catalog/view/stylesheet/stylesheet.css" type="text/css" rel="stylesheet"/>
Looks like events very simple way to modify the code. I will discover more about all of that, thank you for helping I appreciate that!
Does anyone know how to override controllers correctly? I can't find the instructions unfortunately.
Who is online
Users browsing this forum: No registered users and 4 guests