Ashley Brown Ashley Brown - 1 year ago 180
PHP Question

Edit Prestashop current orders view

I'm using Prestashop

I wish to edit the raw HTML for this part.

enter image description here

Full size image link:

I wish to add an extra colum to the filters but I can't actually find the code for it...

I have searched through the

directory. Specifically the orders files but they only seem to be relevant for the view you get when you actually click on one of the orders listed below. (Below meaning the orders below the filters that you can't see)

Does anyone know the actual location for this?

Answer Source

The filters for BO orders are created by controllers\admin\AdminOrdersController.php.

In order to preserve prestashop core code it's indicated you create an override for this controller, where you'll need to join the table that you need (if not already joined), specify where in your table is the field you want to use for filter and also the field itself. Have a closer look at the constructor function of AdminOrdersController to better understand how to do this.

For example if you want to add the carrier name as a filter, create override\controllers\admin\AdminOrdersController.php file and add the following code:


class AdminOrdersController extends AdminOrdersControllerCore {
    public function __construct() {
        $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'carrier` cr ON (cr.`id_carrier` = a.`id_carrier`)';
        $this->_select .= ', as carrier';
        $this->fields_list['carrier'] = array(
            'title' => $this->l('Carrier'),
            'align' => 'text-center'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download