Here we are giving the code to get the store configuration value
In .php file (Block)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
protected $_scopeConfig; public function __construct( \Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, array $data = [] ) { parent::__construct($context, $data); $this->_scopeConfig = $scopeConfig; } public function getTelephoneConfig(){ $showTemplateHint = $this->_scopeConfig->getValue('general/store_information/phone', \Magento\Store\Model\ScopeInterface::SCOPE_STORE); return $showTemplateHint; } |
In .Phtml file
1 |
<?php echo $block->getTelephoneConfig(); ?> |