Invent values if no orders found
[MAILPOET-5405]
This commit is contained in:
@@ -101,12 +101,15 @@ class FreeOrderController implements OrderController {
|
|||||||
'avatar' => $this->wp->getAvatarUrl($subscriber->getEmail(), ['size' => 20]),
|
'avatar' => $this->wp->getAvatarUrl($subscriber->getEmail(), ['size' => 20]),
|
||||||
],
|
],
|
||||||
'details' => [
|
'details' => [
|
||||||
'id' => $currentOrder ? $currentOrder->get_id() : null,
|
'id' => $currentOrder ? $currentOrder->get_id() : 0,
|
||||||
'status' => $currentOrder ? [
|
'status' => $currentOrder ? [
|
||||||
'id' => $currentOrder->get_status(),
|
'id' => $currentOrder->get_status(),
|
||||||
'name' => $this->woocommerce->wcGetOrderStatusName($currentOrder->get_status()),
|
'name' => $this->woocommerce->wcGetOrderStatusName($currentOrder->get_status()),
|
||||||
] : null,
|
] : [
|
||||||
'total' => $currentOrder ? (float)$currentOrder->get_total() : null,
|
'id' => 'completed',
|
||||||
|
'name' => $this->woocommerce->wcGetOrderStatusName('completed'),
|
||||||
|
],
|
||||||
|
'total' => $currentOrder ? (float)$currentOrder->get_total() : 0,
|
||||||
'products' => $products,
|
'products' => $products,
|
||||||
],
|
],
|
||||||
'email' => [
|
'email' => [
|
||||||
|
Reference in New Issue
Block a user