In this post I am going to explain how to get current store information like store id, code, name, url and website id in Magento 2. 1. Using Dependency Injection protected $_storeManager; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Store\Model\StoreManagerInterface $storeManager, array $data = [] ) { $this->_storeManager = $storeManager; parent::__construct($context, $data); } public function getStore() {…


Recent Comments