覆盖自定义模块

时间:2015-05-13 12:12:14

标签: php magento override

我有一个自定义模块,它在管理面板中列出了一些记录。目前没有指向记录列表的链接,我想给出列表的自定义链接。我试图覆盖网格块类。但这不起作用。

代码如下:

<config>
  <global>
    <blocks>
       ...
        <adminhtml>
            <rewrite>
                <partners_grid>Tech_SecodaryProduct_Block_Adminhtml_Partners_Grid</partners_grid>
            </rewrite>
        </adminhtml>
       ...
     </blocks>
</global>

我在local/Tech/SecodaryProduct/Block/Adminhtml/Partners/Grid.php

下创建了一个文件
<?php
class Tech_SecodaryProduct_Block_Adminhtml_Partners_Grid extends Webkul_Marketplace_Block_Adminhtml_Partners_Grid
{

   protected function _prepareColumns(){

      // parent::__construct();

    $this->addColumn('partnerstatus', array(
            'header'    => Mage::helper('customer')->__('Seller Status'),
            'index'     => 'partnerstatus',
        ));
    $ispartnerEnabled = Mage::helper('core/data')->isModuleOutputEnabled('Webkul_Mppartnergroup');

    if($ispartnerEnabled == 1){
            $this->addColumn('group', array(  
                    'header'    => Mage::helper('customer')->__('Group'),      
                    'index'     => 'group',    
            ));     
    }
    $this->addColumn('order', array(
            'header'    => Mage::helper('customer')->__('Order'),
            'index'     => 'order',
            'type'      => 'text',
            "filter"    => false,
            "sortable"  => false
            ));
    $isThisEnabled = Mage::helper('core/data')->isModuleOutputEnabled('Webkul_Sellerstatus');
    if($isThisEnabled == 1){
            $this->addColumn('sellerstatus', array(
                    'header'    => Mage::helper('customer')->__('Seller Status'),
                    'type'      => 'text',
                    'index'     => 'sellerstatus',
                    "filter"    => false,
        "sortable"  => false
            ));
    }
        $this->addColumn('Telephone', array(
            'header'    => Mage::helper('customer')->__('Telephone'),
            'width'     => '100',
            'index'     => 'billing_telephone',
        ));
        $this->addColumn('billing_postcode', array(
            'header'    => Mage::helper('customer')->__('ZIP'),
            'width'     => '90',
            'index'     => 'billing_postcode',
        ));
        $this->addColumn('billing_country_id', array(
            'header'    => Mage::helper('customer')->__('Country'),
            'width'     => '100',
            'type'      => 'country',
            'index'     => 'billing_country_id',
        ));
        $this->addColumn('billing_region', array(
            'header'    => Mage::helper('customer')->__('State/Province'),
            'width'     => '100',
            'index'     => 'billing_region',
        ));
        $this->addColumn('customer_since', array(
            'header'    => Mage::helper('customer')->__('Seller Since'),
            'type'      => 'datetime',
            'align'     => 'center',
            'index'     => 'created_at',
            'gmtoffset' => true,
        ));
        if (!Mage::app()->isSingleStoreMode()) {
            $this->addColumn('website_id', array(
                'header'    => Mage::helper('customer')->__('Website'),
                'align'     => 'center',
                'width'     => '80px',
                'type'      => 'options',
                'options'   => Mage::getSingleton('adminhtml/system_store')->getWebsiteOptionHash(true),
                'index'     => 'website_id',
            ));
        }
        $this->addColumn('deny', array(
            'header'    => Mage::helper('marketplace')->__('Reason'),
            'index'     => 'deny',
            'type'  => 'text',
            'filter'    => false,
            'sortable'  => false
        ));
        $this->addExportType('*/*/exportCsv', Mage::helper('marketplace')->__('CSV'));
        $this->addExportType('*/*/exportXml', Mage::helper('marketplace')->__('XML'));
        return parent::_prepareColumns();
    }
    public function getRowUrl($row)
    {
        return $this->getUrl('*/*/edit', array('id'=>$row->getId()));
    }
}

我想重写以下课程

<?php
class Webkul_Marketplace_Block_Adminhtml_Partners_Grid extends Mage_Adminhtml_Block_Widget_Grid
{

但我的更改并未在管理面板中反映出来。我已经搜索了很多关于这个问题但没有解决方案可行。

提前致谢。

0 个答案:

没有答案
相关问题