Skip to content

Commit 52f77af

Browse files
committed
Merge pull request #6876 in SW/shopware from ntr/5.5/fix-order-provider to 5.5
* commit '44247c3f30cfa1275ea1b5d6e2c72853c4a96bd1': NTR - Fix order hydrator schema when payments are deleted
2 parents 8405417 + 44247c3 commit 52f77af

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

engine/Shopware/Bundle/BenchmarkBundle/Provider/OrdersProvider.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,21 +185,29 @@ private function hydrateData(array $orderData)
185185
];
186186
$currentHydratedOrder['customer'] = $order['customer'];
187187

188+
if (empty($currentHydratedOrder['customer']['shipping']['country'])) {
189+
$currentHydratedOrder['customer']['shipping']['country'] = '--';
190+
}
191+
192+
if (empty($currentHydratedOrder['customer']['billing']['country'])) {
193+
$currentHydratedOrder['customer']['billing']['country'] = '--';
194+
}
195+
188196
$currentHydratedOrder['analytics'] = [
189197
'device' => $order['deviceType'],
190198
'referer' => $order['referer'] ? true : false,
191199
];
192200

193201
$currentHydratedOrder['shipment'] = [
194-
'name' => $order['dispatch']['name'],
202+
'name' => empty($order['dispatch']['name']) ? 'other' : $order['dispatch']['name'],
195203
'cost' => [
196204
'minPrice' => (float) $order['dispatch']['minPrice'],
197205
'maxPrice' => (float) $order['dispatch']['maxPrice'],
198206
],
199207
];
200208

201209
$currentHydratedOrder['payment'] = [
202-
'name' => $order['payment']['name'],
210+
'name' => empty($order['payment']['name']) ? 'other' : $order['payment']['name'],
203211
'cost' => [
204212
'percentCosts' => (float) $order['payment']['percentCosts'],
205213
'absoluteCosts' => (float) $order['payment']['absoluteCosts'],

0 commit comments

Comments
 (0)