Get Magento2 store details

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $storeManager = $objectManager->get(‘\Magento\Store\Model\StoreManagerInterface’); echo $storeManager->getStore()->getStoreId() . ‘<br />‘; echo $storeManager->getStore()->getCode() . ‘<br />‘; echo $storeManager->getStore()->getName() . ‘<br />‘; echo $storeManager->getStore()->getStoreUrl() . ‘<br />‘; echo $storeManager->getStore()->getWebsiteId() . ‘<br />’;

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.