It's still a little unclear where, exactly, you're trying to grab this information in the admin. I'll assume it's while processing a request for the the System -> Configuration
section. Hopefully this will send you in the right direction
Like all form fields in Magento, you can grab the values of the fields from the request object. Doing something like this (from a controller action)
$current = Mage::app()->getRequest()->getParam('section');
$website = Mage::app()->getRequest()->getParam('website');
$store = Mage::app()->getRequest()->getParam('store');
Would give you the field values for the section
, website
, and store
elements passed by the switcher elements. You're interested in the store
element. Unfortunately, this form doesn't pass the IDs of the store, but instead the store short code
<option value="store_code" url="..." selected="selected" style="">Store View Name</option>
This means you'll need to take the short code in $store
, and use it to fetch the store's information from a core/store
model collection.
$store = Mage::app()->getRequest()->getParam('store');
if($store)
{
$c = Mage::getModel('core/store')->getCollection()
->addFieldToFilter('code', $store);
$item = $c->getFirstItem();
var_dump($item->getData());
var_dump($item->getStoreId());
}
else
{
var_dump('Store Value Not Set');
}
0
, but I suspect that's not what you're asking here. "Current scoped store" is a little vague.