An Easy Guide To Adding Custom Variables In Magento 2

Posted by

In the previous article, we described what are Magento variables, two main types of Magento variable and how to add variables to email templates.

As we said before, variables contain information that can be created and used in multiple places, and store administrators can create their own variables.

The variables created by store owners are called Magento custom variables, and store owners use custom variables by attaching them to pages, blocks, banners, and email templates.

This article will provide a tutorial on creating and adding Magento custom variables control panel.

To create Magento custom variables and attach them to pages, blocks, banners, and email templates, you have to know a little HTML code and how to use a markup tag.

{{CustomVar code= “my_custom_variable”}}

>>> Don’t forget: Magento Tutorial to build your own store!

Magento-custom-variables

>>> Read more: Overview A Tutorial On Using Magento Shopping Cart!

To create Magento custom variables control panel, you have to follow these steps:

  1. On the admin sidebar, click System. Then under Other Settings, click Custom Variables. Click Add variables
  2. Input an identifier in the Variable Code field using lowercase and no spaces
  3. In the Variable HTML Value text field, use HTML tags to input any content you want to include. This option helps you format the value.
  4. In the Variable Plain Value text field, you can add variable value as plain text.

Tips: To enlarge the boxes, drag the right corner.

Magento-custom-variables

>>> Dont’ forget: How to enable Magento RSS Feed for your store?
  1. Click Save after completed

Above is a complete tutorial on how to add Magento custom variables control panel.

We hope that store owners can handle the progress of using variables, and use all variables effectively in their online store.

Leave a comment or contact email directly if you have any other ways to add custom variables.

In the next article, we will describe markup tags and how to use markup tags in links. Don’t forget to track Mageguides to read more useful Magento 2 articles.

>>> Don’t miss this: How To Manage Magento Wysiwyg Editor?

Leave a Reply

Your email address will not be published. Required fields are marked *