Link hotel detail page in event price tables
This commit is contained in:
@@ -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.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 as hotelUid', 'date.hotel_name as hotelName', 'date.hotel_header_title as hotelTitle',
|
||||||
'date.hotel_category as hotelCategory',
|
'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')
|
->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_room', 'room', 'room.date = date.uid')
|
||||||
|
->innerJoin('date', 'tx_epproducts_domain_model_hotel', 'hotel', 'hotel.uid = date.hotel')
|
||||||
->where('date.product = :productUid')
|
->where('date.product = :productUid')
|
||||||
->setParameter('productUid', $product->getUid())
|
->setParameter('productUid', $product->getUid())
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ use EP\EpProducts\Domain\Repository\ProductRepository;
|
|||||||
use EP\EpProducts\Utility\BookingUrlUtility;
|
use EP\EpProducts\Utility\BookingUrlUtility;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use TYPO3\CMS\Core\SingletonInterface;
|
use TYPO3\CMS\Core\SingletonInterface;
|
||||||
|
use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder;
|
||||||
|
|
||||||
class DateService implements SingletonInterface
|
class DateService implements SingletonInterface
|
||||||
{
|
{
|
||||||
@@ -53,21 +54,29 @@ class DateService implements SingletonInterface
|
|||||||
*/
|
*/
|
||||||
protected $dateRepository;
|
protected $dateRepository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var UriBuilder
|
||||||
|
*/
|
||||||
|
protected $uriBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param ProductRepository $productRepository
|
* @param ProductRepository $productRepository
|
||||||
* @param DateRepository $dateRepository
|
* @param DateRepository $dateRepository
|
||||||
* @param FilterService $filterService
|
* @param FilterService $filterService
|
||||||
|
* @param UriBuilder $uriBuilder
|
||||||
*/
|
*/
|
||||||
public function __construct
|
public function __construct
|
||||||
(
|
(
|
||||||
ProductRepository $productRepository,
|
ProductRepository $productRepository,
|
||||||
DateRepository $dateRepository,
|
DateRepository $dateRepository,
|
||||||
FilterService $filterService
|
FilterService $filterService,
|
||||||
|
UriBuilder $uriBuilder
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
$this->productRepository = $productRepository;
|
$this->productRepository = $productRepository;
|
||||||
$this->filterService = $filterService;
|
$this->filterService = $filterService;
|
||||||
$this->dateRepository = $dateRepository;
|
$this->dateRepository = $dateRepository;
|
||||||
|
$this->uriBuilder = $uriBuilder;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -378,11 +387,17 @@ class DateService implements SingletonInterface
|
|||||||
{
|
{
|
||||||
$categoryUid = $row['hotelCategory'];
|
$categoryUid = $row['hotelCategory'];
|
||||||
$hotelUid = $row['hotelUid'];
|
$hotelUid = $row['hotelUid'];
|
||||||
|
$hotelUri = $this->uriBuilder
|
||||||
|
->reset()
|
||||||
|
->setTargetPageUid($row['hotelDetailPageUid'])
|
||||||
|
->buildFrontendUri();
|
||||||
|
|
||||||
if (!array_key_exists($hotelUid, $priceTable[$categoryUid])) {
|
if (!array_key_exists($hotelUid, $priceTable[$categoryUid])) {
|
||||||
$priceTable[$categoryUid][$hotelUid] = [
|
$priceTable[$categoryUid][$hotelUid] = [
|
||||||
'category' => $categoryUid,
|
'category' => $categoryUid,
|
||||||
'hotelName' => $row['hotelName'],
|
'hotelName' => $row['hotelName'],
|
||||||
'hotelTitle' => $row['hotelTitle'],
|
'hotelTitle' => $row['hotelTitle'],
|
||||||
|
'hotelUri' => $hotelUri,
|
||||||
'bookingUrl' => BookingUrlUtility::generateUrl([
|
'bookingUrl' => BookingUrlUtility::generateUrl([
|
||||||
'bookingId' => $row['dateBusProId'],
|
'bookingId' => $row['dateBusProId'],
|
||||||
'hotelId' => $row['hotelBusProId'],
|
'hotelId' => $row['hotelBusProId'],
|
||||||
|
|||||||
+4
-2
@@ -21,8 +21,10 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<f:for each="{v:variable.get(name: 'pricetable.{categoryKey}', useRawKeys: 1)}" as="row">
|
<f:for each="{v:variable.get(name: 'pricetable.{categoryKey}', useRawKeys: 1)}" as="row">
|
||||||
<tr>
|
<tr>
|
||||||
<td><a class="booking-link" href="{row.bookingUrl}"
|
<td><a class="booking-link" href="{row.hotelUri}"
|
||||||
title="Jetzt buchen" target="_blank">{row.hotelTitle -> v:or(alternative: row.hotelName)}</a></td>
|
title="Infos zu {row.hotelTitle -> v:or(alternative: row.hotelName)}">
|
||||||
|
{row.hotelTitle -> v:or(alternative: row.hotelName)}
|
||||||
|
</a></td>
|
||||||
<f:for each="{roomTypesPax}" as="type">
|
<f:for each="{roomTypesPax}" as="type">
|
||||||
<td>
|
<td>
|
||||||
<f:if condition="{v:variable.get(name: 'row.rooms.{type}.available', useRawKeys: 1)}">
|
<f:if condition="{v:variable.get(name: 'row.rooms.{type}.available', useRawKeys: 1)}">
|
||||||
|
|||||||
Reference in New Issue
Block a user