How to see all variables available in twig template in Opencart?

In Opencart, we can see all the variables that are available in the twig template by just adding the following code in twig page.

<ol>
    {% for key, value in _context  %}
      <li>{{ key }}</li>
    {% endfor %}
</ol>

For e.g., if we want to see all the variables that are on the account login page, then open to catalog/view/theme/default/template/account.twig and paste above code now it will be like below:

Opencart Twig Variables

Now the output will be like below:

Opencart variables twig

Here are the variables available in the account login page.

breadcrumbs
error_warning
action
register
forgotten
redirect
success
email
password
column_left
content_full
content_full_bottom
column_right
content_top
content_bottom
footer
header
code
direction
date_format_short
date_format_long
time_format
datetime_format
decimal_point
thousand_point
text_home
text_yes
text_no
text_none
text_select
text_all_zones
text_pagination
text_loading
text_no_results
button_address_add
button_back
button_continue
button_cart
button_cancel
button_compare
button_wishlist
button_checkout
button_confirm
button_coupon
button_delete
button_download
button_edit
button_filter
button_new_address
button_change_address
button_reviews
button_write
button_login
button_update
button_remove
button_reorder
button_return
button_shopping
button_search
button_shipping
button_submit
button_guest
button_view
button_voucher
button_upload
button_reward
button_quote
button_list
button_grid
button_map
error_exception
error_upload_1
error_upload_2
error_upload_3
error_upload_4
error_upload_6
error_upload_7
error_upload_8
error_upload_999
error_curl
datepicker
backup
heading_title
text_account
text_login
text_new_customer
text_register
text_register_account
text_returning_customer
text_i_am_returning_customer
text_forgotten
entry_email
entry_password
error_login
error_attempts
error_approved
text_logout
text_edit
text_password
text_address
text_wishlist
text_order
text_download
text_reward
text_return
text_transaction
text_newsletter
text_recurring
text_information
text_service
text_extra
text_contact
text_sitemap
text_manufacturer
text_voucher
text_affiliate
text_special
text_powered
text_shopping_cart
text_category
text_checkout
text_search
text_all
text_language
text_currency
text_items
text_empty
text_cart
text_sub_total
text_credit
text_order_id
text_total
_parent

Let us know if you have any questions or suggestions.

Previous articleOpencart 3 free module to list or display all Reviews of products on one page
Next articleOCMOD free module to show product availability on categories pages and modules

3 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here