Magento 2 get Core_config_data

core_config_data  table

config_id: 65

    scope: default

scope_id: 0

     path: Mentel_convertprice_section/convertprice_general/convertprice_active

    value: 1


First you need to include the  \Magento\Framework\App\Config\ScopeConfigInterface $   class in your constructor:

protected $_scopeConfig;

public function __construct(
     ...
     \Magento\Framework\App\Config\ScopeConfigInterface $ScopeConfigInterface,
     ...
)
{
    ...
    $this->_scopeConfig = $scopeInterface;
    ...
}

Then in your class’ method you can call the following:

 var_dump($this->_ScopeConfigInterface->getValue('Mentel_convertprice_section/convertprice_general/convertprice_active',\Magento\Store\Model\ScopeInterface::SCOPE_STORE));

Leave a Comment