Add optional min-price badge to product pricetable

This commit is contained in:
Björn Fromme
2022-03-14 13:04:24 +01:00
parent 520d2ea4ee
commit 721a1be51d
5 changed files with 51 additions and 3 deletions
@@ -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;
}
}
@@ -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'
],
]
],
];
@@ -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,
@@ -205,8 +205,8 @@
<div class="headline--3 headline--underlined">
Inklusivleistungen
</div>
<div class="bg-gray-50 p-4 mb-8">
<ul class="list-none m-0 p-0">
<div class="bg-gray-50 p-4 mb-8 flex items-center">
<ul class="list-none m-0 p-0 flex-1">
<f:for each="{servicesIncluded}" as="service">
<li class="flex items-center space-x-2">
<svg class="w-6 h-6 text-ep-primary">
@@ -216,6 +216,22 @@
</li>
</f:for>
</ul>
<f:if condition="{product.minPrice} > 0">
<div class="pl-4">
<div class="relative w-32 h-32 md:w-48 md:h-48 transform rotate-3">
<svg viewBox="0 0 200 200"
xmlns="http://www.w3.org/2000/svg"
preserveAspectRatio="xMinYMin meet"
class="w-full h-full">
<circle fill="currentColor" class="text-ep-pink-50" cx="100" cy="100" r="100"/>
<circle fill="currentColor" class="text-ep-pink" cx="100" cy="100" r="70"/>
</svg>
<div class="absolute top-0 left-0 inset-0 flex flex-col items-center justify-center p-8">
<span class="block text-center text-white uppercase font-bold leading-none text-2xl md:text-3xl">ab {product.minPrice}&nbsp;</span>
</div>
</div>
</div>
</f:if>
</div>
</div>
+2
View File
@@ -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',