- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2016
07:44 AM
02-11-2016
07:44 AM
We have a block that calls a phtml file that reads an external json stream to fill in some data on the fly. I want to add in a switch-case that reads the store name so I can change some variables around for my stream. I know in magento1 i could do it easily with
Mage::app()->getStore()->getName();
how do I do this in Magento2?
Solved! Go to Solution.
Labels:
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2016
02:17 PM
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2016
02:17 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2016
07:00 AM
02-16-2016
07:00 AM
Re: Getting Store Name
Edited your reply slightly:
$om = \Magento\Framework\App\ObjectManager::getInstance();
$manager = $om->get('Magento\Store\Model\StoreManagerInterface');
$store = $manager->getStore(null)->getName();
Still marking as solution, thank you.