0

I'm new to Magento 2 and from what I know, in order to retrieve config values, you need to extend the AbstractHelper class and create a method:

public function getConfig($config_path)
{
    return $this->scopeConfig->getValue(
        $config_path,
        \Magento\Store\Model\ScopeInterface::SCOPE_STORE
    );
}

Is there any way to transform this method into a static method?

Thanks in advance.

2
  • Why would you need such functionality? Nov 9 '20 at 4:21
  • The reason for this need is that other static functions made in the class would need to call this method to retrieve configuration values.
    – mageboi123
    Nov 9 '20 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.