Post by bluedreamer » Thu Dec 05, 2019 1:24 am

Hi Forum!

Is there a master list of all available template variables (OC3/Twig) anywhere? I've searched the forums, docs and web search but found nothing other than how to get variables for the current template.

Initially I need to make some template tweaks:

1. Add extra info to emails
- product SKU's, product quantities, and customers delivery address

2. Add product SKU to product page template

Newbie

Posts

Joined
Thu Dec 05, 2019 1:19 am

Post by letxobnav » Thu Dec 05, 2019 5:37 am

The practice is that you only pass those variables from the controllers to the twig files which you actually use, it is not a buffet.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Active Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by paulfeakins » Thu Dec 05, 2019 6:20 pm

bluedreamer wrote:
Thu Dec 05, 2019 1:24 am
Is there a master list of all available template variables (OC3/Twig) anywhere?
In the controller for that template.

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 bluedreamer » Thu Dec 05, 2019 9:19 pm

Thanks for the replies, noted available variables are limited to the template!

Can't find a variable for "SKU" though, I presume that's not available to output in templates/emails?

Newbie

Posts

Joined
Thu Dec 05, 2019 1:19 am

Post by sw!tch » Fri Dec 06, 2019 4:01 am

bluedreamer wrote:
Thu Dec 05, 2019 9:19 pm
Thanks for the replies, noted available variables are limited to the template!

Can't find a variable for "SKU" though, I presume that's not available to output in templates/emails?
Well anything can be made available its how much work you want to put into it. But in short and by default no - On order emails, products are pulled from the oc_order_product table, from what I recall I don't think SKU is stored by default.

However on the product page for example you could easily grab SKU with little effort.

If you don't understand the MVC pattern look for a marketplace extension or post up in the commercial section.

Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by letxobnav » Fri Dec 06, 2019 4:50 am

noted available variables are limited to the template!
that is not what was said.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Active Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan
Who is online

Users browsing this forum: No registered users and 24 guests