Fixed: add home page slider
This commit is contained in:
@@ -1181,9 +1181,9 @@ class HotelHelper
|
||||
Configuration::updateValue('PS_MIN_BOOKING_OFFSET', 0);
|
||||
|
||||
Configuration::updateValue('HTL_FEATURE_PRICING_PRIORITY', 'specific_date;special_day;date_range');
|
||||
Configuration::updateValue('WK_MAX_AMENITIES_ROOM_SEARCH', 0);
|
||||
Configuration::updateValue('WK_MAX_FEATURES_ROOM_SEARCH', 0);
|
||||
Configuration::updateValue('WK_MAX_ROOM_TYPE_FEATURE_VALUES', 0);
|
||||
Configuration::updateValue('WK_MAX_AMENITIES_ROOM_SEARCH', 6);
|
||||
Configuration::updateValue('WK_MAX_FEATURES_ROOM_SEARCH', 4);
|
||||
Configuration::updateValue('WK_MAX_ROOM_TYPE_FEATURE_VALUES', 4);
|
||||
Configuration::updateValue('WK_GOOGLE_ACTIVE_MAP', 0);
|
||||
Configuration::updateValue('WK_MAP_HOTEL_ACTIVE_ONLY', 1);
|
||||
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
.htlInterior-owlCarousel .owl-stage-outer {
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
@media (max-width: 767px) {
|
||||
.htlInterior-owlCarousel .owl-carousel {
|
||||
width: 100%;
|
||||
@@ -52,18 +49,6 @@
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
.htlInterior-owlCarousel .owl-prev, .htlInterior-owlCarousel .owl-next{
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 10;
|
||||
}
|
||||
.htlInterior-owlCarousel .owl-prev {
|
||||
left: 15px;
|
||||
}
|
||||
.htlInterior-owlCarousel .owl-next {
|
||||
right: 15px;
|
||||
}
|
||||
.nav-direction-wrapper{
|
||||
display: block;
|
||||
}
|
||||
@@ -89,7 +74,7 @@
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background-image: url("../img/black-opacity-5.png");
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
cursor: pointer;
|
||||
display: none;
|
||||
}
|
||||
@@ -106,39 +91,91 @@
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* Interior gallery below desktop: one wide image over two smaller ones */
|
||||
@media (max-width: 1199px) {
|
||||
#hotelInteriorBlock .interiorImgWrapper {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 4px;
|
||||
}
|
||||
#hotelInteriorBlock .interiorbox {
|
||||
padding-bottom: 75%;
|
||||
}
|
||||
#hotelInteriorBlock .interiorbox:first-child {
|
||||
grid-column: 1 / -1;
|
||||
padding-bottom: 56.25%;
|
||||
}
|
||||
#hotelInteriorBlock .interiorboxInner {
|
||||
border: 0;
|
||||
}
|
||||
.htlInterior-owlCarousel .owl-stage-outer {
|
||||
border: 0;
|
||||
/* gallery: pages of 8 square photos (4 x 2) with dots below */
|
||||
.htlInterior-owlCarousel .owl-stage-outer {
|
||||
border: 0;
|
||||
}
|
||||
.interiorImgWrapper {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 8px;
|
||||
height: auto;
|
||||
}
|
||||
.interiorbox {
|
||||
padding-bottom: 100%;
|
||||
}
|
||||
.interiorboxInner {
|
||||
border: 0;
|
||||
border-radius: 3px;
|
||||
}
|
||||
@media (max-width: 575px) {
|
||||
.interiorImgWrapper {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
.htlInterior-owlCarousel .nav-direction-secondary {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
padding: 0;
|
||||
.htlInterior-owlCarousel .owl-dots {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
.htlInterior-owlCarousel .owl-prev {
|
||||
left: 8px;
|
||||
.htlInterior-owlCarousel .owl-dots .owl-dot span {
|
||||
display: block;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
margin: 0;
|
||||
border-radius: 50%;
|
||||
background: #C4C4C4;
|
||||
}
|
||||
.htlInterior-owlCarousel .owl-next {
|
||||
right: 8px;
|
||||
.htlInterior-owlCarousel .owl-dots .owl-dot.active span {
|
||||
background: #333;
|
||||
}
|
||||
/* touch screens have no hover, so always show the zoom badge */
|
||||
@media (hover: none) {
|
||||
#hotelInteriorBlock .interiorbox::after {
|
||||
content: "\f00e";
|
||||
font-family: "FontAwesome";
|
||||
position: absolute;
|
||||
right: 8px;
|
||||
top: 8px;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: 50%;
|
||||
background: rgba(0, 0, 0, .45);
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
line-height: 28px;
|
||||
text-align: center;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* gallery lightbox: square photo, dark overlay, thumbnail strip with round prev/next at the bottom */
|
||||
html body .htl-gallery-fancybox .fancybox-skin { padding: 0 !important; background: transparent; border-radius: 5px; box-shadow: none; }
|
||||
html body .htl-gallery-fancybox .fancybox-outer, html body .htl-gallery-fancybox .fancybox-inner { border-radius: 5px; overflow: hidden; }
|
||||
html body .htl-gallery-fancybox .fancybox-image { border-radius: 5px; }
|
||||
html body .htl-gallery-fancybox .fancybox-title { display: none !important; }
|
||||
.htl-gal-thumbs { position: fixed; left: 0; right: 0; bottom: 49px; z-index: 8040; display: flex; align-items: center; gap: 16px; padding: 0 28px; }
|
||||
.htl-gal-thumbs__track { flex: 1 1 auto; display: flex; gap: 12px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; padding: 2px 0; }
|
||||
.htl-gal-thumbs__track::-webkit-scrollbar { display: none; }
|
||||
.htl-gal-thumbs__item { flex: 0 0 auto; width: 96px; height: 96px; padding: 0; border: 2px solid transparent; border-radius: 2px; background: #000; overflow: hidden; opacity: .6; cursor: pointer; transition: opacity .2s ease, border-color .2s ease; }
|
||||
.htl-gal-thumbs__item img { display: block; width: 100%; height: 100%; object-fit: cover; }
|
||||
.htl-gal-thumbs__item:hover, .htl-gal-thumbs__item.is-active { opacity: 1; }
|
||||
.htl-gal-thumbs__item.is-active { border-color: #fff; }
|
||||
.htl-gal-thumbs__nav { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 50px; height: 50px; padding: 0; border: 0; border-radius: 50%; background: #fff; color: #333; font-size: 26px; line-height: 1; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); cursor: pointer; transition: transform .2s ease; }
|
||||
.htl-gal-thumbs__nav i { display: block; line-height: 1; }
|
||||
.htl-gal-thumbs__nav:hover { transform: scale(1.08); }
|
||||
@media (max-width: 767px) {
|
||||
.htl-gal-thumbs { bottom: 20px; padding: 0 12px; gap: 8px; }
|
||||
.htl-gal-thumbs__item { width: 60px; height: 60px; }
|
||||
.htl-gal-thumbs__nav { width: 36px; height: 36px; font-size: 20px; }
|
||||
html body .htl-gallery-fancybox .fancybox-close { top: 8px; right: 8px; }
|
||||
}
|
||||
html body .fancybox-overlay.htl-gallery-overlay { opacity: 1 !important; background: rgba(43, 43, 43, 0.95) !important; }
|
||||
/* short landscape screens (phones turned sideways): compact thumbnail strip */
|
||||
@media (max-height: 499px) {
|
||||
.htl-gal-thumbs { bottom: 10px; padding: 0 12px; gap: 8px; }
|
||||
.htl-gal-thumbs__item { width: 56px; height: 56px; }
|
||||
.htl-gal-thumbs__nav { width: 36px; height: 36px; font-size: 20px; }
|
||||
html body .htl-gallery-fancybox .fancybox-close { top: 8px; right: 8px; }
|
||||
}
|
||||
|
||||
@@ -23,10 +23,8 @@
|
||||
$(document).ready(function(){
|
||||
$('.htlInterior-owlCarousel .owl-carousel').owlCarousel({
|
||||
loop:true,
|
||||
nav:true,
|
||||
navSpeed:1000,
|
||||
navText:['<div class="nav-direction-wrapper"><div class="nav-direction-primary"><div class="nav-direction-secondary"><i class="icon-angle-left"></i></div></div></div>','<div class="nav-direction-wrapper"><div class="nav-direction-primary"><div class="nav-direction-secondary"><i class="icon-angle-right"></i></div></div></div>'],
|
||||
dots:false,
|
||||
nav:false,
|
||||
dots:true,
|
||||
items: 1,
|
||||
autoHeight:true,
|
||||
autoplay:true,
|
||||
@@ -34,15 +32,7 @@ $(document).ready(function(){
|
||||
autoplayTimeout:5000,
|
||||
autoplayHoverPause:true,
|
||||
responsiveClass:true,
|
||||
rtl: language_is_rtl,
|
||||
responsive:{
|
||||
1200:{
|
||||
items:3
|
||||
},
|
||||
480:{
|
||||
items:2
|
||||
},
|
||||
}
|
||||
rtl: language_is_rtl
|
||||
});
|
||||
|
||||
$('.interiorbox').on('mouseenter', function(){
|
||||
@@ -52,20 +42,100 @@ $(document).ready(function(){
|
||||
$(this).find('div.interiorHoverBlockWrapper').hide();
|
||||
});
|
||||
|
||||
$("div.interiorbox").fancybox({
|
||||
autoDimensions: true,
|
||||
autoScale: true,
|
||||
autoSize: true,
|
||||
centerOnScroll: true,
|
||||
height: 'auto',
|
||||
scrolling: 'auto',
|
||||
width: 'auto',
|
||||
maxWidth: 700,
|
||||
'hideOnContentClick': false,
|
||||
helpers: {
|
||||
overlay: {
|
||||
locked: false
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
// gallery lightbox: fancybox with a thumbnail strip and round prev/next buttons at the bottom
|
||||
var $thumbs = null;
|
||||
|
||||
function buildThumbs() {
|
||||
var group = $.fancybox.group || [];
|
||||
if (group.length < 2) {
|
||||
return;
|
||||
}
|
||||
$thumbs = $('<div class="htl-gal-thumbs"><button type="button" class="htl-gal-thumbs__nav htl-gal-thumbs__prev" aria-label="Previous"><i class="icon-angle-left" aria-hidden="true"></i></button><div class="htl-gal-thumbs__track"></div><button type="button" class="htl-gal-thumbs__nav htl-gal-thumbs__next" aria-label="Next"><i class="icon-angle-right" aria-hidden="true"></i></button></div>');
|
||||
var $track = $thumbs.find('.htl-gal-thumbs__track');
|
||||
$.each(group, function(i, item) {
|
||||
$('<button type="button" class="htl-gal-thumbs__item" tabindex="-1"></button>')
|
||||
.attr('aria-label', (i + 1) + ' / ' + group.length)
|
||||
.append($('<img alt="">').attr('src', item.href))
|
||||
.on('click', function() { this.blur(); $.fancybox.jumpto(i); })
|
||||
.appendTo($track);
|
||||
});
|
||||
$thumbs.find('.htl-gal-thumbs__prev').on('click', function() { this.blur(); $.fancybox.prev(); });
|
||||
$thumbs.find('.htl-gal-thumbs__next').on('click', function() { this.blur(); $.fancybox.next(); });
|
||||
$thumbs.appendTo('body');
|
||||
}
|
||||
|
||||
function markActiveThumb() {
|
||||
if (!$thumbs) {
|
||||
return;
|
||||
}
|
||||
var $items = $thumbs.find('.htl-gal-thumbs__item').removeClass('is-active');
|
||||
var $active = $items.eq($.fancybox.current.index).addClass('is-active');
|
||||
var track = $thumbs.find('.htl-gal-thumbs__track').get(0);
|
||||
if ($active.length && track) {
|
||||
track.scrollLeft = $active.get(0).offsetLeft - (track.clientWidth - $active.outerWidth()) / 2;
|
||||
}
|
||||
}
|
||||
|
||||
// photos are listed once, the slider also holds cloned copies when it loops
|
||||
$(document).on('click', '.htlInterior-owlCarousel .interiorbox[href]', function(e) {
|
||||
e.preventDefault();
|
||||
var items = [];
|
||||
var index = 0;
|
||||
var clicked = $(e.currentTarget).attr('href');
|
||||
$('.htlInterior-owlCarousel .owl-item:not(.cloned) .interiorbox[href]').each(function(i) {
|
||||
items.push({href: $(this).attr('href'), title: $(this).attr('title') || ''});
|
||||
if ($(this).attr('href') === clicked) {
|
||||
index = i;
|
||||
}
|
||||
});
|
||||
$.fancybox.open(items, {
|
||||
index: index,
|
||||
type: 'image',
|
||||
padding: 0,
|
||||
margin: [48, 48, 190, 48],
|
||||
wrapCSS: 'htl-gallery-fancybox',
|
||||
arrows: false,
|
||||
openEffect: 'fade',
|
||||
closeEffect: 'fade',
|
||||
helpers: {
|
||||
overlay: {
|
||||
locked: false,
|
||||
css: {background: 'rgba(43, 43, 43, 0.9)'}
|
||||
}
|
||||
},
|
||||
beforeLoad: function() {
|
||||
var compact = window.innerWidth < 768 || window.innerHeight < 500;
|
||||
this.margin = window.innerHeight < 500 ? [36, 12, 84, 12] : (compact ? [48, 12, 110, 12] : [48, 48, 190, 48]);
|
||||
},
|
||||
afterLoad: function() {
|
||||
// photos are shown as large as the screen allows (up to 589px), not at their natural size
|
||||
var smallW = window.innerWidth < 768;
|
||||
var shortH = window.innerHeight < 500;
|
||||
var maxH = Math.min(window.innerHeight - (shortH ? 120 : (smallW ? 158 : 238)), 589);
|
||||
var maxW = window.innerWidth - (shortH || smallW ? 24 : 96);
|
||||
var ratio = this.width / this.height;
|
||||
var height = maxH;
|
||||
var width = height * ratio;
|
||||
if (width > maxW) {
|
||||
width = maxW;
|
||||
height = width / ratio;
|
||||
}
|
||||
this.width = Math.round(width);
|
||||
this.height = Math.round(height);
|
||||
},
|
||||
beforeShow: function() {
|
||||
$('.fancybox-overlay').addClass('htl-gallery-overlay');
|
||||
if (!$thumbs) {
|
||||
buildThumbs();
|
||||
}
|
||||
},
|
||||
afterShow: markActiveThumb,
|
||||
afterClose: function() {
|
||||
if ($thumbs) {
|
||||
$thumbs.remove();
|
||||
$thumbs = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -44,9 +44,8 @@
|
||||
<div class="row home_block_content htlInterior-owlCarousel">
|
||||
<div class="col-sm-12 col-xs-12">
|
||||
<div class="owl-carousel owl-theme">
|
||||
{assign var='intImgIteration' value=0}
|
||||
{foreach from=$InteriorImg item=img_name name=intImg}
|
||||
{if $smarty.foreach.intImg.iteration%3 == 1}
|
||||
{if $smarty.foreach.intImg.iteration%8 == 1}
|
||||
<div class="interiorImgWrapper">
|
||||
{/if}
|
||||
<div class="interiorbox" data-fancybox-group="interiorGallery" rel="interiorGallery" href="{$link->getMediaLink("`$module_dir|escape:'htmlall':'UTF-8'`views/img/hotel_interior/`$img_name['name']|escape:'htmlall':'UTF-8'`.jpg")}" title="{$img_name['display_name']|escape:'htmlall':'UTF-8'}">
|
||||
@@ -61,22 +60,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{if $smarty.foreach.intImg.iteration%3 == 0}
|
||||
{if $smarty.foreach.intImg.iteration%8 == 0 || $smarty.foreach.intImg.last}
|
||||
</div>
|
||||
{/if}
|
||||
{assign var='intImgIteration' value=$smarty.foreach.intImg.iteration}
|
||||
{/foreach}
|
||||
{if $intImgIteration%3}
|
||||
{assign var='intImgLeft' value=3-($intImgIteration%3)}
|
||||
{for $foo=1 to $intImgLeft}
|
||||
<div class="interiorbox">
|
||||
<div class="interiorboxInner">
|
||||
<img src="{$link->getMediaLink("`$module_dir|escape:'htmlall':'UTF-8'`views/img/Default-Image.png")}" class="interiorImg" alt="Default Image">
|
||||
</div>
|
||||
</div>
|
||||
{/for}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -47,6 +47,7 @@ class WkAboutHotelBlock extends Module
|
||||
|
||||
public function hookDisplayHome()
|
||||
{
|
||||
$this->context->controller->addJqueryPlugin('fancybox');
|
||||
$this->context->controller->addCSS(_PS_JS_DIR_.'owl-carousel/assets/owl.carousel.min.css');
|
||||
$this->context->controller->addCSS(_PS_JS_DIR_.'owl-carousel/assets/owl.theme.default.min.css');
|
||||
$this->context->controller->addJS(_PS_JS_DIR_.'owl-carousel/owl.carousel.min.js');
|
||||
|
||||
@@ -132,6 +132,7 @@ $(document).ready(function()
|
||||
triggerFilter(1, 0, 0, 0);
|
||||
$('.filter').on('click', function()
|
||||
{
|
||||
$(this).parent().toggleClass('checked', this.checked);
|
||||
triggerFilter();
|
||||
});
|
||||
|
||||
@@ -202,4 +203,47 @@ $(document).ready(function()
|
||||
});
|
||||
return 1;
|
||||
}
|
||||
var $conts = $('#filter_results > .col-sm-12 > .layered_filter_cont');
|
||||
if ($conts.length) {
|
||||
var $nav = $('<div class="mf_nav"></div>');
|
||||
$conts.each(function () {
|
||||
$nav.append($('<button type="button" class="mf_tab"></button>').text($(this).find('.lf_headingmain_wrapper span').first().text()).append('<b></b>'));
|
||||
});
|
||||
$('#filter_results > .col-sm-12').prepend($nav);
|
||||
|
||||
var $sheet = $('<div class="mf_sheet"><div class="mf_sheet_box"><div class="mf_sheet_head"><span>' + mfSortByTxt + '</span><button type="button">×</button></div><ul></ul></div></div>');
|
||||
$('.sort_result').each(function () {
|
||||
$sheet.find('ul').append($('<li></li>').text($(this).text()).data('source', $(this)));
|
||||
});
|
||||
var $bar = $('<div class="mf_bar"><button type="button" class="mf_sort"><i class="icon-sort"></i> ' + mfSortTxt + '</button><button type="button" class="mf_filter"><i class="icon-filter"></i> ' + mfFilterTxt + ' <b></b></button></div>');
|
||||
$('body').append($sheet, $bar);
|
||||
|
||||
function selectTab(i) {
|
||||
$nav.children().removeClass('mf_active').eq(i).addClass('mf_active');
|
||||
$conts.removeClass('mf_active').eq(i).addClass('mf_active');
|
||||
}
|
||||
selectTab(0);
|
||||
|
||||
function updateCounts() {
|
||||
var total = 0;
|
||||
$conts.each(function (i) {
|
||||
var n = $(this).find('input.filter:checked').length;
|
||||
var v = $(this).find('#filter_price_silder').length ? $('#filter_price_silder').slider('values') : 0;
|
||||
n += v && (v[0] != min_price || v[1] != max_price) ? 1 : 0;
|
||||
total += n;
|
||||
$nav.children().eq(i).children('b').text(n || '');
|
||||
});
|
||||
$bar.find('.mf_filter b').text(total || '');
|
||||
}
|
||||
$(document).on('click change slidechange', '#filter_results', function () { setTimeout(updateCounts, 50); });
|
||||
|
||||
$nav.on('click', '.mf_tab', function () { selectTab($(this).index()); });
|
||||
$bar.find('.mf_filter').on('click', function () { $('body').addClass('mf_filter_open'); });
|
||||
$bar.find('.mf_sort').on('click', function () { $sheet.addClass('mf_open'); });
|
||||
$('.mf_back, .mf_apply').on('click', function () { $('body').removeClass('mf_filter_open'); });
|
||||
$('.mf_clear_all').on('click', function () { $('.clear_filter').trigger('click'); });
|
||||
$sheet.on('click', function (e) { if (e.target === this || $(e.target).is('button')) $sheet.removeClass('mf_open'); });
|
||||
$sheet.on('click', 'li', function () { $(this).addClass('mf_selected').siblings().removeClass('mf_selected').end().data('source').trigger('click'); $sheet.removeClass('mf_open'); });
|
||||
$sheet.find('li').first().addClass('mf_selected');
|
||||
}
|
||||
});
|
||||
@@ -22,6 +22,12 @@
|
||||
|
||||
{block name='room_types_filters_block'}
|
||||
<div id="filter_results" class="row block">
|
||||
{* mobile only: header of the full screen filters panel *}
|
||||
<div class="mf_header">
|
||||
<button type="button" class="mf_back">←</button>
|
||||
<span class="mf_title">{l s='Filters' mod='wkhotelfilterblock'}</span>
|
||||
<button type="button" class="mf_clear_all">{l s='Clear all' mod='wkhotelfilterblock'}</button>
|
||||
</div>
|
||||
<div class="col-sm-12">
|
||||
{block name='room_types_price_filter'}
|
||||
{if isset($config) && $config['SHOW_PRICE_FILTER']}
|
||||
@@ -61,7 +67,7 @@
|
||||
<div class="col-sm-12 lf_sub_cont">
|
||||
{foreach $all_amenities as $amenity}
|
||||
<div class="layered_filt">
|
||||
<input type="checkbox" class="filter" data-type="amenities" value="{$amenity.id_amenity}">
|
||||
<div class="checker"><span><input type="checkbox" class="filter not_uniform" data-type="amenities" value="{$amenity.id_amenity}"></span></div>
|
||||
<span class="filters_name">{$amenity.name}</span>
|
||||
</div>
|
||||
{/foreach}
|
||||
@@ -86,7 +92,7 @@
|
||||
<div class="col-sm-12 lf_sub_cont">
|
||||
{foreach $feature.values as $featureValue}
|
||||
<div class="layered_filt">
|
||||
<input type="checkbox" class="filter" data-type="features" data-feature-group="{$feature.id_feature|intval}" value="{$featureValue.id_feature_value|intval}">
|
||||
<div class="checker"><span><input type="checkbox" class="filter not_uniform" data-type="features" data-feature-group="{$feature.id_feature|intval}" value="{$featureValue.id_feature_value|intval}"></span></div>
|
||||
<span class="filters_name">{$featureValue.value|escape:'html':'UTF-8'}</span>
|
||||
</div>
|
||||
{/foreach}
|
||||
@@ -96,6 +102,9 @@
|
||||
{/if}
|
||||
{/block}
|
||||
</div>
|
||||
{block name='room_types_filters_mobile_apply'}
|
||||
<div class="mf_footer"><button type="button" class="btn button button-medium mf_apply"><span>{l s='Apply' mod='wkhotelfilterblock'}</span></button></div>
|
||||
{/block}
|
||||
</div>
|
||||
{block name='room_types_filters_js_vars'}
|
||||
{strip}
|
||||
@@ -108,6 +117,9 @@
|
||||
{addJsDef max_price = $max_price}
|
||||
{addJsDef warning_num = $warning_num}
|
||||
|
||||
{addJsDefL name=mfSortTxt}{l s='Sort' js=1 mod='wkhotelfilterblock'}{/addJsDefL}
|
||||
{addJsDefL name=mfSortByTxt}{l s='Sort by' js=1 mod='wkhotelfilterblock'}{/addJsDefL}
|
||||
{addJsDefL name=mfFilterTxt}{l s='Filter' js=1 mod='wkhotelfilterblock'}{/addJsDefL}
|
||||
{addJsDefL name=viewMoreTxt}{l s='View More' js=1 mod='wkhotelfilterblock'}{/addJsDefL}
|
||||
{addJsDefL name=bookNowTxt}{l s='Book Now' js=1 mod='wkhotelfilterblock'}{/addJsDefL}
|
||||
{/strip}
|
||||
|
||||
@@ -138,7 +138,8 @@ a.htlRoomTypeBookNow {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px 16px;
|
||||
padding: 0 0 12px;
|
||||
padding: 16px 0;
|
||||
border-bottom: 1px solid #E5E5E5;
|
||||
color: #555;
|
||||
font-size: 15px;
|
||||
}
|
||||
@@ -172,7 +173,6 @@ a.htlRoomTypeBookNow {
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
padding: 12px 0;
|
||||
border-top: 1px solid #E5E5E5;
|
||||
border-bottom: 1px solid #E5E5E5;
|
||||
color: #555;
|
||||
font-size: 15px;
|
||||
|
||||
@@ -54,18 +54,7 @@
|
||||
<div class="htlRoomCardBody">
|
||||
{block name='hotel_room_block_room_type_description'}
|
||||
<p class="htlRoomTypeNameText">{$roomDisplay.name|escape:'htmlall':'UTF-8'}</p>
|
||||
{if $roomDisplay.feature}
|
||||
<div class="htlRoomCardFeatured">
|
||||
{foreach from=$roomDisplay.feature item=feat}
|
||||
<span title="{$feat.name|escape:'htmlall':'UTF-8'}">
|
||||
{if $feat.logo_type == 'icon'}<i class="{$feat.logo|escape:'htmlall':'UTF-8'}"></i>{else}<img class="htlRoomFeatureImg" src="{$smarty.const._PS_IMG_}rf/{$feat.logo_image|escape:'htmlall':'UTF-8'}" alt="{$feat.name|escape:'htmlall':'UTF-8'}" onerror="this.style.display='none'">{/if}
|
||||
{$feat.value|escape:'htmlall':'UTF-8'}
|
||||
</span>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
<div class="htlRoomCardMeta">
|
||||
<span class="htlRoomCardGuests"><i class="icon-group"></i> {$roomDisplay.max_adults|intval} {l s='Adults' mod='wkhotelroom'}{if $roomDisplay.max_children}, {$roomDisplay.max_children|intval} {if $roomDisplay.max_children > 1}{l s='Children' mod='wkhotelroom'}{else}{l s='Child' mod='wkhotelroom'}{/if}{/if}</span>
|
||||
{if $roomDisplay.amenities}
|
||||
<span class="htlRoomCardAmen">
|
||||
{foreach from=$roomDisplay.amenities item=amenity}
|
||||
@@ -78,6 +67,16 @@
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
{if $roomDisplay.feature}
|
||||
<div class="htlRoomCardFeatured">
|
||||
{foreach from=$roomDisplay.feature item=feat}
|
||||
<span title="{$feat.name|escape:'htmlall':'UTF-8'}">
|
||||
{if $feat.logo_type == 'icon'}<i class="{$feat.logo|escape:'htmlall':'UTF-8'}"></i>{else}<img class="htlRoomFeatureImg" src="{$smarty.const._PS_IMG_}rf/{$feat.logo_image|escape:'htmlall':'UTF-8'}" alt="{$feat.name|escape:'htmlall':'UTF-8'}" onerror="this.style.display='none'">{/if}
|
||||
{$feat.value|escape:'htmlall':'UTF-8'}
|
||||
</span>
|
||||
{/foreach}
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
<div class="htlRoomCardFoot">
|
||||
{if $roomDisplay.show_price && !isset($restricted_country_mode) && !$PS_CATALOG_MODE}
|
||||
|
||||
@@ -51,8 +51,9 @@ class WkHotelRoom extends Module
|
||||
$dateFrom = date('Y-m-d');
|
||||
$dateTo = date('Y-m-d', strtotime($dateFrom) + 86400);
|
||||
$useTax = HotelBookingDetail::useTax();
|
||||
$maxAmenities = $this->getRoomCardLimit('WK_MAX_AMENITIES_ROOM_SEARCH');
|
||||
$maxFeatures = $this->getRoomCardLimit('WK_MAX_ROOM_TYPE_FEATURE_VALUES');
|
||||
$maxAmenities = (int) Configuration::get('WK_MAX_AMENITIES_ROOM_SEARCH');
|
||||
$maxFeatures = (int) Configuration::get('WK_MAX_FEATURES_ROOM_SEARCH');
|
||||
$maxFeatureValues = (int) Configuration::get('WK_MAX_ROOM_TYPE_FEATURE_VALUES');
|
||||
foreach ($hotelRoomDisplay as &$htlRoom) {
|
||||
$idProduct = $htlRoom['id_product'];
|
||||
$product = new Product($idProduct, false, $idLang);
|
||||
@@ -115,23 +116,22 @@ class WkHotelRoom extends Module
|
||||
$roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($idProduct);
|
||||
$htlRoom['max_adults'] = $roomTypeInfo ? (int) $roomTypeInfo['max_adults'] : 0;
|
||||
$htlRoom['max_children'] = $roomTypeInfo ? (int) $roomTypeInfo['max_children'] : 0;
|
||||
$htlRoom['feature'] = array();
|
||||
$features = array();
|
||||
foreach (Product::getFrontFeaturesStatic($idLang, $idProduct) as $feature) {
|
||||
if ($feature['is_featured'] && $feature['logo']) {
|
||||
if (isset($htlRoom['feature'][$feature['id_feature']])) {
|
||||
$htlRoom['feature'][$feature['id_feature']]['values'][] = $feature['value'];
|
||||
} else {
|
||||
$feature['values'] = array($feature['value']);
|
||||
$htlRoom['feature'][$feature['id_feature']] = $feature;
|
||||
}
|
||||
$features[$feature['id_feature']] = $features[$feature['id_feature']] ?? $feature;
|
||||
$features[$feature['id_feature']]['values'][] = $feature['value'];
|
||||
}
|
||||
}
|
||||
$htlRoom['feature'] = array_values($htlRoom['feature']);
|
||||
$htlRoom['feature'] = array_slice($htlRoom['feature'], 0, $maxFeatures);
|
||||
$htlRoom['feature'] = array_slice($features, 0, $maxFeatures ?: null);
|
||||
foreach ($htlRoom['feature'] as &$roomFeature) {
|
||||
$roomFeature['value'] = implode(', ', array_slice($roomFeature['values'], 0, $maxFeatureValues ?: null));
|
||||
}
|
||||
unset($roomFeature);
|
||||
$htlRoom['amenities'] = array_slice(
|
||||
HotelRoomTypeAmenities::getAmenities($idProduct, $idLang, true),
|
||||
0,
|
||||
$maxAmenities
|
||||
$maxAmenities ?: null
|
||||
);
|
||||
$htlRoom['feature_price'] = $featurePrice;
|
||||
$htlRoom['feature_price_diff'] = (float)($priceWithoutReduction - $featurePrice);
|
||||
@@ -161,13 +161,6 @@ class WkHotelRoom extends Module
|
||||
return $this->display(__FILE__, 'hotelRoomDisplayBlock.tpl');
|
||||
}
|
||||
|
||||
public function getRoomCardLimit($configKey)
|
||||
{
|
||||
$limit = (int) Configuration::get($configKey);
|
||||
|
||||
return ($limit < 1 || $limit > 5) ? 3 : $limit;
|
||||
}
|
||||
|
||||
public function hookActionProductSave($params)
|
||||
{
|
||||
if (isset($params['id_product']) && $params['id_product']) {
|
||||
|
||||
@@ -204,14 +204,24 @@ p.capa_txt {
|
||||
|
||||
.rm_amen
|
||||
{
|
||||
color: #555555;
|
||||
width: 18px;
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
box-sizing: border-box;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-right: 6px;
|
||||
margin-bottom: 5px;
|
||||
font-size: 16px;
|
||||
border: 1px solid #D6D6D6;
|
||||
border-radius: 50%;
|
||||
font-size: 14px;
|
||||
color: #555555;
|
||||
}
|
||||
img.rm_amen
|
||||
{
|
||||
padding: 7px;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
.room_featured_features {
|
||||
display: flex;
|
||||
@@ -468,11 +478,11 @@ p.capa_txt {
|
||||
.rm_amen_more {
|
||||
display: inline-block;
|
||||
margin-bottom: 5px;
|
||||
padding: 0 6px;
|
||||
padding: 0 8px;
|
||||
border: 1px solid #379BF0;
|
||||
border-radius: 10px;
|
||||
border-radius: 16px;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
line-height: 30px;
|
||||
color: #379BF0;
|
||||
vertical-align: top;
|
||||
}
|
||||
@@ -504,3 +514,220 @@ p.capa_txt {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
/* mobile filters: bottom Sort / Filter bar, sort sheet and full screen filters panel */
|
||||
.mf_header, .mf_footer, .mf_nav, .mf_bar, .mf_sheet {
|
||||
display: none;
|
||||
}
|
||||
@media (max-width: 993px) {
|
||||
body.category {
|
||||
padding-bottom: 64px;
|
||||
}
|
||||
.catSortBlock {
|
||||
display: none;
|
||||
}
|
||||
.mf_bar {
|
||||
display: flex;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 90;
|
||||
background: #fff;
|
||||
border-top: 1px solid #E5E5E5;
|
||||
box-shadow: 0 -2px 8px rgba(0, 0, 0, .08);
|
||||
}
|
||||
.mf_bar button {
|
||||
flex: 1;
|
||||
padding: 16px 8px;
|
||||
border: 0;
|
||||
background: none;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
color: #333;
|
||||
}
|
||||
.mf_bar button i {
|
||||
margin-right: 4px;
|
||||
color: #379BF0;
|
||||
}
|
||||
.mf_bar button b {
|
||||
display: inline-block;
|
||||
min-width: 20px;
|
||||
padding: 0 5px;
|
||||
border-radius: 10px;
|
||||
background: #379BF0;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: #fff;
|
||||
}
|
||||
.mf_bar button b:empty {
|
||||
display: none;
|
||||
}
|
||||
.mf_bar button + button {
|
||||
border-left: 1px solid #E5E5E5;
|
||||
}
|
||||
.mf_sheet {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 9000;
|
||||
background: rgba(0, 0, 0, .45);
|
||||
align-items: flex-end;
|
||||
}
|
||||
.mf_sheet.mf_open {
|
||||
display: flex;
|
||||
}
|
||||
.mf_sheet_box {
|
||||
width: 100%;
|
||||
max-height: 80vh;
|
||||
overflow-y: auto;
|
||||
background: #fff;
|
||||
border-radius: 16px 16px 0 0;
|
||||
}
|
||||
.mf_sheet_head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 16px;
|
||||
border-bottom: 1px solid #E5E5E5;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
letter-spacing: .5px;
|
||||
text-transform: uppercase;
|
||||
color: #777;
|
||||
}
|
||||
.mf_sheet_head button {
|
||||
border: 0;
|
||||
background: none;
|
||||
font-size: 28px;
|
||||
line-height: 1;
|
||||
color: #333;
|
||||
}
|
||||
.mf_sheet ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.mf_sheet li:after {
|
||||
content: "";
|
||||
float: right;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
border: 2px solid #777;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.mf_sheet li.mf_selected:after {
|
||||
border-color: #379BF0;
|
||||
box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 12px #379BF0;
|
||||
}
|
||||
.mf_sheet li {
|
||||
padding: 16px;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
}
|
||||
#filter_results {
|
||||
display: none;
|
||||
margin: 0;
|
||||
}
|
||||
body.mf_filter_open {
|
||||
overflow: hidden;
|
||||
}
|
||||
body.mf_filter_open #filter_results {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 9000;
|
||||
background: #fff;
|
||||
}
|
||||
#filter_results .mf_header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
padding: 14px 16px;
|
||||
border-bottom: 1px solid #E5E5E5;
|
||||
}
|
||||
#filter_results .mf_header .mf_back {
|
||||
padding: 0 4px;
|
||||
border: 0;
|
||||
background: none;
|
||||
font-size: 24px;
|
||||
line-height: 1;
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
#filter_results .mf_title {
|
||||
flex: 1;
|
||||
font-size: 18px;
|
||||
}
|
||||
#filter_results .mf_clear_all {
|
||||
border: 0;
|
||||
background: none;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
text-decoration: underline;
|
||||
}
|
||||
#filter_results > .col-sm-12 {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
padding: 0;
|
||||
min-height: 0;
|
||||
}
|
||||
#filter_results .mf_nav {
|
||||
display: block;
|
||||
flex: 0 0 38%;
|
||||
overflow-y: auto;
|
||||
background: #F5F5F5;
|
||||
}
|
||||
#filter_results .mf_tab {
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 16px;
|
||||
border: 0;
|
||||
border-left: 3px solid transparent;
|
||||
background: none;
|
||||
text-align: left;
|
||||
font-size: 15px;
|
||||
color: #333;
|
||||
}
|
||||
#filter_results .mf_tab b {
|
||||
float: right;
|
||||
font-size: 13px;
|
||||
color: #379BF0;
|
||||
}
|
||||
#filter_results .mf_tab.mf_active {
|
||||
background: #fff;
|
||||
border-left-color: #379BF0;
|
||||
}
|
||||
#filter_results .layered_filter_cont {
|
||||
display: none;
|
||||
flex: 1;
|
||||
margin: 0;
|
||||
border: 0;
|
||||
overflow-y: auto;
|
||||
padding: 8px 4px;
|
||||
}
|
||||
#filter_results .layered_filter_cont.mf_active {
|
||||
display: block;
|
||||
}
|
||||
#filter_results .layered_filter_cont .clear_filter {
|
||||
display: none;
|
||||
}
|
||||
#filter_results .lf_sub_cont {
|
||||
max-height: none;
|
||||
overflow: visible;
|
||||
padding: 0 16px 10px 12px;
|
||||
}
|
||||
#filter_results .mf_footer {
|
||||
display: block;
|
||||
padding: 12px 16px;
|
||||
border-top: 1px solid #E5E5E5;
|
||||
background: #fff;
|
||||
}
|
||||
#filter_results .mf_footer .mf_apply {
|
||||
width: 100%;
|
||||
height: 48px;
|
||||
font-size: 17px;
|
||||
background: #379BF0;
|
||||
color: #fff;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user