0

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

  • give more details – Gopal Patel Mar 31 '17 at 13:02
2

I think this will help you:

How to get store phone number in magento 2

Just take the hours, not the phone.

  • I found my answer in that question! :) – Maarten Wolfsen Mar 31 '17 at 13:30
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);

}
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.