We sacrifice by not doing any other technology, so that you get the best of Magento.

We sacrifice by not doing any other technology, so that you get the best of Magento.

Here we are going to write about how to get system configuration value in your custom file or anywhere else.

Inside the header data file we have add this code

create Data.php file in Magemonkeys/General/Helper/

public function __construct(
   MagentoFrameworkAppConfigScopeConfigInterface $scopeConfig
)
{
   $this->_scopeConfig = $scopeConfig;
}

public function getConfig($config_path)
{
    return $this->_scopeConfig->getValue(
            $config_path,
            MagentoStoreModelScopeInterface::SCOPE_STORE
            );
}

In phtml file – add below for call helper function

$systemconfval = $this->helper('MagemonkeysGeneralHelperData')->getConfig('sectionid/groupid/fieldid');
echo $systemconfval;

Well, after performing above changes, value will be shown. Hope that helps!

field_5bfb909c5ccae

    Recent Articles
    Get a Free Quote

      Full Name

      Email Address

      Mobile Number

      Message

      Let’s initiate a discussion!!

      With Only Agency that provides a 24/7 emergency support.

        Full Name

        Email Address

        Mobile Number

        Message