Magento 2.3.4: How to find out the configuration key value for `Enable this Solution` for a Payment Method?
-
14-04-2021 - |
Question
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.
Solution
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
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange