Files
typo3-13/packages/ep_theme/Classes/ViewHelpers/PriceRangeViewHelper.php
T
frommeandClaude Opus 5.5 72465053cd feat: product search on TYPO3 13
Search page (searchresult plugin), AJAX results and filter panel, the
mobile filter overlay, search links ("Alle anzeigen", menu icon) and
the /reiseauswahl/{name} landing redirects are back. The search bar in
the page header stays out (SearchbarController not ported); on detail
pages the menu icon links to the search page instead of toggling it.

- Extbase requests are immutable: withArgument() instead of
  setArgument()
- StaticSearchParamsMiddleware runs after site resolution and before
  page resolution (the old position is a cycle in v13); FilterService
  copes with the missing TypoScript there, as TYPO3 10 did
- Search and filter forms are sent URL-encoded instead of multipart, so
  production can keep rejecting multipart requests
- ski-wochenenden: websiteTitle from the old sys_template sitetitle

Compared with TYPO3 10 on the same data (249 cases: search pages with
all 41 preset filters, landing redirects, AJAX results and filter
panel, GET and POST): 186 identical, 63 with the same results in a
different order (PHP 8 sorts stably, ties came out in arbitrary order
on PHP 7.4). Processed image names differ by their configuration hash.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 15:47:15 +02:00

60 lines
2.0 KiB
PHP

<?php
namespace EP\EpTheme\ViewHelpers;
/***************************************************************
*
* Copyright notice
*
* (c) 2021 Björn Fromme <[email protected]>, dreipunktnull
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
class PriceRangeViewHelper extends AbstractViewHelper
{
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('min', 'mixed', 'Price range start');
$this->registerArgument('max', 'mixed', 'Price range end');
}
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return mixed
*/
public function render()
{
if (1 === (int) $this->arguments['min']) {
return sprintf('bis %d €', $this->arguments['max']);
}
if (999 === (int) $this->arguments['max']) {
return sprintf('ab %d €', $this->arguments['min']);
}
return sprintf('%d bis %d €', $this->arguments['min'], $this->arguments['max']);
}
}