I've been looking at the core code for the store column renderer in adminhtml sales (Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Store
) and the render functions are really confusing me.
The nested foreach loops at the end of the render
and renderExport
methods appear to suggest that a single order could be attributed to multiple stores, but that makes no sense to me at all. Here is the core code from 1.9
$data = $this->_getStoreModel()->getStoresStructure(false, $origStores);
foreach ($data as $website) {
$out .= $website['label'] . "\r\n";
foreach ($website['children'] as $group) {
$out .= str_repeat(' ', 3) . $group['label'] . "\r\n";
foreach ($group['children'] as $store) {
$out .= str_repeat(' ', 6) . $store['label'] . "\r\n";
}
}
}
In what situation would the above code ever generate more than one website
, group
or store
element?
Is it that this renderer can be called in contexts other than relating to a single order? I can see if it were called for a group of orders, then it would made sense to show all the website, groups and store elements.