Magento2 – How to get store information

Magento2 – How to get store information

By default store manager loads current store information. You can get store information by `store_id` parameter. You must create an instance of \Magento\Store\Model\StoreManagerInterface class to get store information.

Magento2 – How to get Current Url

Magento2 – How to get Current Url

To get url of the current page, the code below works everywhere: $objectManagerInstance = \Magento\Framework\App\ObjectManager::getInstance(); $url = objectManagerInstance -> get('Magento\Framework\UrlInterface'); echo $url -> getCurrentUrl(); From a .phtml template