diff --git a/public/typo3conf/ext/ep_products/Classes/Controller/SearchController.php b/public/typo3conf/ext/ep_products/Classes/Controller/SearchController.php index c99f6e18..22dbd256 100644 --- a/public/typo3conf/ext/ep_products/Classes/Controller/SearchController.php +++ b/public/typo3conf/ext/ep_products/Classes/Controller/SearchController.php @@ -137,6 +137,7 @@ class SearchController extends ActionController ->uriBuilder ->reset() ->setTargetPageUid($this->settings['defaultSearchPageUid']) + ->setCreateAbsoluteUri(true) ->uriFor( 'searchresult', ['filterSettings' => $filterSettings], diff --git a/public/typo3conf/ext/ep_theme/Classes/ViewHelpers/Uri/ProductViewHelper.php b/public/typo3conf/ext/ep_theme/Classes/ViewHelpers/Uri/ProductViewHelper.php index 6659f0f3..426c3300 100644 --- a/public/typo3conf/ext/ep_theme/Classes/ViewHelpers/Uri/ProductViewHelper.php +++ b/public/typo3conf/ext/ep_theme/Classes/ViewHelpers/Uri/ProductViewHelper.php @@ -44,6 +44,7 @@ class ProductViewHelper extends AbstractViewHelper $this->registerArgument('forceHotelUid', 'bool', 'Whether to force link a hotel'); $this->registerArgument('dateFrom', 'string', 'Date to limit table on detail page by (Y-m-d)'); $this->registerArgument('dateTo', 'string', 'Date to limit table on detail page by (Y-m-d)'); + $this->registerArgument('ref', 'string', 'Referring URL'); } /** @@ -81,13 +82,21 @@ class ProductViewHelper extends AbstractViewHelper $targetPageUid = is_array($product) ? (int)$product['detailPage'] : $product->getDetailPage(); - return $renderingContext + $uri = $renderingContext ->getControllerContext() ->getUriBuilder() ->reset() ->setTargetPageUid($targetPageUid) ->uriFor('detail', $linkArguments, 'Product', 'epproducts', 'product_detail') ; + + if ($arguments['ref']) { + $referringPageUri = urlencode($arguments['ref']); + $separator = false !== strpos($uri, '?') ? '&' : '?'; + $uri .= $separator . 'ref=' . $referringPageUri; + } + + return $uri; } } diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/Teaser.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/Teaser.html index 735b84e3..3a9b2cb4 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/Teaser.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Product/Teaser.html @@ -13,7 +13,7 @@
-