Jump to content

Highlighting Extras In Back Office?


Nothingbuttea

Recommended Posts

  • 4 months later...

You can add a "Gift wrapping" column to the orders list by creating override/controllers/admin/AdminOrdersController.php with the following:

<?php

class AdminOrdersController extends AdminOrdersControllerCore
{
    public function __construct()
    {
        parent::__construct();
        
        $this->_select .= ', a.gift';
        
        $this->fields_list['gift'] = array(
            'title' => $this->l('Gift wrapping'),
            'align' => 'text-center',            
            'type' => 'bool',
            'tmpTableFilter' => true,
            'orderby' => false,
            'callback' => 'printGiftWrapping'
        );
    }
    
    public function printGiftWrapping($id_order, $tr)
    {
        return ($tr['gift'] ? $this->l('Yes') : $this->l('No'));
    }
}

Remember to go to Advanced Parameters > Performance and then click the "Clear cache" button (or manually delete cache/class_index.php) so PrestaShop finds the override.

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