Post by none » Sat Mar 20, 2021 3:46 pm

Hi,

Ive got Opencart 3.0.3.7 installed. My problem is that I apply changes to twig files from within Opencart admin but after a day or two they keep rolling back to the original state like I never did anything. Why is it or how can I prevent this? It is very annoying.

I removed "addthis"" script like 5 times + other things. 2 days later social buttons are back again. Why?

New member

Posts

Joined
Wed Sep 09, 2009 3:53 am

Post by xxvirusxx » Sat Mar 20, 2021 4:32 pm

none wrote:
Sat Mar 20, 2021 3:46 pm
I removed "addthis"" script like 5 times + other things. 2 days later social buttons are back again. Why?
Removed from what file?

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by none » Sat Mar 20, 2021 4:40 pm

product.twig

New member

Posts

Joined
Wed Sep 09, 2009 3:53 am

Post by xxvirusxx » Sat Mar 20, 2021 4:44 pm

From theme?

Code: Select all

catalog\view\theme\default\template\product\product.twig
or from storage modification?

Edited how? From admin or using an text editor?

More details...

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by none » Sat Mar 20, 2021 4:52 pm

I used Opencart Design / Theme editor.

New member

Posts

Joined
Wed Sep 09, 2009 3:53 am

Post by xxvirusxx » Sat Mar 20, 2021 4:54 pm

none wrote:
Sat Mar 20, 2021 4:52 pm
I used Opencart Design / Theme editor.
Forget about that s....t :laugh: :laugh:

Edit the file directly with an text editor or from Cpanel, then refresh ocmod modifications, clear theme cache and SASS cache.

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by OSWorX » Sat Mar 20, 2021 4:59 pm

xxvirusxx wrote:
Sat Mar 20, 2021 4:54 pm
none wrote:
Sat Mar 20, 2021 4:52 pm
I used Opencart Design / Theme editor.
Forget about that s....t
And why is this s...t ? ? !
When you post such nonsens, write also why .. otherwise such postings are no benefit and useless.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by xxvirusxx » Sat Mar 20, 2021 5:01 pm

OSWorX wrote:
Sat Mar 20, 2021 4:59 pm
And why is this s...t ? ? !
Because it is useless.
If is not useless for you, then you can use it :)

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by none » Sat Mar 20, 2021 5:05 pm

I dont know if this is nonsense or not. In fact there is a "design editor" has been built in into Opencart which doesnt seem to work. My question is also why this has been added to Opencart 3 if it does not work or if it has not been toughly tested. I found a "fix" but from the developer's description it is still unclear if this is a fix to the same problem or to some other TWIG modification issues.
https://www.opencart.com/index.php?rout ... twig%20fix
It is sad that third party developers have to make patches to Opencart system.
If I was doing something wrong then I would like to know what and why so I can avoid this problem.

New member

Posts

Joined
Wed Sep 09, 2009 3:53 am

Post by OSWorX » Sat Mar 20, 2021 6:45 pm

xxvirusxx wrote:
Sat Mar 20, 2021 5:01 pm
OSWorX wrote:
Sat Mar 20, 2021 4:59 pm
And why is this s...t ? ? !
Because it is useless.
If is not useless for you, then you can use it :)
Well, pretty straight answer.
And again: useless.

Why?
You won't give an answer why the Theme Editor is s***t, so better don't answer in future.

And to elaborate this "thing" a bit: not the editor is s***t, the answers are s***t.
Because the "bug" is not inside the editor, more inside the file and functions how the TWIG engine is initialized and handled.
And to close this thread: this bug has been discussed several times - here and at Github.
And has also a fix - see more in 2nd answer below.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by OSWorX » Sat Mar 20, 2021 6:58 pm

none wrote:
Sat Mar 20, 2021 5:05 pm
I dont know if this is nonsense or not. In fact there is a "design editor" has been built in into Opencart which doesnt seem to work. My question is also why this has been added to Opencart 3 if it does not work or if it has not been toughly tested. I found a "fix" but from the developer's description it is still unclear if this is a fix to the same problem or to some other TWIG modification issues.
https://www.opencart.com/index.php?rout ... twig%20fix
It is sad that third party developers have to make patches to Opencart system.
If I was doing something wrong then I would like to know what and why so I can avoid this problem.
See previous answer about the theme editor!
And regarding this "fix" and this "developer": he is simply copying and paste others work - see this for example:
https://github.com/opencart/opencart/bl ... cation.xml

And more:
https://github.com/opencart/opencart/issues/8867
https://github.com/opencart/opencart/co ... e3dd68e019
viewtopic.php?f=202&t=221131&p=806104#p806095

Fact is, that OC releases are published with a bug not handling templates correct - correct that this is a shame.
But this bug has been solved a long time ago.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by none » Sun Mar 21, 2021 2:05 am

Thanks for the input. Unfortunately replacing the modification.xml did NOT work.
I removed again wishlist, comparison buttons and "addthis" social script from the TWIG files and 2 hours later they are back again in the template.
Extremely annoying.

New member

Posts

Joined
Wed Sep 09, 2009 3:53 am

Post by sw!tch » Sun Mar 21, 2021 5:47 am

In phpMyAdmin go to oc_theme table do you have an entires there, also note the date_added ?

This could also be cache, link to site?

Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by none » Mon Mar 22, 2021 5:40 pm

Hi,

blueberry - common/header - "<!DOCTYPE html> etc etc" - "2021-03-21 06:57:50"

Dates are there an seem to update the date when I apply a change. They still roll back after 1-2 hours.
In Opencart config "file" cache is there. Now despite the fact that I edited the twig files on the hosting the database seems to store a different version. What is the appropriate way to update the database stored version?

New member

Posts

Joined
Wed Sep 09, 2009 3:53 am

Post by paulfeakins » Mon Mar 22, 2021 5:44 pm

none wrote:
Sat Mar 20, 2021 5:05 pm
I dont know if this is nonsense or not. In fact there is a "design editor" has been built in into Opencart which doesnt seem to work. My question is also why this has been added to Opencart 3 if it does not work or if it has not been toughly tested.
Search the forum and you'll find plenty of discussion about this but the summary, as others have said, is don't use it.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Legendary Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by tdaubs » Mon Aug 05, 2024 2:54 am

I'm surprised this is still an issue 3+ years later. Seems like a good idea to just completely disable the entire theme editor until it's fixed.

Image
Opencart Support . Buy Me a Coffee?


User avatar
Active Member

Posts

Joined
Fri Apr 08, 2011 4:51 am
Location - Southern California

Post by by mona » Mon Aug 05, 2024 7:32 am

There are two systems that edit files, the theme editor and the modification system. It is not advised to use both of the systems together unless you know what you are doing because they do not always work together. If you search the forum or use google to search the forum you will find this has been discussed many times. Developers use the modification system. The theme editor is for non-developers. Changing core files is never advised.

It is possible based on your observations of 2 hours that the edits are not "sticking" could be due to the auto modification refresh, again, because they do not work well together if you do nt know what you are doing. The ocmod fix that is a completely different issue from the theme editor.

I presume this is what you want.
https://www.opencart.com/index.php?rout ... n_id=33687
and
https://www.opencart.com/index.php?rout ... n_id=33624


It is sad that third party developers have to make patches to Opencart system.
I disagree. It is very kind of developers, myself included, to have bothered to offer free fixes, improvements and come here to offer support.

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
Who is online

Users browsing this forum: No registered users and 22 guests