Jump to content

add a carrier prestashop admin control column


Recommended Posts

hello

the admin when you are on the "order" we see the following tab headings: order number, order number, customer, payment status dates ... I would add a column "carrier" for if apraitre the command is colissimo letter max or withdrawal dan our local

 

 

AdminOrdersController.php

 

but it must be added or?

class AdminOrdersController extends AdminOrdersControllerCore

{

public function __construct()

{

parent::__construct();

$this->_select .= ', ca.name as carrier_name';

$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'carrier` ca ON (ca.`id_carrier` = a.`id_carrier`)';

$this->fields_list['carrier_name'] = array(

'title' => $this->l('Transporteur'),

'width' => 200,

'callback' => 'transporteur'

);

}

public function processFilter()

{

parent::processFilter();

$this->_filter = str_replace('`carrier_name`', 'ca.name', $this->_filter);

}

public function transporteur($carrier_name)

{

if (strpos(strtolower($carrier_name), 'colissimo') !== FALSE)

return '<span style="color: #006a32;">' . $carrier_name . '</span>';

else

return $carrier_name;

}

}

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...