Вопрос

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...

Это было полезно?

Решение

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);
    }

}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с magento.stackexchange
scroll top