diff --git a/src/Controller/Shop/DropinConfigurationAction.php b/src/Controller/Shop/DropinConfigurationAction.php index 4666cd20..07e0c692 100644 --- a/src/Controller/Shop/DropinConfigurationAction.php +++ b/src/Controller/Shop/DropinConfigurationAction.php @@ -122,14 +122,20 @@ private function getTranslations(): array private function getOrder(?string $orderToken = null): ?OrderInterface { + if (null === $orderToken) { + $order = $this->cartContext->getCart(); + } else { + $order = $this->orderRepository->findOneByTokenValue($orderToken); + + if (null === $order) { + $order = $this->orderRepository->findCartByTokenValue($orderToken); + } + } + /** * @var ?OrderInterface $result */ - $result = - null !== $orderToken - ? $this->orderRepository->findOneByTokenValue($orderToken) ? $this->orderRepository->findOneByTokenValue($orderToken) : $this->orderRepository->findCartByTokenValue($orderToken) - : $this->cartContext->getCart() - ; + $result = $order; return $result; }