How to Get Store Config Value in Magento 2

In this tutorial, Today We will explain to you how to get the store config value in Magento 2. Magento 2 allows you to set configuration value by different scopes like specific website, specific store and specific store view. So, It’s required to get store configuration value by scope in Magento 2. Generally, When user wants to access the value in whole website at that time, store configuration needs to create and set value in that to access value everywhere.

In Magento 2, There is all configuration value set in the core_config_data table. So, Let’s follow the below steps.

You may also like this:

Get Config Value in Layout XML in Magento 2
How to Get Product Collection in Magento2

Let’s assume that you have created a module. Now, you need to create a helper file in your module at app/code/Pridee/Simple/Helper/Data.php

Now, you can inject the helper class anywhere and use the getConfig() function to get config value.

I hope this blog will helpful for easily understand how to get the store config value in Magento 2. In case, I missed anything or need to add some information, always feel free to leave a comment in this blog, I’ll get back with proper solution.

Share this: