diff --git a/src/Subscriber/OrderEditSubscriber.php b/src/Subscriber/OrderEditSubscriber.php index 4e275e74f..931fbe20a 100644 --- a/src/Subscriber/OrderEditSubscriber.php +++ b/src/Subscriber/OrderEditSubscriber.php @@ -64,7 +64,7 @@ public function accountOrderDetailPageLoaded(AccountOrderPageLoadedEvent $event) continue; } - $lastTransaction = $transactions->filter(Closure::fromCallable([$this, 'sortTransactionsByDate'])); + $lastTransaction = $transactions->filter(Closure::fromCallable([$this, 'sortTransactionsByDate']))->last(); $lastStatus = $lastTransaction->getStateMachineState()->getTechnicalName(); @@ -129,7 +129,7 @@ private function isMolliePayment(OrderEntity $order): bool { $customFields = $order->getCustomFields(); - return is_array($customFields) && !count($customFields) && isset($customFields['mollie_payments']); + return is_array($customFields) && count($customFields) && isset($customFields['mollie_payments']); } /**