How can I remove "Main Website" and "Main Website Store" from admin order grid?
I need to have only Store Name example "Italia" or "Asia" etc
How can I remove "Main Website" and "Main Website Store" from admin order grid?
I need to have only Store Name example "Italia" or "Asia" etc
Change the grid.php code as like /app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php
if (!Mage::app()->isSingleStoreMode()) {
$this->addColumn('store_id', array(
'header' => Mage::helper('sales')->__('Purchased From (Store)'),
'index' => 'store_id',
'type' => 'store',
'store_view'=> false,
'display_deleted' => true,
));
}
also change hrere /app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Store.php
function render
Comment code
/** foreach ($data as $website) {
$out .= $website['label'] . '<br/>';
foreach ($website['children'] as $group) {
$out .= str_repeat(' ', 3) . $group['label'] . '<br/>';
foreach ($group['children'] as $store) {
$out .= str_repeat(' ', 6) . $store['label'] . '<br/>';
}
}
}
**/
For website
New line should be in render function
foreach ($data as $website) { $out .= $website['label'];}
As per your requirement you can change this
I solved in this way. If someone find a better solution is welcome
add a class to website grid
app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php
if (!Mage::app()->isSingleStoreMode()) {
$this->addColumn('store_id', array(
'header' => Mage::helper('sales')->__('Purchased From (Store)'),
'index' => 'store_id',
'type' => 'store',
'store_view'=> true,
'display_deleted' => true,
'column_css_class' => 'hidden_custom',
));
}
add custom js file to admin
app/design/adminhtml/default/default/layout/sales.xml
<default>
<reference name="head">
<action method="addJs"><name>custom/adminhtml/custom.js</name><params><![CDATA[data-group="js002"]]></params></action>
</reference>
</default>
Find and replace text with jquery
js/custom/adminhtml/custom.js
(function ($) {
window.setInterval(function() {
$('.hidden_custom').each(function(){
$(this).html($(this).html().split("Main Website<br> Main Website Store<br> ").join(""));
});
}, 500);
})(jQuery);