Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default carrier name was displayed as 0 #12140

Merged
merged 6 commits into from
Jan 22, 2019
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion classes/order/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@ public function getReturn()
*/
public function getShipping()
{
return Db::getInstance()->executeS(
$results = 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 `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
Expand All @@ -1919,6 +1919,10 @@ public function getShipping()
WHERE o.`id_order` = ' . (int) $this->id . '
GROUP BY c.id_carrier'
);
foreach ($results as &$row) {
$row['carrier_name'] = Cart::replaceZeroByShopName($row['carrier_name'], null);
}
return $results;
}

/**
Expand Down