Jump to content

How add column shipping cost to order list in Prestashop 1.7?


JirkaDeLucina

Recommended Posts

I would like add new column "Shipping cost" to order list in backoffice of Prestashop 1.7. I read a lot of tutorials about adding new column, but nowhere is advice about shipping cost.

Another solution should be, if the shipping cost will be shown directly in field with order total price? Eg.: 150 USD (2 USD) - where 2 USD are shipping cost.

Any help would be appreciated. I use PS version 1.7.4.

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

  • 6 months later...

Hello,

I found the solution in https://stackoverflow.com/questions/59275761/how-add-column-shipping-cost-to-order-list-in-prestashop-1-7 :

 in file: controllers/admin/AdminOrdersControler.php add under (line about 110): $this->fields_list = array_merge($this->fields_list, array(

add this code:

'total_shipping' => array( 'title' => $this->l('Shipping'), 'filter_key' => 'a!total_shipping', 'type' => 'price', 'currency' => true, 'callback' => 'setOrderCurrency' ),

and add above line 200: public static function setOrderCurrency($echo, $tr)

add this code:

public function displayTotal_shipping($value) { return Tools::ps_round($value, 0); }

Be cereful folks, this will work on 1.7 (and maybe 1.6) up to 1.7.6.5 but 1.7.7 may be different because i think they put the order management in symfony.

But for real i want to display the price tax excluded minus shipping price and i'm stuck...

 

Edited by aduploye (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 1 month 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...