I have created a menu in the configuration menu.
system.xml:
I have an observer and I want to get the values of those two fields.
How can I do that?
Thanks for any help!
I have created a menu in the configuration menu.
system.xml:
I have an observer and I want to get the values of those two fields.
How can I do that?
Thanks for any help!
Try to use this below code in your observer :
protected $scopeConfig;
const XML_PATH_CREDIT_CARD = 'uv_email/general/uv_email_kredit';
const XML_PATH_SALES_TEAM = 'uv_email/general/uv_email_vertrieb';
public function __construct(
......
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
......
) {
......
$this->scopeConfig = $scopeConfig;
......
}
public function execute(\Magento\Framework\Event\Observer $observer)
{
$storeScope = \Magento\Store\Model\ScopeInterface::SCOPE_STORE;
$credit_card_value = $this->scopeConfig->getValue(self::XML_PATH_CREDIT_CARD, $storeScope);
$sales_team_value = $this->scopeConfig->getValue(self::XML_PATH_SALES_TEAM, $storeScope);
}