I am trying to get the hours of operation (preferably using the object manager), but I cannot find a way to do this...
Asked
Active
Viewed 1,146 times
0
-
give more details – Gopal Patel Mar 31 '17 at 13:02
2 Answers
2
I think this will help you:
How to get store phone number in magento 2
Just take the hours, not the phone.
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