Get Free Audit

Variables in Magento 2.0

Jan 18, 2016

461 Andrey Dubina

Variables in Magento 2.0

Variables is an easy way to add pre-defined pieces of code to your CMS pages or blocks. In Magento 2.0 you can find the following default variables that can be added:

  • Base Unsecure URL
  • Base Secure URL
  • General Contact Name
  • General Contact Email
  • Sales Representative Contact Name
  • Sales Representative Contact Email
  • Custom1 Contact Name
  • Custom1 Contact Email
  • Custom2 Contact Name
  • Custom2 Contact Email
  • Store Name
  • Store Phone Number
  • Store Hours
  • Country
  • Region/State
  • Zip/Postal Code
  • City
  • Street Address 1
  • Street Address 2

If you added a variable to a page on your store and if you change the value of your variable in settings, the change will appear on all pages where you inserted the variable.

In order to add a variable to a page, go to the content of the page. There you can switch “Show / Hide Editor”.

If WYSIWYG editor is shown, then the “Add Variable” button can be found here:

Variables in Magento 2.0

If the editor is disabled, then the variable can be added by pushing the following button:

Andrey_Dubina
Partner With Us Let's discuss how to grow your business. Get a Free Quote.
Talk to Andrey

Variables in Magento 2.0

Let’s do the following example: you need to write the name of the General contact. But imagine, what if you insert their name on 1000 pages and it happens that this person is replaced by someone else? In this case you can use a variable instead of writing their name.

Variables in Magento 2.0

Andrey Dubina
Partner With Us Looking for a partner to grow your business? We are the right company to bring your webstore to success. Talk to Andrey

Post a new comment

BelVG Newsletter
Subscribe to our mailing list and get interesting stuff and updates to your email inbox.
Email *