Skip to content

Commit

Permalink
Merge pull request #6876 in SW/shopware from ntr/5.5/fix-order-provid…
Browse files Browse the repository at this point in the history
…er to 5.5

* commit '44247c3f30cfa1275ea1b5d6e2c72853c4a96bd1':
  NTR - Fix order hydrator schema when payments are deleted
  • Loading branch information
soebbing committed Aug 6, 2018
2 parents 8405417 + 44247c3 commit 52f77af
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions engine/Shopware/Bundle/BenchmarkBundle/Provider/OrdersProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,21 +185,29 @@ private function hydrateData(array $orderData)
];
$currentHydratedOrder['customer'] = $order['customer'];

if (empty($currentHydratedOrder['customer']['shipping']['country'])) {
$currentHydratedOrder['customer']['shipping']['country'] = '--';
}

if (empty($currentHydratedOrder['customer']['billing']['country'])) {
$currentHydratedOrder['customer']['billing']['country'] = '--';
}

$currentHydratedOrder['analytics'] = [
'device' => $order['deviceType'],
'referer' => $order['referer'] ? true : false,
];

$currentHydratedOrder['shipment'] = [
'name' => $order['dispatch']['name'],
'name' => empty($order['dispatch']['name']) ? 'other' : $order['dispatch']['name'],
'cost' => [
'minPrice' => (float) $order['dispatch']['minPrice'],
'maxPrice' => (float) $order['dispatch']['maxPrice'],
],
];

$currentHydratedOrder['payment'] = [
'name' => $order['payment']['name'],
'name' => empty($order['payment']['name']) ? 'other' : $order['payment']['name'],
'cost' => [
'percentCosts' => (float) $order['payment']['percentCosts'],
'absoluteCosts' => (float) $order['payment']['absoluteCosts'],
Expand Down

0 comments on commit 52f77af

Please sign in to comment.