1

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?

0

I found this solution:

        $objectManager =  \Magento\Framework\App\ObjectManager::getInstance();        
    $storeManager  = $objectManager->get('\Magento\Store\Model\StoreManagerInterface');
    $store_code    = $storeManager->getStore()->getCode(); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.