Jump to content

Override controller more than once


IAB

Recommended Posts

Hello Everyone

I am facing a issue with overriding a controller .

to explain the  environment that i am working on : 

I don't have access to the ftp to perform direct changes.

So  what i am trying to perform is to override the AdminOrdersController so  that i add a filter  to the list of orders  so i can filter  based on carrier , i am able to do so all is good for now .  but to perform this and based on the closed environment i had to create a module that when it will be installed it  will override the AdminOrdersController , and it works fine  for now .

but  when i add a another module that also  override the same controller it shows me an error  saying that i can override the controller because it is already done by another module .

my Question  is can't i override the controller more than once using  modules ?.

is there  an thing to do to by passe this ?.

 

 the  code of overriding the controller :

<?php
/**
* Overriding the AdminOrdersController
*/
class AdminOrdersController extends AdminOrdersControllerCore
{
	/*
    * module: Filterwithcarrier
    * date: 2018-06-10 12:47:39
    * version: 1.0.0
    */
    public function __construct()
	{
		parent::__construct();
        $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'carrier` cr ON (cr.`id_carrier` = a.`id_carrier`)';
        $this->_select .= ', cr.name as crname';
        $this->fields_list['crname'] = array(
            'title' => $this->l('Carrier'),
            'align' => 'text-center',
            'filter_key' => 'cr!name',
            'havingFilter' => true,
        );
	}
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...