feat: render 'new' badge in teasers and product detail header
This commit is contained in:
@@ -135,6 +135,11 @@ class Date extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
|||||||
*/
|
*/
|
||||||
protected $available = 0;
|
protected $available = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected $new = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int $bookingId
|
* @return int $bookingId
|
||||||
*/
|
*/
|
||||||
@@ -469,4 +474,13 @@ class Date extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity
|
|||||||
$this->available = $available;
|
$this->available = $available;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isNew()
|
||||||
|
{
|
||||||
|
return $this->new;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setNew(bool $new)
|
||||||
|
{
|
||||||
|
$this->new = $new;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class ProductRepository extends AbstractRepository
|
|||||||
'date.board as board', 'date.board_bus_pro_id as boardUid',
|
'date.board as board', 'date.board_bus_pro_id as boardUid',
|
||||||
'date.product_fact as productFact', 'date.hotel_fact as hotelFact', 'date.region_fact as regionFact',
|
'date.product_fact as productFact', 'date.hotel_fact as hotelFact', 'date.region_fact as regionFact',
|
||||||
'date.services_included as servicesIncluded',
|
'date.services_included as servicesIncluded',
|
||||||
'date.bus_available as busAvailable',
|
'date.bus_available as busAvailable', 'date.new as new',
|
||||||
'date.min_price as minPrice', 'date.nights as nights', 'date.available as available',
|
'date.min_price as minPrice', 'date.nights as nights', 'date.available as available',
|
||||||
'date.pseudo_price as pseudoPrice', 'date.hide_booking_button as hideBookingButton',
|
'date.pseudo_price as pseudoPrice', 'date.hide_booking_button as hideBookingButton',
|
||||||
'room.type as roomType'
|
'room.type as roomType'
|
||||||
@@ -132,7 +132,7 @@ class ProductRepository extends AbstractRepository
|
|||||||
'skipass_included as skipassIncluded', 'bus_included as busIncluded',
|
'skipass_included as skipassIncluded', 'bus_included as busIncluded',
|
||||||
'earlybird', 'new', 'daytrip', 'hide_booking_button as hideBookingButton',
|
'earlybird', 'new', 'daytrip', 'hide_booking_button as hideBookingButton',
|
||||||
'low_contingent as lowContingent', 'concept_code as conceptCode', 'concept_name as conceptName',
|
'low_contingent as lowContingent', 'concept_code as conceptCode', 'concept_name as conceptName',
|
||||||
'board'
|
'board', 'new'
|
||||||
)
|
)
|
||||||
->from('tx_epproducts_domain_model_date', 'date')
|
->from('tx_epproducts_domain_model_date', 'date')
|
||||||
->where('date_start >= NOW()')
|
->where('date_start >= NOW()')
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ class SearchResultService implements SingletonInterface
|
|||||||
'dates' => [],
|
'dates' => [],
|
||||||
'nights' => [],
|
'nights' => [],
|
||||||
'rooms' => [],
|
'rooms' => [],
|
||||||
|
'new' => $row['new'],
|
||||||
];
|
];
|
||||||
$total++;
|
$total++;
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-1
@@ -25,7 +25,7 @@ return [
|
|||||||
'types' => [
|
'types' => [
|
||||||
'1' => ['showitem' => 'hidden, bus_pro_id, hotel_bus_pro_id, code, daytrip, date_start, date_end, nights, board,
|
'1' => ['showitem' => 'hidden, bus_pro_id, hotel_bus_pro_id, code, daytrip, date_start, date_end, nights, board,
|
||||||
board_code, board_bus_pro_id, bus_included, bus_available, skipass_included, services_included,
|
board_code, board_bus_pro_id, bus_included, bus_available, skipass_included, services_included,
|
||||||
services_general, pickups, discount, min_price, pseudo_price, available'],
|
services_general, pickups, discount, min_price, pseudo_price, available, new'],
|
||||||
],
|
],
|
||||||
'palettes' => [
|
'palettes' => [
|
||||||
'1' => ['showitem' => ''],
|
'1' => ['showitem' => ''],
|
||||||
@@ -314,5 +314,13 @@ return [
|
|||||||
'eval' => 'trim',
|
'eval' => 'trim',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'new' => [
|
||||||
|
'exclude' => 0,
|
||||||
|
'label' => 'neu',
|
||||||
|
'config' => [
|
||||||
|
'type' => 'check',
|
||||||
|
'default' => 0,
|
||||||
|
],
|
||||||
|
],
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -49,6 +49,11 @@
|
|||||||
{product.concept.name}
|
{product.concept.name}
|
||||||
</div>
|
</div>
|
||||||
</f:if>
|
</f:if>
|
||||||
|
<f:if condition="{hotel.new}">
|
||||||
|
<div class="flex items-center text-white font-semibold leading-none uppercase h-6 md:h-8 px-2 bg-badge-gradient">
|
||||||
|
NEU!
|
||||||
|
</div>
|
||||||
|
</f:if>
|
||||||
</div>
|
</div>
|
||||||
<f:if condition="{referringUrl}">
|
<f:if condition="{referringUrl}">
|
||||||
<a href="{referringUrl}" class="button bg-button button--small mt-8">
|
<a href="{referringUrl}" class="button bg-button button--small mt-8">
|
||||||
|
|||||||
@@ -55,6 +55,11 @@
|
|||||||
<svg class="product-teaser__watchlist-icon" data-watchlist-toggle-target="icon" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"></path></svg>
|
<svg class="product-teaser__watchlist-icon" data-watchlist-toggle-target="icon" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"></path></svg>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<f:if condition="{new}">
|
||||||
|
<div class="absolute top-12 left-2 text-white font-bold text-sm leading-none p-1 bg-badge-gradient">
|
||||||
|
NEU!
|
||||||
|
</div>
|
||||||
|
</f:if>
|
||||||
<f:if condition="{showHotelDetails} && {concept.code} == 'evt'">
|
<f:if condition="{showHotelDetails} && {concept.code} == 'evt'">
|
||||||
<div class="absolute bottom-0 left-0 inset-x-0 flex justify-between text-white {f:if(condition: landscape, else: 'text-sm')} bg-concept-evt/70 px-2 py-1">
|
<div class="absolute bottom-0 left-0 inset-x-0 flex justify-between text-white {f:if(condition: landscape, else: 'text-sm')} bg-concept-evt/70 px-2 py-1">
|
||||||
<span>{hotel.name}</span>
|
<span>{hotel.name}</span>
|
||||||
|
|||||||
@@ -83,6 +83,7 @@
|
|||||||
dateTo: item.maxDateEnd,
|
dateTo: item.maxDateEnd,
|
||||||
forceHotelUid: 1,
|
forceHotelUid: 1,
|
||||||
showHotelDetails: 1,
|
showHotelDetails: 1,
|
||||||
|
new: item.new,
|
||||||
referringPageUri: referringPageUri
|
referringPageUri: referringPageUri
|
||||||
}"/>
|
}"/>
|
||||||
</f:for>
|
</f:for>
|
||||||
|
|||||||
+1
@@ -23,6 +23,7 @@
|
|||||||
forceHotelUid: teaser.forceHotelUid,
|
forceHotelUid: teaser.forceHotelUid,
|
||||||
dateFrom: dateFrom,
|
dateFrom: dateFrom,
|
||||||
dateTo: dateTo,
|
dateTo: dateTo,
|
||||||
|
new: teaser.new,
|
||||||
landscape: '{f:if(condition: \'{data.layout} == 2 || {data.layout} == 3\', then: 1, else: 0)}'
|
landscape: '{f:if(condition: \'{data.layout} == 2 || {data.layout} == 3\', then: 1, else: 0)}'
|
||||||
}"/>
|
}"/>
|
||||||
</f:if>
|
</f:if>
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
forceHotelUid: teaser.forceHotelUid,
|
forceHotelUid: teaser.forceHotelUid,
|
||||||
dateFrom: dateFrom,
|
dateFrom: dateFrom,
|
||||||
dateTo: dateTo,
|
dateTo: dateTo,
|
||||||
|
new: teaser.new,
|
||||||
index: iteration.index
|
index: iteration.index
|
||||||
}"/>
|
}"/>
|
||||||
</f:for>
|
</f:for>
|
||||||
|
|||||||
Reference in New Issue
Block a user