From 721a1be51d4e3890e54ca85019b98d9b6caa8d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 14 Mar 2022 13:04:24 +0100 Subject: [PATCH] Add optional min-price badge to product pricetable --- .../Classes/Domain/Model/Product.php | 21 +++++++++++++++++++ .../tx_epproducts_domain_model_product.php | 10 ++++++++- .../typo3conf/ext/ep_products/ext_tables.sql | 1 + .../Templates/AjaxTable/Pricetable.html | 20 ++++++++++++++++-- tailwind.config.js | 2 ++ 5 files changed, 51 insertions(+), 3 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 0b9b0bce..a6d0723e 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Model/Product.php @@ -270,6 +270,11 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements */ protected $nonBookableDates; + /** + * @var int + */ + protected $minPrice; + public function __construct() { $this->initStorageObjects(); @@ -1090,4 +1095,20 @@ class Product extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity implements return $this->nonBookableDates; } + /** + * @return int + */ + public function getMinPrice(): int + { + return $this->minPrice; + } + + /** + * @param int $minPrice + */ + public function setMinPrice($minPrice) + { + $this->minPrice = $minPrice; + } + } 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 e4736a33..cd2b44b5 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 @@ -37,7 +37,7 @@ return [ 'palettes' => [ 'destinations' => ['showitem' => 'country,region,city'], 'top' => ['showitem' => 'searchable, bookable, hide_booking_button, daytrip, important, skipass_included, - season, detail_page, external_link, path_segment'], + season, detail_page, external_link, path_segment, min_price'], 'name' => ['showitem' => 'name,code'], 'alternative' => ['showitem' => 'alt_product, alt_label'], 'header' => ['showitem' => 'headline, subline, --linebreak--, header_title, header_subtitle'], @@ -840,5 +840,13 @@ return [ 'itemsProcFunc' => \EP\EpProducts\UserFunc\TcaProcFunc::class.'->getDateItemsForProduct', ] ], + 'min_price' => [ + 'exclude' => 0, + 'label' => 'Ab-Preis', + 'config' => [ + 'type' => 'input', + 'eval' => 'int' + ], + ] ], ]; diff --git a/public/typo3conf/ext/ep_products/ext_tables.sql b/public/typo3conf/ext/ep_products/ext_tables.sql index 3e0dfe78..46d28275 100644 --- a/public/typo3conf/ext/ep_products/ext_tables.sql +++ b/public/typo3conf/ext/ep_products/ext_tables.sql @@ -61,6 +61,7 @@ CREATE TABLE tx_epproducts_domain_model_product banner int(11) unsigned NOT NULL default '0', badge int(11) unsigned NOT NULL default '0', non_bookable_dates varchar(255) DEFAULT '' NOT NULL, + min_price int(11) unsigned NOT NULL default '0', tstamp int(11) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, cruser_id int(11) unsigned DEFAULT '0' NOT NULL, diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/Pricetable.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/Pricetable.html index b78f7b62..c835c054 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/Pricetable.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/Pricetable.html @@ -205,8 +205,8 @@
Inklusivleistungen
-
-
diff --git a/tailwind.config.js b/tailwind.config.js index fee126b8..45252c0b 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -92,6 +92,8 @@ module.exports = { 'primary-dark-80': tinycolor('#18527b').setAlpha(0.8).toRgbString(), 'secondary-10': tinycolor('#f0bc44').setAlpha(0.1).toRgbString(), 'secondary-80': tinycolor('#f0bc44').setAlpha(0.8).toRgbString(), + pink: '#fa1a8c', + 'pink-50': tinycolor('#fa1a8c').setAlpha(0.5).toRgbString(), }, sbw: { primary: '#f0bc44',