.tpl to .twig conversion - How to use current .tpl tutorials to suit .twig
Posted: Wed Oct 25, 2017 2:26 am
Hello
I am fairly new to OpenCart.
I am trying to modify templates etc, but almost ALL tutorials on the internet refer to the old .tpl files.
For example, order_invoice.tpl on old tutorials, I can add a PHP code, read something from the Database, to add , for example, a serial number or a code from my Serial Number database to the invoice.
However, with the new .twig system, I have NO IDEA, how to use these old tutorials.
Even on OpenCart official documentation, there are still references to .tpl and not .twig.
Can someone PLEASE HELP ME?
So in a nutshell I want to know the following:
1) Where are these "variables" being called from? For example, in order_invoice.twig, (or any other file) , how can I add a new "variable" to the file? Where do I define that?
2)HOW do I define the variables used in .twig file on OpenCart system?
3)What's the best practice to follow theming tutorials on the internet, which are using .tpl files? What do I need to know to understand how to use these tutorials in a .twig?
4)Is it worth sticking with OpenCart 3? Or should I use 2.x just because of not understanding how to follow the .tpl tutorials?
Thank you so much guys and girls! I really appreciate it! Also please be nice to me!
Sam
I am fairly new to OpenCart.
I am trying to modify templates etc, but almost ALL tutorials on the internet refer to the old .tpl files.
For example, order_invoice.tpl on old tutorials, I can add a PHP code, read something from the Database, to add , for example, a serial number or a code from my Serial Number database to the invoice.
However, with the new .twig system, I have NO IDEA, how to use these old tutorials.
Even on OpenCart official documentation, there are still references to .tpl and not .twig.
Can someone PLEASE HELP ME?
So in a nutshell I want to know the following:
1) Where are these "variables" being called from? For example, in order_invoice.twig, (or any other file) , how can I add a new "variable" to the file? Where do I define that?
2)HOW do I define the variables used in .twig file on OpenCart system?
3)What's the best practice to follow theming tutorials on the internet, which are using .tpl files? What do I need to know to understand how to use these tutorials in a .twig?
4)Is it worth sticking with OpenCart 3? Or should I use 2.x just because of not understanding how to follow the .tpl tutorials?
Thank you so much guys and girls! I really appreciate it! Also please be nice to me!
Sam