From 3af9c4d3a8cfabc3228fd131b8682837449dbed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Fri, 19 Jul 2019 13:04:04 +0200 Subject: [PATCH] Show pseudo prices in price/dates-tables --- .../Classes/Domain/Repository/ProductRepository.php | 10 +++++----- .../ext/ep_products/Classes/Service/DateService.php | 5 +++-- .../Private/Assets/js/components/DatesTable.vue | 9 ++++++--- .../Resources/Private/Assets/scss/remix/_tables.scss | 8 ++++++++ 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php b/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php index 32f1dd2b..17d14afa 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php @@ -260,12 +260,12 @@ class ProductRepository extends AbstractRepository $query = $qb ->select( 'date.uid as dateUid', 'date.date_start as dateStart', 'date.date_end as dateEnd', - 'date.min_price as dateMinPrice', 'date.discount as dateDiscount', 'date.bus_price as busPrice', - 'date.nights as dateNights', 'date.bus_included as dateBusIncluded', 'date.services_included as dateServicesIncluded', - 'date.services_general as dateServicesGeneral', 'date.skipass_included as dateSkipassIncluded', - 'date.bus_pro_id as dateBusProId', 'date.hotel_bus_pro_id as hotelBusProId' + 'date.min_price as dateMinPrice', 'date.pseudo_price as datePseudoPrice', 'date.discount as dateDiscount', + 'date.bus_price as busPrice', 'date.nights as dateNights', 'date.bus_included as dateBusIncluded', + 'date.services_included as dateServicesIncluded', 'date.services_general as dateServicesGeneral', + 'date.skipass_included as dateSkipassIncluded', 'date.bus_pro_id as dateBusProId', + 'date.hotel_bus_pro_id as hotelBusProId', 'date.available as available' ) - ->addSelectLiteral('SUM(room.available) as available') ->from('tx_epproducts_domain_model_date', 'date') ->innerJoin('date', 'tx_epproducts_domain_model_room', 'room', 'room.date = date.uid') ->leftJoin('date', 'tx_epproducts_product_region_mm', 'mm', 'mm.uid_local = date.product') diff --git a/public/typo3conf/ext/ep_products/Classes/Service/DateService.php b/public/typo3conf/ext/ep_products/Classes/Service/DateService.php index 8abca684..44b0631c 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/DateService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/DateService.php @@ -341,13 +341,14 @@ class DateService implements SingletonInterface 'dateStart' => $dateStart->format('d.m.y'), 'dateEnd' => $dateEnd->format('d.m.y'), 'dateMinPrice' => $row['dateMinPrice'], + 'datePseudoPrice' => $row['datePseudoPrice'], 'dateBusPrice' => $row['dateBusPrice'], 'dateDiscount' => $row['dateDiscount'], 'dateNights' => $row['dateNights'], 'dateBusIncluded' => (bool) $row['dateBusIncluded'], 'dateSkipassIncluded' => (bool) $row['dateSkipassIncluded'], - 'dateServicesIncluded' => unserialize($row['dateServicesIncluded']), - 'dateServicesGeneral' => unserialize($row['dateServicesGeneral']), + 'dateServicesIncluded' => unserialize($row['dateServicesIncluded'], ['allowed_classes' => false]), + 'dateServicesGeneral' => unserialize($row['dateServicesGeneral'], ['allowed_classes' => false]), 'available' => $row['available'], 'bookingUrl' => $bookingUrl, ]; diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DatesTable.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DatesTable.vue index e37ab5a7..f320c82a 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DatesTable.vue +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/DatesTable.vue @@ -27,8 +27,8 @@ Termin - Nächte - Preis ab + + ab inkl. @@ -53,7 +53,10 @@ {{ row.dateNights }} - {{ calculatePrice(row) }} € + + {{ row.datePseudoPrice }} + {{ calculatePrice(row) }} +