From e7bb19f9cdc1f34686ef9c6ac7024b06ad8b1127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 23 Aug 2022 12:09:42 +0200 Subject: [PATCH] Show inquiry form button only for selected concepts --- .../Classes/Controller/ProductController.php | 14 ++++++++------ .../Configuration/TypoScript/constants.typoscript | 2 ++ .../Configuration/TypoScript/setup.typoscript | 1 + .../Resources/Private/Partials/Hotel/Details.html | 14 ++++++++------ .../Private/Templates/Product/Detail.html | 3 ++- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/public/typo3conf/ext/ep_products/Classes/Controller/ProductController.php b/public/typo3conf/ext/ep_products/Classes/Controller/ProductController.php index bc7f055a..3722539f 100644 --- a/public/typo3conf/ext/ep_products/Classes/Controller/ProductController.php +++ b/public/typo3conf/ext/ep_products/Classes/Controller/ProductController.php @@ -161,12 +161,13 @@ class ProductController extends ActionController $enabledDates = array_keys($availableContingents); } - $excludedConceptUids = GeneralUtility::trimExplode(',', $this->settings['excludedConceptUids']); - $isProductWithExcludedConcept = ($product->getConcept() !== null) && \in_array($product->getConcept()->getUid(), - $excludedConceptUids, false); - $noInfoConceptUids = GeneralUtility::trimExplode(',', $this->settings['noInfoConceptUids']); - $isProductWithNoInfoConcept = ($product->getConcept() !== null) && \in_array($product->getConcept()->getUid(), - $noInfoConceptUids, false); + $concept = $product->getConcept(); + $excludedConceptUids = GeneralUtility::trimExplode(',', $this->settings['excludedConceptUids'], true); + $isProductWithExcludedConcept = ($concept !== null) && \in_array($concept->getUid(), $excludedConceptUids); + $noInfoConceptUids = GeneralUtility::trimExplode(',', $this->settings['noInfoConceptUids'], true); + $isProductWithNoInfoConcept = ($concept !== null) && \in_array($concept->getUid(), $noInfoConceptUids); + $groupInquiryFormConceptUids = GeneralUtility::trimExplode(',', $this->settings['groupInquiryFormConceptUids'], true); + $isProductWithGroupInquiryForm = ($concept !== null) && \in_array($concept->getUid(), $groupInquiryFormConceptUids); // Assemble backlink $backlinkUrl = GeneralUtility::_GET('ref'); @@ -178,6 +179,7 @@ class ProductController extends ActionController 'enabledDates' => $enabledDates ?? [], 'isProductWithExcludedConcept' => $isProductWithExcludedConcept, 'isProductWithNoInfoConcept' => $isProductWithNoInfoConcept, + 'isProductWithGroupInquiryForm' => $isProductWithGroupInquiryForm, 'currentPageUid' => $GLOBALS['TSFE']->id, 'dateFrom' => $dateFrom, 'dateTo' => $dateTo, diff --git a/public/typo3conf/ext/ep_products/Configuration/TypoScript/constants.typoscript b/public/typo3conf/ext/ep_products/Configuration/TypoScript/constants.typoscript index 3c472230..f62dc5c0 100644 --- a/public/typo3conf/ext/ep_products/Configuration/TypoScript/constants.typoscript +++ b/public/typo3conf/ext/ep_products/Configuration/TypoScript/constants.typoscript @@ -50,6 +50,8 @@ plugin.tx_epproducts { priceTableRoomTypes = 1,2,3,4,5,6,7,8,9,10 # cat=epproducts/140/110; type=string; label=Ignore following IPs in searchlog searchLogIgnoreIps = + # cat=epproducts/140/120; type=string; label=Concept UIDs to trigger inquiry form on product detail page (CSV) + groupInquiryFormConceptUids = } persistence { # cat=epproducts/100/100; type=string; label=Default storage PID diff --git a/public/typo3conf/ext/ep_products/Configuration/TypoScript/setup.typoscript b/public/typo3conf/ext/ep_products/Configuration/TypoScript/setup.typoscript index 17170686..cc1bf015 100644 --- a/public/typo3conf/ext/ep_products/Configuration/TypoScript/setup.typoscript +++ b/public/typo3conf/ext/ep_products/Configuration/TypoScript/setup.typoscript @@ -49,6 +49,7 @@ plugin.tx_epproducts { groupsPricePopupPageUid = {$plugin.tx_eptheme.settings.groupsPricePopupPageUid} groupsPriceToEmail = {$plugin.tx_epproducts.settings.groupsPriceToEmail} groupsPriceToName = {$plugin.tx_epproducts.settings.groupsPriceToName} + groupInquiryFormConceptUids = {$plugin.tx_epproducts.settings.groupInquiryFormConceptUids} logoImage = {$plugin.tx_eptheme.settings.logoImage} themekey = {$plugin.tx_eptheme.settings.themekey} datePickerPresets { diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Hotel/Details.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Hotel/Details.html index cabb1e29..fad4b39e 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Hotel/Details.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Hotel/Details.html @@ -15,12 +15,14 @@ {hotel.description -> f:format.html()} - - - - - - + + + + + + + + diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html index 070b89b1..69fbc0a1 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Product/Detail.html @@ -170,10 +170,11 @@ +
- +