diff --git a/web/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php b/web/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php index 05b4a34e..ff187673 100644 --- a/web/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php +++ b/web/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php @@ -359,10 +359,12 @@ class ProductRepository extends AbstractRepository 'date.bus_pro_id as dateBusProId', 'date.hotel_bus_pro_id as hotelBusProId', 'date.date_end as dateEnd', 'date.hotel as hotelUid', 'date.hotel_name as hotelName', 'date.hotel_header_title as hotelTitle', 'date.hotel_category as hotelCategory', - 'room.pax as roomPax', 'room.price as roomPrice', 'room.available as available' + 'room.pax as roomPax', 'room.price as roomPrice', 'room.available as available', + 'hotel.detail_page as hotelDetailPageUid' ) ->from('tx_epproducts_domain_model_date', 'date') ->innerJoin('date', 'tx_epproducts_domain_model_room', 'room', 'room.date = date.uid') + ->innerJoin('date', 'tx_epproducts_domain_model_hotel', 'hotel', 'hotel.uid = date.hotel') ->where('date.product = :productUid') ->setParameter('productUid', $product->getUid()) ; diff --git a/web/typo3conf/ext/ep_products/Classes/Service/DateService.php b/web/typo3conf/ext/ep_products/Classes/Service/DateService.php index 1e1eac9a..31a686a0 100644 --- a/web/typo3conf/ext/ep_products/Classes/Service/DateService.php +++ b/web/typo3conf/ext/ep_products/Classes/Service/DateService.php @@ -35,6 +35,7 @@ use EP\EpProducts\Domain\Repository\ProductRepository; use EP\EpProducts\Utility\BookingUrlUtility; use Symfony\Component\OptionsResolver\OptionsResolver; use TYPO3\CMS\Core\SingletonInterface; +use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder; class DateService implements SingletonInterface { @@ -53,21 +54,29 @@ class DateService implements SingletonInterface */ protected $dateRepository; + /** + * @var UriBuilder + */ + protected $uriBuilder; + /** * @param ProductRepository $productRepository * @param DateRepository $dateRepository * @param FilterService $filterService + * @param UriBuilder $uriBuilder */ public function __construct ( ProductRepository $productRepository, DateRepository $dateRepository, - FilterService $filterService + FilterService $filterService, + UriBuilder $uriBuilder ) { $this->productRepository = $productRepository; $this->filterService = $filterService; $this->dateRepository = $dateRepository; + $this->uriBuilder = $uriBuilder; } /** @@ -378,11 +387,17 @@ class DateService implements SingletonInterface { $categoryUid = $row['hotelCategory']; $hotelUid = $row['hotelUid']; + $hotelUri = $this->uriBuilder + ->reset() + ->setTargetPageUid($row['hotelDetailPageUid']) + ->buildFrontendUri(); + if (!array_key_exists($hotelUid, $priceTable[$categoryUid])) { $priceTable[$categoryUid][$hotelUid] = [ 'category' => $categoryUid, 'hotelName' => $row['hotelName'], 'hotelTitle' => $row['hotelTitle'], + 'hotelUri' => $hotelUri, 'bookingUrl' => BookingUrlUtility::generateUrl([ 'bookingId' => $row['dateBusProId'], 'hotelId' => $row['hotelBusProId'], diff --git a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/EventPricetable.html b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/EventPricetable.html index 0b65914b..e7385432 100644 --- a/web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/EventPricetable.html +++ b/web/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/EventPricetable.html @@ -21,8 +21,10 @@ - {row.hotelTitle -> v:or(alternative: row.hotelName)} + + {row.hotelTitle -> v:or(alternative: row.hotelName)} +