Jump to content

Show carrier logo in orders list at BO?


Recommended Posts

I've tried adding the carrier logo in the orders list so my employees could check parcels prior shipping easily by adding these code tweaks into the MAIN_DIR\controllers\admin\AdminOrdersController.php (taken from AdminCarriersController.php):

        $this->bootstrap = true;
        $this->table = 'order';
        $this->className = 'Order';
        $this->lang = false;
        $this->addRowAction('view');
        $this->explicitSelect = true;
        $this->allow_export = true;
        $this->deleted = false;
        $this->context = Context::getContext();
		
        $this->fieldImageSettings = array(
            'name' => 'logo',
            'dir' => 's'
        );

And then this one into the fields_list array:

        $this->fields_list = array_merge($this->fields_list, array(
            'total_paid_tax_incl' => array(
                'title' => $this->l('Total'),
                'align' => 'text-right',
                'type' => 'price',
                'currency' => true,
                'callback' => 'setOrderCurrency',
                'badge_success' => true
            ),
            'payment' => array(
                'title' => $this->l('Payment'), 'width' => 100, 'color' => 'pay_color'
            ),
			
			'crname' => array(
                'title' => $this->l('Carrier'),
                'orderby' => false,
                'search' => false,
            ),
			
			'image' => array(
                'title' => $this->l('Logo'),
                'align' => 'center',
                'image' => 's',
                'class' => 'fixed-width-xs',
                'orderby' => false,
                'search' => false
            ),

			
            'osname' => array(
                'title' => $this->l('Status'),
                'type' => 'select',
                'color' => 'color',
                'list' => $this->statuses_array,
                'filter_key' => 'os!id_order_state',
                'filter_type' => 'int',
                'order_key' => 'osname'
            ),

The Carrier logo row appears, but it's empty.

 

I've tried looking for a code showing the carrier logo path, but there is none, seems that the carrier logo is the only one not described in controller. I've tried looking into manufacturer and supplier controllers for clues, but they seem to have very different approach to image files. Anyone have a clue how to implement this correctly?

Link to comment
Share on other sites

  • 8 months later...

I know that OP is old but still interested in this solution - I've just managed to add the name of the carrier, but employees still find it confusing. If anyone has any idea on how to solve this, any hint would be appreciated!

Link to comment
Share on other sites

  • 1 year later...
On 06.07.2017 at 11:38 AM, sting5 said:

I know that OP is old but still interested in this solution - I've just managed to add the name of the carrier, but employees still find it confusing. If anyone has any idea on how to solve this, any hint would be appreciated!

How did you add the name of the carrier, in the order list ??? 

Does it work in Prestashop 1.7.3.3 ?

 

Thank you!

Edited by etuning (see edit history)
Link to comment
Share on other sites

  • 2 months later...

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