Post by PerHellander » Thu Jan 16, 2020 6:53 am

Hi!

Can someone please tell me how to edit template for invoice (order_invoice.twig)?
I change the file and save it but changes doesn't show when I'm logging in as
admin and show an invoice.

Pelle

Newbie

Posts

Joined
Wed Apr 03, 2019 5:25 am

Post by OSWorX » Thu Jan 16, 2020 4:30 pm

Guess you forgot to delete the cache.
Backend > main page > top right >> click on the gear button . . and delete cache.

If yo uhave also OCMod or/and VQMod related extension, this cache files have to be deleted too.

Custom Development | Individuelle Entwicklung | Support & Bugfixes

Image Image Image


User avatar
Guru Member

Posts

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

Post by paulfeakins » Thu Jan 16, 2020 8:54 pm

If you have ever edited it through the admin then changes to the files won't take effect.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by OSWorX » Fri Jan 17, 2020 1:16 am

paulfeakins wrote:
Thu Jan 16, 2020 8:54 pm
If you have ever edited it through the admin then changes to the files won't take effect.
How do you mean that?
If a template file is edited through the internal template editing extension (that's why it is for), the output should be displayed with the changes.

Custom Development | Individuelle Entwicklung | Support & Bugfixes

Image Image Image


User avatar
Guru Member

Posts

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

Post by cyclops12 » Fri Jan 17, 2020 1:36 am

OSWorX wrote:
Fri Jan 17, 2020 1:16 am
paulfeakins wrote:
Thu Jan 16, 2020 8:54 pm
If you have ever edited it through the admin then changes to the files won't take effect.
How do you mean that?
If i am not mistaken then if you use the theme editor to edit a file then the file is saved in the database and used when called
So if you then later go on to edit the same file directly you will not see the changes as the saved database file is called

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by OSWorX » Fri Jan 17, 2020 2:23 am

cyclops12 wrote:
Fri Jan 17, 2020 1:36 am
OSWorX wrote:
Fri Jan 17, 2020 1:16 am
paulfeakins wrote:
Thu Jan 16, 2020 8:54 pm
If you have ever edited it through the admin then changes to the files won't take effect.
How do you mean that?
If i am not mistaken then if you use the theme editor to edit a file then the file is saved in the database and used when called
So if you then later go on to edit the same file directly you will not see the changes as the saved database file is called
Ah, okay 2 different cases!
My own fault, did not think that someone may edit the file(s) by the integrated theme editor AND also directly.
Who would do such useless grap?

So the sentence
If you have ever edited it through the admin then changes to the files won't take effect.
has to be read correctly .. and is wrong.

If someone edit the file by the integrated editor - Theme Editor - the changes are displayed right after saving the change.
This "new" template is stored in the database from where it is always called when the template is required.

Another story is when someone edit the file "manual" means with an editor on his PC/Mac.
And loads after editing this file with FTP back into the shop.

What is important and valid for all cases: if OCMod and/or VQMod is used, and this file is already modified by one of them, the cached files have to be deleted also!
For OCMod is this done by clicking the button right top at Extensions.
If VQMod is used - and no VQMod manager is in play - these files and the 2 mod files a folder up have to be deleted manual.

Guess all possible cases are described-
Or what do you think Paul?

Custom Development | Individuelle Entwicklung | Support & Bugfixes

Image Image Image


User avatar
Guru Member

Posts

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

Post by paulfeakins » Fri Jan 17, 2020 5:15 pm

OSWorX wrote:
Fri Jan 17, 2020 2:23 am
So the sentence
If you have ever edited it through the admin then changes to the files won't take effect.
has to be read correctly .. and is wrong.
No, it is correct.

If you have ever edited a template via the admin, then subsequent changes to the files (i.e. not via the admin) will have no effect.

When you make a change via the admin this is not a change to the "file" it is a change to the database.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by OSWorX » Fri Jan 17, 2020 9:52 pm

paulfeakins wrote:
Fri Jan 17, 2020 5:15 pm
OSWorX wrote:
Fri Jan 17, 2020 2:23 am
So the sentence
If you have ever edited it through the admin then changes to the files won't take effect.
has to be read correctly .. and is wrong.
No, it is correct.

If you have ever edited a template via the admin, then subsequent changes to the files (i.e. not via the admin) will have no effect.

When you make a change via the admin this is not a change to the "file" it is a change to the database.
Correct or not, if a template is edited via the integrated "Theme Editor", for the user it makes no difference if the file or the stored entry in the database is edited.
Simply a technical definition nobody cares at the end.

Because when I speak about editing a template by the "Theme Editor", it is through the admin (backend) and NOT direct and manual with an local installed editor.

And most of the user are "endusers" working through the "Admin" and editing templates through the "Theme Editor".
So, don't confuse them too much.

Custom Development | Individuelle Entwicklung | Support & Bugfixes

Image Image Image


User avatar
Guru Member

Posts

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

Post by paulfeakins » Fri Jan 17, 2020 10:14 pm

OSWorX wrote:
Fri Jan 17, 2020 9:52 pm
And most of the user are "endusers" working through the "Admin" and editing templates through the "Theme Editor".
So, don't confuse them too much.
They need to know that if they edit a template through the admin, they will not then be able to make changes to that template by editing the file directly in the filesystem e.g. via FTP.

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Expert Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by OSWorX » Fri Jan 17, 2020 10:48 pm

paulfeakins wrote:
Fri Jan 17, 2020 10:14 pm
OSWorX wrote:
Fri Jan 17, 2020 9:52 pm
And most of the user are "endusers" working through the "Admin" and editing templates through the "Theme Editor".
So, don't confuse them too much.
They need to know that if they edit a template through the admin, they will not then be able to make changes to that template by editing the file directly in the filesystem e.g. via FTP.
Okay fine ..
And is there any help or notice in the backend about that fact?
Cannot see any .. and I guess not many will read this thread here.
There should be something like this in my German translation:
Image

btw.: if I tell a client to edit a file via FTP (which I never will do!), they ask me it this is something to eat .. ?!

Custom Development | Individuelle Entwicklung | Support & Bugfixes

Image Image Image


User avatar
Guru Member

Posts

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

Post by IP_CAM » Sat Jan 18, 2020 6:30 am

Well, if that Admin File Editor really only places it's modified Code into the Database,
but leaves the default-original Source File untouched, it would be a top class surplus
Admin Tool. This, because, after a 'global' cache clean function, the modification
made would no longer exist, and people would start to wonder, where it went .... :crazy:
If I understud the above right, at least ... ???

I don't use Forum Mail, to reach me, contact: jti@jacob.ch
-
Demoversion OpenCart LIGHT v.1.5.6.5
http://www.bigmax.ch/
1'500+ FREE OC Extensions - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
-
Image


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by cyclops12 » Sat Jan 18, 2020 5:27 pm

OSWorX wrote:
Fri Jan 17, 2020 10:48 pm


Okay fine ..
And is there any help or notice in the backend about that fact?
Cannot see any .. and I guess not many will read this thread here.
There should be something like this in my German translation:
Image

btw.: if I tell a client to edit a file via FTP (which I never will do!), they ask me it this is something to eat .. ?!
Now this is a good thing that should be added in the next release( as long as the theme editor will still be used in future releases)
Or maybe make a mod for it

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by OSWorX » Sat Jan 18, 2020 6:39 pm

cyclops12 wrote:
Sat Jan 18, 2020 5:27 pm
Now this is a good thing that should be added in the next release( as long as the theme editor will still be used in future releases)
Or maybe make a mod for it
That's easy to implement: simply add it to the translation/language file:

Code: Select all

../admin/language/YOUR_LANG_CODE/design/theme.php
Variable

Code: Select all

text_twig
I have added this as standard (beside many other help texts) in the standard German Translation Package:
https://www.opencart.com/index.php?rout ... n_id=31048

So, if someone wants such help/tip also in the English language, the en-gb language has to be edited.
Or any other language package.
No need for a mod ..

btw: I have enhanced the message a bit:
Image

Reason for that: once a file is edited by the Theme Editor and stored (in the database), no other script (like VQMod or OCMod) has further access to the stored file.

That means for example: customer has an Extension (OCMod or VQMod) which edits the template file (e.g. product.twig - see image).
Later he edit the same template with the Theme Editor.
The changes are done on the original file, not the already modified.
And as long as the file is stored (edited or not) in the Theme Editor, possible changes by other scripts are not possible/available anymore!
Means also, the stored file in the Theme Editor (modified or not) has to be deleted to be available further by external scripts (e.g. OCMod).

Custom Development | Individuelle Entwicklung | Support & Bugfixes

Image Image Image


User avatar
Guru Member

Posts

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

Post by OSWorX » Sat Jan 18, 2020 7:01 pm

IP_CAM wrote:
Sat Jan 18, 2020 6:30 am
Well, if that Admin File Editor really only places it's modified Code into the Database,
but leaves the default-original Source File untouched, it would be a top class surplus
Admin Tool. This, because, after a 'global' cache clean function, the modification
made would no longer exist, and people would start to wonder, where it went .... :crazy:
If I understud the above right, at least ... ???
Read my previous comment - the process is exactly as you describe.

Custom Development | Individuelle Entwicklung | Support & Bugfixes

Image Image Image


User avatar
Guru Member

Posts

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

Users browsing this forum: No registered users and 15 guests