Написал новый модуль. Вот его конфиг:
./app/etc/modules/Vellum_AdminFieldHide.xml
<?xml version="1.0"?> <config> <modules> <Vellum_AdminFieldHide> <active>true</active> <codePool>local</codePool> <version>1.0</version> </Vellum_AdminFieldHide> </modules> </config>
Переопределил блок следующим путем:
./app/code/local/Vellum/AdminFieldHide/etc/config.xml
<?xml version="1.0"?> <config> <modules> <Vellum_AdminFieldHide> <version>0.1.0</version> </Vellum_AdminFieldHide> </modules> <frontend> </frontend> <global> <blocks> <sales> <rewrite> <order>Vellum_AdminFieldHide_Block_Order</order> </rewrite> </sales> </blocks> </global> </config>
Собственно сам блок:
./app/code/local/Vellum/AdminFieldHide/Block/Sales/Order/Grid.php
<?php class Vellum_AdminFieldHide_Block_Sales_Order_Grid extends Mage_Adminhtml_Block_Sales_Order_Grid { public function __construct() { parent::__construct(); } protected function _prepareColumns() { $this->addColumn('real_order_id', array( 'header'=> Mage::helper('sales')->__('Order #'), 'width' => '80px', 'type' => 'text', 'index' => 'increment_id', )); 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, )); } $this->addColumn('created_at', array( 'header' => Mage::helper('sales')->__('Purchased On'), 'index' => 'created_at', 'type' => 'datetime', 'width' => '100px', )); $this->addColumn('billing_name', array( 'header' => Mage::helper('sales')->__('Bill to Name'), 'index' => 'billing_name', )); $this->addColumn('shipping_name', array( 'header' => Mage::helper('sales')->__('Ship to Name'), 'index' => 'shipping_name', )); /* $this->addColumn('base_grand_total', array( 'header' => Mage::helper('sales')->__('G.T. (Base)'), 'index' => 'base_grand_total', 'type' => 'currency', 'currency' => 'base_currency_code', )); $this->addColumn('grand_total', array( 'header' => Mage::helper('sales')->__('G.T. (Purchased)'), 'index' => 'grand_total', 'type' => 'currency', 'currency' => 'order_currency_code', )); */ $this->addColumn('status', array( 'header' => Mage::helper('sales')->__('Status'), 'index' => 'status', 'type' => 'options', 'width' => '70px', 'options' => Mage::getSingleton('sales/order_config')->getStatuses(), )); if (Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/view')) { $this->addColumn('action', array( 'header' => Mage::helper('sales')->__('Action'), 'width' => '50px', 'type' => 'action', 'getter' => 'getId', 'actions' => array( array( 'caption' => Mage::helper('sales')->__('View'), 'url' => array('base'=>'*/sales_order/view'), 'field' => 'order_id' ) ), 'filter' => false, 'sortable' => false, 'index' => 'stores', 'is_system' => true, )); } $this->addRssList('rss/order/new', Mage::helper('sales')->__('New Order RSS')); $this->addExportType('*/*/exportCsv', Mage::helper('sales')->__('CSV')); $this->addExportType('*/*/exportExcel', Mage::helper('sales')->__('Excel')); return parent::_prepareColumns(); } }
Как я понял из документации, в блоке мне надо переопределить функцию _prepareColumns(), в которой и удалить ненужные поля (их я закомментировал).
Иду в админку www.misite.com/admin/sales_order/index/ и не вижу никаких изменений.
Подскажите мою ошибку. Чувствую, что в конфиге что-то не то. Может я не правильно переопределение для блока сделал?
Буду ОЧЕНЬ благодарен за помощь!!