0

I am trying to get the hours of operation (preferably using the object manager), but I cannot find a way to do this...

Maarten Wolfsen
  • 1,331
  • 20
  • 48

2 Answers2

2

I think this will help you:

How to get store phone number in magento 2

Just take the hours, not the phone.

Nikola
  • 460
  • 1
  • 4
  • 16
0

Please use the following code in the block.

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

class Footerlink extends \Magento\Framework\View\Element\Template
{
protected $flHelper;
protected $_urlInterface;
protected $scopeConfig;


public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Framework\UrlInterface $urlInterface,
    ScopeConfigInterface $scopeConfig,
    \Addpeople\Websettings\Helper\Footerlink $myModuleHelper,
    array $data = []
) {
    parent::__construct($context, $data);
    $this->_flHelper = $myModuleHelper;
    $this->_urlInterface = $urlInterface;
    $this->scopeConfig = $scopeConfig;

}
public function getOpeningHours()
{

    return $this->scopeConfig->getValue('general/store_information/hours',ScopeInterface::SCOPE_STORE);

}
}
Liz Eipe C
  • 1,286
  • 12
  • 17