From 67c8d7d4f4442297b73ecf08f715cdb1315065a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Tue, 15 Jan 2019 14:09:24 +0100 Subject: [PATCH] Append concept name to product name in catalog --- .../ep_products/Classes/Domain/Serialization/Product.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Product.php b/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Product.php index 2c0afa2e..3c8975b6 100644 --- a/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Product.php +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Serialization/Product.php @@ -54,6 +54,12 @@ class Product $product['@code'] = $entity->getCode(); $product['name'] = preg_replace('/[\r\n\s]+/', ' ', $entity->getName()) . ' - ' . $entity->getRegion()->getName(); + //TODO: Don't hardcode concept uids here, make them configurable + $conceptUid = $entity->getConcept()->getUid(); + if ($conceptUid !== 3 && $conceptUid !== 4) { + $product['name'] .= ' (' . $entity->getConcept()->getName() . ')'; + } + $product['facts']['fact'] = array_map(function ($fact) { /** @var Fact $fact */ return htmlspecialchars($fact->getName());