0

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

enter image description here

2
  • Post your code here so anyone can help you Commented Apr 10, 2018 at 15:39
  • is the magento default code
    – Altravista
    Commented Apr 10, 2018 at 16:21

2 Answers 2

1

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('&nbsp;', 3) . $group['label'] . '<br/>';
            foreach ($group['children'] as $store) {
                $out .= str_repeat('&nbsp;', 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

0

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>&nbsp;&nbsp;&nbsp;Main Website Store<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;").join(""));
        });
    }, 500);
})(jQuery);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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