0

I want to add a custom text area for contact info for a particular store view from configuration and get that custom field value and display it on the contact us page in Magento 2.3.2.

so can anyone have an idea then please share it with me.

Thanks in Advance...

1 Answer 1

1

Try This code

<?php

namespace Vendorename\Modulename\Helper;

use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Store\Model\ScopeInterface;


class Data extends AbstractHelper
{
    const XML_PATH_ENABLE = 'sectionname/groupname/fieldname';

    protected $_scopeConfig;


    public function __construct(
        ....................................
        ScopeConfigInterface $scopeConfig,
        ....................................
    ) {
        ....................................
        $this->_scopeConfig = $scopeConfig;
        ....................................
    }

    public function isEnabled()
    {
        return $this->_scopeConfig->getValue(self::XML_PATH_ENABLE, ScopeInterface::SCOPE_STORE);
    }

}
0

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.