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!
2) In the respective controller;
3) Should be more or less the same, but you should read Twig's documentation on how to setup variables and logic. If you can manage tpl files, you can manage twig files;
4) The desire to learn will keep you interested in life as long as you live;
Number 2 is not entirely true. There are controllers in Opencart that are only meant to return a variable so that another controller can capture the returned variable before loading the template page.2) In the respective controller;
The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.
Programmer / Opencart Tester
Users browsing this forum: No registered users and 14 guests