From 5c6c8e2e6cf8b1adc8fba83396e848669ee55e16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Tue, 2 Jun 2020 11:53:37 +0200 Subject: [PATCH 1/6] Add hotel to groups.swiss api --- .../ep_products/Configuration/TypoScript/setup.typoscript | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/typo3conf/ext/ep_products/Configuration/TypoScript/setup.typoscript b/public/typo3conf/ext/ep_products/Configuration/TypoScript/setup.typoscript index ef92de7d..1bbe924e 100644 --- a/public/typo3conf/ext/ep_products/Configuration/TypoScript/setup.typoscript +++ b/public/typo3conf/ext/ep_products/Configuration/TypoScript/setup.typoscript @@ -94,6 +94,11 @@ plugin.tx_epproducts { number = 668904 key = e9d86dbc465848d7a0b68df14e3e482f } + # Weissfluh + 131 { + number = 961523 + key = 6a22585d23184f2090bd7110aa9b60f3 + } } } features { From 8d5808bfcb65d71970288db4b6442004d5036f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Tue, 2 Jun 2020 12:48:18 +0200 Subject: [PATCH 2/6] Add field 'season' to product --- .../Classes/Domain/Model/Product.php | 21 +++++++++++++++ .../Domain/Repository/ProductRepository.php | 15 ++++++----- .../Classes/Service/DateImportService.php | 3 ++- .../Classes/Service/DateService.php | 2 ++ .../Classes/Service/ProductDataService.php | 1 + .../TCA/tx_epproducts_domain_model_date.php | 12 +++++++++ .../tx_epproducts_domain_model_product.php | 26 ++++++++++++++----- .../typo3conf/ext/ep_products/ext_tables.sql | 2 ++ 8 files changed, 67 insertions(+), 15 deletions(-) diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php index 29a8e808..1b3a58f8 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php @@ -100,6 +100,11 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements */ protected $code = ''; + /** + * @var string + */ + protected $season = 'w'; + /** * @var string */ @@ -500,6 +505,22 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements $this->code = $code; } + /** + * @return string + */ + public function getSeason() + { + return $this->season; + } + + /** + * @param string $season + */ + public function setSeason($season) + { + $this->season = $season; + } + /** * @return string */ 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 8c0b62b3..b5b49b9c 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php @@ -151,7 +151,7 @@ class ProductRepository extends AbstractRepository 'region_feature as regionFeature', 'country_name as countryName', 'country_code as countryCode', 'date_start as dateStart', 'date_end as dateEnd', 'uid as dateUid', 'min_price as minPrice', - 'pseudo_price as pseudoPrice', 'nights as nights', 'available as available', + 'pseudo_price as pseudoPrice', 'nights as nights', 'available as available', 'season as season', 'skipass_included as skipassIncluded', 'bus_included as busIncluded', 'earlybird', 'new', 'daytrip', 'hide_booking_button as hideBookingButton', 'low_contingent as lowContingent', 'concept_code as conceptCode', 'concept_name as conceptName', @@ -214,7 +214,7 @@ class ProductRepository extends AbstractRepository ->select( 'date.uid as dateUid', 'date.date_start as dateStart', 'date.date_end as dateEnd', 'date.bus_pro_id as dateBusProId', 'date.hotel as hotelUid', 'date.hotel_bus_pro_id as hotelBusProId', 'date.bus_included as dateBusIncluded', - 'date.skipass_included as dateSkipassIncluded', + 'date.skipass_included as dateSkipassIncluded', 'date.season as season', 'room.uid as roomUid', 'room.bus_pro_id as roomBusProId', 'room.name as roomName', 'room.price as roomPrice', 'date.discount as roomDiscount', 'date.bus_price as busPrice', 'room.services as roomOptionalServices', 'room.nights as roomNights', 'room.available as roomAvailable' @@ -259,11 +259,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.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' + 'date.season as season', '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' ) ->from('tx_epproducts_domain_model_date', 'date') ->innerJoin('date', 'tx_epproducts_domain_model_room', 'room', 'room.date = date.uid') diff --git a/public/typo3conf/ext/ep_products/Classes/Service/DateImportService.php b/public/typo3conf/ext/ep_products/Classes/Service/DateImportService.php index df51f84f..dbb22c2f 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/DateImportService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/DateImportService.php @@ -231,7 +231,7 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface SELECT p.uid uid, p.daytrip daytrip, p.hide_booking_button, p.important important, p.name product_name, p.searchable product_searchable, p.detail_page product_detail_page, p.keywords product_keywords, p.teaser product_teaser, p.feature product_feature, p.subline product_subline, p.country country, - p.region region, p.city city, p.path_segment slug, + p.region region, p.city city, p.path_segment slug, p.season season, cnt.name country_name, cnt.code country_code, cnt.keywords country_keywords, r.name region_name, r.keywords region_keywords, r.feature region_feature, c.name city_name, c.keywords city_keywords, p.concept concept, con.name concept_name, con.code concept_code, con.sorting concept_sorting @@ -355,6 +355,7 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface 'concept_name' => $product['concept_name'], 'concept_code' => $product['concept_code'], 'concept_sorting' => $product['concept_sorting'], + 'season' => empty($product['season']) ? 'w' : $product['season'], 'date_start' => $dateStart->format('Y-m-d'), 'date_end' => $dateEnd->format('Y-m-d'), 'nights' => $nights, diff --git a/public/typo3conf/ext/ep_products/Classes/Service/DateService.php b/public/typo3conf/ext/ep_products/Classes/Service/DateService.php index b1da18c1..23211478 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/DateService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/DateService.php @@ -306,6 +306,7 @@ class DateService implements SingletonInterface $priceTable[] = [ 'dateStart' => $dateStart->format('d.m.Y'), 'dateEnd' => $dateEnd->format('d.m.Y'), + 'season' => $row['season'], 'dateBusIncluded' => (bool) $row['dateBusIncluded'], 'dateSkipassIncluded' => (bool) $row['dateSkipassIncluded'], 'roomUid' => $row['roomUid'], @@ -376,6 +377,7 @@ class DateService implements SingletonInterface 'dateSkipassIncluded' => (bool) $row['dateSkipassIncluded'], 'dateServicesIncluded' => unserialize($row['dateServicesIncluded'], ['allowed_classes' => false]), 'dateServicesGeneral' => unserialize($row['dateServicesGeneral'], ['allowed_classes' => false]), + 'season' => $row['season'], 'available' => $row['available'], 'bookingUrl' => $bookingUrl, 'isHideBookingButton' => $isHideBookingButton, diff --git a/public/typo3conf/ext/ep_products/Classes/Service/ProductDataService.php b/public/typo3conf/ext/ep_products/Classes/Service/ProductDataService.php index ddc01ded..567e20cd 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/ProductDataService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/ProductDataService.php @@ -199,6 +199,7 @@ class ProductDataService implements SingletonInterface 'hideBookingButton' => $teaserData['hideBookingButton'], 'lowContingent' => $teaserData['lowContingent'], 'servicesIncluded' => unserialize($teaserData['servicesIncluded']), + 'season' => $teaserData['season'], 'product' => [ 'uid' => $teaserData['productUid'], 'name' => $teaserData['productName'], diff --git a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_date.php b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_date.php index 553b9187..62aa5809 100644 --- a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_date.php +++ b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_date.php @@ -158,6 +158,18 @@ return [ 'default' => 0 ] ], + 'season' => [ + 'exclude' => 0, + 'label' => 'Saison', + 'config' => [ + 'type' => 'select', + 'items' => [ + [ 'Winter', 'w' ], + [ 'Sommer', 's' ], + ], + 'default' => 'w', + ], + ], 'date_start' => [ 'exclude' => 0, 'label' => 'Datum von', diff --git a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_product.php b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_product.php index d626d1d7..7021ff2e 100644 --- a/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_product.php +++ b/public/typo3conf/ext/ep_products/Configuration/TCA/tx_epproducts_domain_model_product.php @@ -24,12 +24,12 @@ return [ ], 'interface' => [ 'showRecordFieldList' => 'sys_language_uid, l10n_parent, l10n_diffsource, hidden, searchable, bookable, - detail_page, name, name_internal, subline, keywords, headline, code, feature, bus_pro_id, teaser, teaser_long, - concept_description, board_description, additional_services, programme_description, ski_pass_description, - rating_average, rating_votes_count, teaser_images, header_images, images, concept, country, region, city, - journey, facts, officetip, hotels, calendar_hotel, faqs,header_title,header_subtitle, alt_product, alt_label, - video, banner, additional_regions, badge, daytrip, testimonials, external_link, path_segment, - hide_booking_button,non_bookable_dates', + season, detail_page, name, name_internal, subline, keywords, headline, code, feature, bus_pro_id, teaser, + teaser_long, concept_description, board_description, additional_services, programme_description, + ski_pass_description, rating_average, rating_votes_count, teaser_images, header_images, images, concept, + country, region, city, journey, facts, officetip, hotels, calendar_hotel, faqs,header_title,header_subtitle, + alt_product, alt_label, video, banner, additional_regions, badge, daytrip, testimonials, external_link, + path_segment, hide_booking_button,non_bookable_dates', ], 'types' => [ '1' => [ @@ -47,7 +47,7 @@ return [ 'palettes' => [ 'destinations' => ['showitem' => 'country,region,city'], 'top' => ['showitem' => 'searchable, bookable, hide_booking_button, daytrip, important, skipass_included, - detail_page, external_link, path_segment'], + season, detail_page, external_link, path_segment'], 'name' => ['showitem' => 'name,code'], 'alternative' => ['showitem' => 'alt_product, alt_label'], 'header' => ['showitem' => 'headline,subline,--linebreak--,header_title,header_subtitle'], @@ -186,6 +186,18 @@ return [ 'default' => true, ], ], + 'season' => [ + 'exclude' => 0, + 'label' => 'Saison', + 'config' => [ + 'type' => 'select', + 'items' => [ + [ 'Winter', 'w' ], + [ 'Sommer', 's' ], + ], + 'default' => 'w', + ], + ], 'detail_page' => [ 'exclude' => 0, 'label' => 'Detailseite', diff --git a/public/typo3conf/ext/ep_products/ext_tables.sql b/public/typo3conf/ext/ep_products/ext_tables.sql index 69bbfb0c..d4905809 100644 --- a/public/typo3conf/ext/ep_products/ext_tables.sql +++ b/public/typo3conf/ext/ep_products/ext_tables.sql @@ -10,6 +10,7 @@ CREATE TABLE tx_epproducts_domain_model_product searchable tinyint(4) unsigned DEFAULT '1' NOT NULL, bookable tinyint(4) unsigned DEFAULT '1' NOT NULL, + season varchar(64) DEFAULT '' NOT NULL, hide_booking_button tinyint(4) unsigned DEFAULT '0' NOT NULL, daytrip tinyint(4) unsigned DEFAULT '0' NOT NULL, important tinyint(4) unsigned DEFAULT '0' NOT NULL, @@ -101,6 +102,7 @@ CREATE TABLE tx_epproducts_domain_model_date bus_pro_id int(11) DEFAULT '0' NOT NULL, hotel_bus_pro_id int(11) DEFAULT '0' NOT NULL, code varchar(255) DEFAULT '' NOT NULL, + season varchar(64) DEFAULT '' NOT NULL, date_start date DEFAULT '0000-00-00', date_end date DEFAULT '0000-00-00', nights int(11) DEFAULT '0' NOT NULL, From 48a4b41e7983e9c62e5f3de4a1eec0139c65e580 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Tue, 2 Jun 2020 12:48:46 +0200 Subject: [PATCH 3/6] Show labels for included services depending on season --- .../Resources/Private/Assets/js/components/DatesTable.vue | 2 +- .../Resources/Private/Assets/js/components/PriceTable.vue | 2 +- .../ext/ep_theme/Resources/Private/Partials/Product/Teaser.html | 2 +- .../ep_theme/Resources/Private/Partials/Product/TeaserWide.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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 ad9bff32..64055dc8 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 @@ -61,7 +61,7 @@