---
title: "How to get store config values by scope in Magento 2"
url: "https://dolphinwebsolution.com/how-to-get-store-config-values-by-scope-in-magento-2"
date: "2021-04-20T04:02:12+05:30"
modified: "2023-08-24T09:41:40+05:30"
author:
  name: "Mahesh Makwana"
categories:
  - "Magento"
word_count: 170
reading_time: "1 min read"
summary: "We used to store configuration to store some value which affects our store and provides functionality from the configuration. All store settings are saved and stored in core_config table in Magento..."
description: "We used to store configuration to store some value which affects our store and provides functionality from the configuration. All store settings are saved an..."
keywords: "get store config values,scope in Magento 2,store configuration in magento 2,magento 2 store configuration value, Magento"
language: "en"
schema_type: "Article"
related_posts:
  - title: "5 Efficient PWA (Progressive Web Apps) Providers for Brand"
    url: "https://dolphinwebsolution.com/five-efficient-pwa-progressive-web-apps-providers-for-your-brand"
  - title: "How to create custom page layout in Magento 2."
    url: "https://dolphinwebsolution.com/how-to-create-custom-page-layout-in-magento"
  - title: "Top 5 Best Magento Development Companies in USA (2026)"
    url: "https://dolphinwebsolution.com/blog/best-magento-development-companies-in-usa/"
---

# How to get store config values by scope in Magento 2

_Published: April 20, 2021_  
_Author: Mahesh Makwana_  

![](https://dolphinwebsolution.com/wp-content/uploads/2023/02/Config-values-by-scope-1024x512.jpg)

> We used to store configuration to store some value which affects our store and provides functionality from the configuration. All store settings are saved and stored in core_config table in Magento 2. The below code show how to get store config values:

We used to store configuration to store some value which affects our store and provides functionality from the configuration. All [Magento store](https://dolphinwebsolution.com/shop/) settings are saved and stored in **core\_config** table in Magento 2.

#### The below code show how to get store config values:

```
<?php

namespace Dolphin\GetStoreVal\Helper;

use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Store\Model\ScopeInterface;

class Data extends AbstractHelper
{
    protected $scopeConfig;

    XML_PATH_KEY = 'section_name/group_name/field_name';// add your path here

    public function __construct(
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
    ) {
        $this->scopeConfig = $scopeConfig;
    }

    public function getConfigValue($field, $storeId = null)
    {
        return $this->scopeConfig->getValue($field, ScopeInterface::SCOPE_STORE, $storeId);
    }

    public function getFieldVal($storeId = null)
    {
        return $this->getConfigValue(self::XML_PATH_KEY, $storeId);
    }

}
```

**You can change the SCOPE\_STORE to following:**

```
SCOPE_STORES    For  Stores
SCOPE_GROUPS    For  Groups
SCOPE_WEBSITES  For  Websites
SCOPE_GROUP     For  Group
SCOPE_WEBSITE   For  Website
```

I hope this helps you. For any doubts regarding this topic, please write your doubts in the comments section.


---

_View the original post at: [https://dolphinwebsolution.com/how-to-get-store-config-values-by-scope-in-magento-2](https://dolphinwebsolution.com/how-to-get-store-config-values-by-scope-in-magento-2)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-08-26 07:39:03 UTC_  
