keweli Posted June 1, 2010 Share Posted June 1, 2010 I have looked at the AdminOrders.php and can't figure out how I can add a column that includes Carrier Type.Any help is greatly appreciated.Thanks! Link to comment Share on other sites More sharing options...
FenyőB Posted October 22, 2012 Share Posted October 22, 2012 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 More sharing options...
Recommended Posts