diff --git a/src/Service/Tags/OrderTagService.php b/src/Service/Tags/OrderTagService.php index 76e0b3e66..d15a18c8a 100644 --- a/src/Service/Tags/OrderTagService.php +++ b/src/Service/Tags/OrderTagService.php @@ -54,9 +54,8 @@ public function addTagToSubscriptionOrder(SubscriptionEntity $entity, Context $c throw CouldNotTagOrderException::forSubscription(sprintf('Order with ID "%s" not found', $orderId)); } - // Fetch or create the tag $criteria = new Criteria(); - $criteria->addFilter(new EqualsFilter('id', $subscriptionTag->getId())); + $criteria->addFilter(new EqualsFilter('name', $subscriptionTag->getName())); /** @var null|TagEntity $tag */ $tag = $this->tagRepository->search($criteria, $context)->first(); @@ -88,6 +87,6 @@ public function addTagToSubscriptionOrder(SubscriptionEntity $entity, Context $c */ private function serializeTag(TagEntity $tag): array { - return ['id' => $tag->getId(),]; + return ['id' => $tag->getId()]; } }