Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How Do I Get Config Variables on Shopware 6 Theme To The Storefront

I am building my own Shopware 6 theme using another Shopware 6 theme as a guide. I noticed the theme developer was able to bring the config.xml variables to the storefront. I discovered this by using the {{ dump() }} twig function. How do I do the same for my theme?

Attached is a picture of what I saw.

ssik is the name of the twig variable/array and config as seen in the picture

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

In twig templates there are a couple of functions you can use to get config values.

config.xml setting values:

{{ config('MyPlugin.config.nameOfConfigSetting') }}

theme.json config setting values:

{{ theme_config('name-of-theme-setting') }}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading