Custom variables
Variables are a handy little feature of a core Magento_Variable
module. Magento
allows you to create custom variables and then use them in e-mail templates, the WYSIWYG
editor, or even code expressions.
The following steps outline how we can create a new variable manually:
In the
Magento
admin area, navigate to System | Other Settings | Custom Variables.Click on the Add New Variable button.
While keeping in mind the Store View switcher, fill in the required Variable Code and Variable Name options, and preferably one of the optional options, either Variable HTML Value or Variable Plain Value.
Click on the Save button.
Now that we have created the custom variable, we can use it in an e-mail template or the WYSIWYG
editor by calling it using the following expression:
{{customVar code=foggyline_hello}}
The preceding expression will call for the value of the custom
variable with code foggyline_hello
.
Variables can be used within various code expressions, though it is not recommended...