Jump to content

Back Office Orders (add column)


Recommended Posts

  • 2 years later...

You need to do 2 things.

 

1.) add the column carrier to your page

You can do this by adding the following line to the admin/tabs/AdminOrders.php

 

'id_carrier' => array('title' => $this->l('Carrier'), 'width' => 40, 'align' => 'right', 'orderby' => false, 'callback' => 'carriernames' ),

 

 

it should go in the

$this->fieldsDisplay = array(

part

 

2.) Add the callback

As you can see above, you need to add the callback carriernames so you get the name of the carrier and not it's id.

You can do this properly by overriding the Order.php file by creating an Order.php file in the override/classes directory with the following code:

 

<?php class Order extends OrderCore {public static function carriernames($id_carrier, $tr)   {   $carrier = new Carrier($id_carrier);   echo $carrier->name;   [spam-filter]?>

 

 

Please note that this does not let you order or filter by carrier as this would require more code and since I do not need this functionality I did not go into this part. Maybe someone will after looking at the method above. :)

 

Please also note that the file AdminOrders.php will probably be overwritten by the next Prestashop update, so you'll have to add that line again. No idea how to properly override this file.

Link to comment
Share on other sites

×
×
  • Create New...