Post by florina » Wed Nov 01, 2017 11:15 pm

Is there a reference list of available twig variables? Both front-end and back-end.



Wed Apr 09, 2014 2:32 am

Post by yodapt » Thu Nov 02, 2017 2:29 am

No there isn't, but it's fairly easy to know what you can use if you have minimal understanding of PHP.

Opencart Developer - My Extension Showcase
Contact me at

User avatar
Active Member


Fri Jun 17, 2011 6:39 pm

Post by straightlight » Thu Nov 02, 2017 2:58 am

One way to start would be by using this free extension: ... n_id=31419 . Another way to start would be by looking into your install/opencart.sql file where all field names may correspond to each variable names on the platform.

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.

Straightlight Administrator / Quality Assurance Analyst / Programmer / Opencart Tester

Legendary Member


Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by IP_CAM » Fri Aug 07, 2020 6:33 am

See all variables available in twig templates in Opencart

Please don't send me OC Forum Personal Messages, just contact:
OC LIGHT Test Site:
OC V-PRO Test Site:
My Github OC Site:
2'600+ FREE OC Extensions on the World's largest Github OC Repository Archive Site.

User avatar
Legendary Member


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

Post by letxobnav » Fri Aug 07, 2020 1:35 pm

It is much simpler to list out the $data array before it is passed to the view as that will also visualize structures so you know if a variable is a string, boolean, array,etc. and give you the contents as well.

Simply add just before any call to the view like:

Code: Select all

$this->response->setOutput($this->load->view('product/product', $data));

Code: Select all

	$this->log->write('data structure to view: product/product'.print_r($data,true));
then add a constant in your config.php so you can switch it on and off relatively quickly

Code: Select all

// print data passed to view to the oc error log

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
Expert Member


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

Users browsing this forum: No registered users and 22 guests