Jump to content

[SOLVED] Adding Carrier & Tracking information to BO Orders Page


notcrack

Recommended Posts

I hope no-one minds me doing this, but I have just struggled to find this information and thought I'd share it.

 

I have several carriers on offer and it is a benefit to have that information at a quick glance. After having a little search of Vekia's fantastic site (mypresta) I found he had whipped up a tutorial on getting the tracking numbers displayed.

 

This was a good start, but finding the code to add the carriers was a little more difficult. I searched a number of threads until I found someone who had posted the info.

 

All info is from Vekia and a forum user called adam4x4

 

I am running 1.5.6.2

 

 

Find this code in AdminOrdersController

$this->_join = '			LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`)		LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = a.`current_state`)		LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)$this->context->language->id.')';		$this->_orderBy = 'id_order';		$this->_orderWay = 'DESC';
Add these lines
$this->_join = '						LEFT JOIN `'._DB_PREFIX_.'carrier` ca ON (ca.`id_carrier` = a.`id_carrier`)						LEFT JOIN `'._DB_PREFIX_.'order_carrier` oc ON a.`id_order` = oc.`id_order`		LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`)		LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = a.`current_state`)		LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)$this->context->language->id.')';		$this->_orderBy = 'id_order';		$this->_orderWay = 'DESC';
Then lower down in the same file find
$this->fields_list = array(		'id_order' => array(			'title' => $this->l('ID'),			'align' => 'center',			'width' => 25		),		'reference' => array(			'title' => $this->l('Reference'),			'align' => 'center',			'width' => 65		),		                'new' => array(			'title' => $this->l('New'),			'width' => 25,			'align' => 'center',			'type' => 'bool',			'tmpTableFilter' => true,			'icon' => array(				0 => 'blank.gif',				1 => array(					'src' => 'note.png',					'alt' => $this->l('First customer order'),				)
And add
$this->fields_list = array(		'id_order' => array(			'title' => $this->l('ID'),			'align' => 'center',			'width' => 25		),		'reference' => array(			'title' => $this->l('Reference'),			'align' => 'center',			'width' => 65		),							 'carrier' => array(						'title' => $this->l('Carrier'),						'width' => 100,						'type' => 'select',						'list' => $cariers_array,						'filter_key' => 'ca!name',						'filter_type' => 'int'        ),							'tracking_number' => array(                     'title' => $this->l('Tracking Number'),                             'havingFilter' => true,        ),				'new' => array(			'title' => $this->l('New'),			'width' => 25,			'align' => 'center',			'type' => 'bool',			'tmpTableFilter' => true,			'icon' => array(				0 => 'blank.gif',				1 => array(					'src' => 'note.png',					'alt' => $this->l('First customer order'),				)
This will give you the name of the carrier and tracking number in your orders list.

 

I hope this helps someone, but I usually come back to these little things for my own future use.

 

Cheers

 

Marking it as solved :)

Edited by notcrack (see edit history)
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...