Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
In a custom phtml file I have to get the code associated to the store view (not the Id), any idea how to get this?
I found this solution:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface');
$store_code = $storeManager->getStore()->getCode();
Required, but never shown