Post by Detlev » Tue Nov 01, 2022 6:47 am

i made some design changes in .php .twig .css
probably there won't be any more updates, but maybe I'll learn something... I'm looking for a better approach to overwriting original files with "custom" code without manipulating them myself.
I created the "myfiles" folder.
In it then myphp.php mytwig.twig and mystyle.css
An example: stylesheet.css
#menu
backgroundcolor: #ffffff;
<-- Menu End __>
@import url(/myfiles/mystyle.css);
-------------------------------------------------- ---------
mystyle.css
#menu
backgroundcolor: #bbbbbbb;
<--Menu End__> etc.
It seems logical, but I would have to do some typing with every update and I want to rule out possible sources of error (it's about 14 files where I made some code changes). Surely I could solve the whole thing with php:
<link rel="stylesheet" href="mystyle.css">
I only change one .php - the whole thing would probably be clearer.
Or have the "professionals" been smiling for a while because my way is too "woody"?.
And while we're at it, I'm playing around with version 4.0xx; I despair of just changing the colors of the navbar and the links (blue might be nice, but blue always makes me think of bluescreen :).
after posting i saw i am in the cloud forum, sorry. Please move it.

Newbie

Posts

Joined
Tue Mar 09, 2021 9:56 pm

Post by straightlight » Tue Nov 01, 2022 8:08 am

Detlev wrote:
Tue Nov 01, 2022 6:47 am
i made some design changes in .php .twig .css
probably there won't be any more updates, but maybe I'll learn something... I'm looking for a better approach to overwriting original files with "custom" code without manipulating them myself.
I created the "myfiles" folder.
In it then myphp.php mytwig.twig and mystyle.css
An example: stylesheet.css
#menu
backgroundcolor: #ffffff;
<-- Menu End __>
@import url(/myfiles/mystyle.css);
-------------------------------------------------- ---------
mystyle.css
#menu
backgroundcolor: #bbbbbbb;
<--Menu End__> etc.
It seems logical, but I would have to do some typing with every update and I want to rule out possible sources of error (it's about 14 files where I made some code changes). Surely I could solve the whole thing with php:
<link rel="stylesheet" href="mystyle.css">
I only change one .php - the whole thing would probably be clearer.
Or have the "professionals" been smiling for a while because my way is too "woody"?.
And while we're at it, I'm playing around with version 4.0xx; I despair of just changing the colors of the navbar and the links (blue might be nice, but blue always makes me think of bluescreen :).
after posting i saw i am in the cloud forum, sorry. Please move it.
Take note that when stating 3.0 and up, OC 4 versions have different ways to manage extensions. Which OC version are you using? Events might also be what you're looking for to build as there are also available extensions on the Marketplace that can help you speed up with the process.

More importantly, what are you trying to do with these modifications and where?

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 rjcalifornia » Tue Nov 01, 2022 8:09 am

I'm looking for a better approach to overwriting original files with "custom" code without manipulating them myself.
Consider creating an extension or a theme, depending of the case. Otherwise, you will lose your customizations when you upgrade the version of OpenCart.

Image
A2 Hosting features: Shared Turbo Boost, Managed Warp 1, Unmanaged Hyper 1, and Warp 2 Turbo


Active Member

Posts

Joined
Fri Sep 02, 2011 1:19 pm
Location - Worldwide

Post by Detlev » Wed Nov 02, 2022 5:09 am

I was not unprepared and read that 4.x now works with Action, without oc_mod.
I do already have extensions for 3.x, which works with oc_mod. But as the saying goes? Too many cooks spoil the code...therefore there is no way around custom files. They are also not lost during updates. Custom makes sense... but not always. Sorry, but references to extensions/modules don't help there.
One more thing about rjcalifornia, I read the query regarding Maria-DB.
I read, I can't remember where, that opencart no longer supported Maria-DB at some point between 2.0 and 3.x. There are ways to export data from Maria to MySQL. Everyone recommends updating at least once in a while.
There is also the saying: "Never change a running system". But those were different times... :)

Newbie

Posts

Joined
Tue Mar 09, 2021 9:56 pm

Post by straightlight » Wed Nov 02, 2022 8:13 am

Detlev wrote:
Wed Nov 02, 2022 5:09 am
I was not unprepared and read that 4.x now works with Action, without oc_mod.
I do already have extensions for 3.x, which works with oc_mod. But as the saying goes? Too many cooks spoil the code...therefore there is no way around custom files. They are also not lost during updates. Custom makes sense... but not always. Sorry, but references to extensions/modules don't help there.
One more thing about rjcalifornia, I read the query regarding Maria-DB.
I read, I can't remember where, that opencart no longer supported Maria-DB at some point between 2.0 and 3.x. There are ways to export data from Maria to MySQL. Everyone recommends updating at least once in a while.
There is also the saying: "Never change a running system". But those were different times... :)
Then, you may realize with time that playing with core codes won't help either.

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 rjcalifornia » Wed Nov 02, 2022 10:07 pm

Detlev wrote:
Wed Nov 02, 2022 5:09 am
I was not unprepared and read that 4.x now works with Action, without oc_mod.
I do already have extensions for 3.x, which works with oc_mod. But as the saying goes? Too many cooks spoil the code...therefore there is no way around custom files. They are also not lost during updates. Custom makes sense... but not always. Sorry, but references to extensions/modules don't help there.
One more thing about rjcalifornia, I read the query regarding Maria-DB.
I read, I can't remember where, that opencart no longer supported Maria-DB at some point between 2.0 and 3.x. T
here are ways to export data from Maria to MySQL. Everyone recommends updating at least once in a while.
There is also the saying: "Never change a running system". But those were different times... :)
Yeah, modifying core files is a no-no.

Ok, I can't find what you mention about Opencart no longer supporting MariaDB. As I said recently on a previous post in another thread, I've been using OpenCart 3.x with MariaDB on my local vagrant box.

Image
A2 Hosting features: Shared Turbo Boost, Managed Warp 1, Unmanaged Hyper 1, and Warp 2 Turbo


Active Member

Posts

Joined
Fri Sep 02, 2011 1:19 pm
Location - Worldwide
Who is online

Users browsing this forum: No registered users and 32 guests