diff --git a/admin-dev/themes/default/template/controllers/orders/_shipping.tpl b/admin-dev/themes/default/template/controllers/orders/_shipping.tpl
index 7dd842ac3..ca22c24c1 100644
--- a/admin-dev/themes/default/template/controllers/orders/_shipping.tpl
+++ b/admin-dev/themes/default/template/controllers/orders/_shipping.tpl
@@ -45,7 +45,7 @@
| {dateFormat date=$line.date_add full=true} |
{$line.type} |
- {$line.state_name} |
+ {$line.carrier_name} |
{$line.weight|string_format:"%.3f"} {Configuration::get('PS_WEIGHT_UNIT')} |
{if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_INC}
diff --git a/classes/order/Order.php b/classes/order/Order.php
index 11cc76562..36c2b45af 100644
--- a/classes/order/Order.php
+++ b/classes/order/Order.php
@@ -1510,11 +1510,12 @@ class OrderCore extends ObjectModel
/**
* @return array return all shipping method for the current order
+ * state_name sql var is now deprecated - use order_state_name for the state name and carrier_name for the carrier_name
*/
public function getShipping()
{
return Db::getInstance()->executeS('
- SELECT DISTINCT oc.`id_order_invoice`, oc.`weight`, oc.`shipping_cost_tax_excl`, oc.`shipping_cost_tax_incl`, c.`url`, oc.`id_carrier`, c.`name` as `state_name`, oc.`date_add`, "Delivery" as `type`, "true" as `can_edit`, oc.`tracking_number`, oc.`id_order_carrier`
+ SELECT DISTINCT oc.`id_order_invoice`, oc.`weight`, oc.`shipping_cost_tax_excl`, oc.`shipping_cost_tax_incl`, c.`url`, oc.`id_carrier`, c.`name` as `carrier_name`, oc.`date_add`, "Delivery" as `type`, "true" as `can_edit`, oc.`tracking_number`, oc.`id_order_carrier`, osl.`name` as order_state_name, c.`name` as state_name
FROM `'._DB_PREFIX_.'orders` o
LEFT JOIN `'._DB_PREFIX_.'order_history` oh
ON (o.`id_order` = oh.`id_order`)
@@ -1524,7 +1525,8 @@ class OrderCore extends ObjectModel
ON (oc.`id_carrier` = c.`id_carrier`)
LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl
ON (oh.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)Context::getContext()->language->id.')
- WHERE oc.`id_order` = '.(int)$this->id);
+ WHERE o.`id_order` = '.(int)$this->id.'
+ GROUP BY c.id_carrier');
}
diff --git a/themes/default/mobile/order-detail.tpl b/themes/default/mobile/order-detail.tpl
index d2a513e03..c341b7461 100644
--- a/themes/default/mobile/order-detail.tpl
+++ b/themes/default/mobile/order-detail.tpl
@@ -203,7 +203,7 @@
{foreach from=$order->getShipping() item=line}
-
-
{$line.state_name}
+ {$line.carrier_name}
{l s='Weight'} {$line.weight|string_format:"%.3f"} {Configuration::get('PS_WEIGHT_UNIT')}
{l s='Shipping cost'} {if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_INC}{displayPrice price=$line.shipping_cost_tax_incl currency=$currency->id}{else}{displayPrice price=$line.shipping_cost_tax_excl currency=$currency->id}{/if}
{l s='Tracking number'} {if $line.url && $line.tracking_number}{$line.tracking_number}{elseif $line.tracking_number != ''}{$line.tracking_number}{else}----{/if}
diff --git a/themes/default/order-detail.tpl b/themes/default/order-detail.tpl
index c305611de..c36c33366 100644
--- a/themes/default/order-detail.tpl
+++ b/themes/default/order-detail.tpl
@@ -326,7 +326,7 @@
{foreach from=$order->getShipping() item=line}
| {$line.date_add} |
- {$line.state_name} |
+ {$line.carrier_name} |
{if $line.weight > 0}{$line.weight|string_format:"%.3f"} {Configuration::get('PS_WEIGHT_UNIT')}{else}-{/if} |
{if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_INC}{displayPrice price=$line.shipping_cost_tax_incl currency=$currency->id}{else}{displayPrice price=$line.shipping_cost_tax_excl currency=$currency->id}{/if} |
| |