0

Our Magento store recently got Klarna extension integrated in itself as another payment method. I need to find out the configuration key value for the field 'Enable this Solution'. Where do I find this bit of information so that I can pass this in the code below? payment_us_klarna_section_klarna_klarna_kp_required_active doesn't return the value.

echo "Store Config Value: " . $block->_scopeConfig->getValue('payment_us_klarna_section_klarna_klarna_kp_required_active', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);

Here is the screenshot for the field that I need the configuration key value of.

enter image description here

1 Answer 1

0

Config path should be:

payment/klarna_kp/active

Now your code should be:

echo "Store Config Value: " . $this->_scopeConfig->getValue('payment/klarna_kp/active', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);

Make sure $this->_scopeConfig is the instance of Magento\Framework\App\Config\ScopeConfigInterface

3
  • This displayed 0 indicating the solution was disabled. Perfect answer Sohel. Commented Jun 23, 2020 at 16:36
  • Can I use objectmanager to instantiate Magento\Framework\App\Config\ScopeConfigInterface since I need this configuration value only in the product details page? Commented Jun 23, 2020 at 16:53
  • Sohel Sir, please look at my issue: magento.stackexchange.com/questions/317446/… Commented Jul 20, 2020 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.