diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php index b247b7dce..e883d9aa8 100644 --- a/modules/hotelreservationsystem/classes/HotelHelper.php +++ b/modules/hotelreservationsystem/classes/HotelHelper.php @@ -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); diff --git a/modules/wkabouthotelblock/views/css/WkAboutHotelBlockFront.css b/modules/wkabouthotelblock/views/css/WkAboutHotelBlockFront.css index d99418976..bfa9dbf7d 100644 --- a/modules/wkabouthotelblock/views/css/WkAboutHotelBlockFront.css +++ b/modules/wkabouthotelblock/views/css/WkAboutHotelBlockFront.css @@ -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; } +} diff --git a/modules/wkabouthotelblock/views/js/WkAboutHotelBlockFront.js b/modules/wkabouthotelblock/views/js/WkAboutHotelBlockFront.js index 331cd5051..471873b77 100644 --- a/modules/wkabouthotelblock/views/js/WkAboutHotelBlockFront.js +++ b/modules/wkabouthotelblock/views/js/WkAboutHotelBlockFront.js @@ -23,10 +23,8 @@ $(document).ready(function(){ $('.htlInterior-owlCarousel .owl-carousel').owlCarousel({ loop:true, - nav:true, - navSpeed:1000, - navText:['',''], - 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 - } - } - }); -}); \ No newline at end of file + // 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 = $('
'); + var $track = $thumbs.find('.htl-gal-thumbs__track'); + $.each(group, function(i, item) { + $('') + .attr('aria-label', (i + 1) + ' / ' + group.length) + .append($('').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; + } + } + }); + }); +}); diff --git a/modules/wkabouthotelblock/views/templates/hook/hotelInteriorBlock.tpl b/modules/wkabouthotelblock/views/templates/hook/hotelInteriorBlock.tpl index 80ffe6f25..abfc3308a 100644 --- a/modules/wkabouthotelblock/views/templates/hook/hotelInteriorBlock.tpl +++ b/modules/wkabouthotelblock/views/templates/hook/hotelInteriorBlock.tpl @@ -44,9 +44,8 @@
- {if $smarty.foreach.intImg.iteration%3 == 0} + {if $smarty.foreach.intImg.iteration%8 == 0 || $smarty.foreach.intImg.last}
{/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} -
-
- Default Image -
-
- {/for} -
- {/if} diff --git a/modules/wkabouthotelblock/wkabouthotelblock.php b/modules/wkabouthotelblock/wkabouthotelblock.php index 18dd7ac13..422c46239 100644 --- a/modules/wkabouthotelblock/wkabouthotelblock.php +++ b/modules/wkabouthotelblock/wkabouthotelblock.php @@ -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'); diff --git a/modules/wkhotelfilterblock/views/js/wkhotelfilterblock.js b/modules/wkhotelfilterblock/views/js/wkhotelfilterblock.js index bfa546c65..4c1dd5f6b 100644 --- a/modules/wkhotelfilterblock/views/js/wkhotelfilterblock.js +++ b/modules/wkhotelfilterblock/views/js/wkhotelfilterblock.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 = $('
'); + $conts.each(function () { + $nav.append($('').text($(this).find('.lf_headingmain_wrapper span').first().text()).append('')); + }); + $('#filter_results > .col-sm-12').prepend($nav); + + var $sheet = $('
' + mfSortByTxt + '
'); + $('.sort_result').each(function () { + $sheet.find('ul').append($('
  • ').text($(this).text()).data('source', $(this))); + }); + var $bar = $('
    '); + $('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'); + } }); \ No newline at end of file diff --git a/modules/wkhotelfilterblock/views/templates/hook/htlfilterblock.tpl b/modules/wkhotelfilterblock/views/templates/hook/htlfilterblock.tpl index 0fab3ecf3..807b7c23e 100644 --- a/modules/wkhotelfilterblock/views/templates/hook/htlfilterblock.tpl +++ b/modules/wkhotelfilterblock/views/templates/hook/htlfilterblock.tpl @@ -22,6 +22,12 @@ {block name='room_types_filters_block'}
    + {* mobile only: header of the full screen filters panel *} +
    + + {l s='Filters' mod='wkhotelfilterblock'} + +
    {block name='room_types_price_filter'} {if isset($config) && $config['SHOW_PRICE_FILTER']} @@ -61,7 +67,7 @@
    {foreach $all_amenities as $amenity}
    - +
    {$amenity.name}
    {/foreach} @@ -86,7 +92,7 @@
    {foreach $feature.values as $featureValue}
    - +
    {$featureValue.value|escape:'html':'UTF-8'}
    {/foreach} @@ -96,6 +102,9 @@ {/if} {/block}
    + {block name='room_types_filters_mobile_apply'} + + {/block}
    {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} diff --git a/modules/wkhotelroom/views/css/WkHotelRoomBlockFront.css b/modules/wkhotelroom/views/css/WkHotelRoomBlockFront.css index c8a0d6286..88645f271 100644 --- a/modules/wkhotelroom/views/css/WkHotelRoomBlockFront.css +++ b/modules/wkhotelroom/views/css/WkHotelRoomBlockFront.css @@ -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; diff --git a/modules/wkhotelroom/views/templates/hook/hotelRoomDisplayBlock.tpl b/modules/wkhotelroom/views/templates/hook/hotelRoomDisplayBlock.tpl index a8a286ffb..e7abd0767 100644 --- a/modules/wkhotelroom/views/templates/hook/hotelRoomDisplayBlock.tpl +++ b/modules/wkhotelroom/views/templates/hook/hotelRoomDisplayBlock.tpl @@ -54,18 +54,7 @@
    {block name='hotel_room_block_room_type_description'}

    {$roomDisplay.name|escape:'htmlall':'UTF-8'}

    - {if $roomDisplay.feature} -
    - {foreach from=$roomDisplay.feature item=feat} - - {if $feat.logo_type == 'icon'}{else}{$feat.name|escape:'htmlall':'UTF-8'}{/if} - {$feat.value|escape:'htmlall':'UTF-8'} - - {/foreach} -
    - {/if}
    - {$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} {if $roomDisplay.amenities} {foreach from=$roomDisplay.amenities item=amenity} @@ -78,6 +67,16 @@ {/if}
    + {if $roomDisplay.feature} +
    + {foreach from=$roomDisplay.feature item=feat} + + {if $feat.logo_type == 'icon'}{else}{$feat.name|escape:'htmlall':'UTF-8'}{/if} + {$feat.value|escape:'htmlall':'UTF-8'} + + {/foreach} +
    + {/if} {/block}
    {if $roomDisplay.show_price && !isset($restricted_country_mode) && !$PS_CATALOG_MODE} diff --git a/modules/wkhotelroom/wkhotelroom.php b/modules/wkhotelroom/wkhotelroom.php index 6e5d872fd..8f561160a 100644 --- a/modules/wkhotelroom/wkhotelroom.php +++ b/modules/wkhotelroom/wkhotelroom.php @@ -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']) { diff --git a/themes/hotel-reservation-theme/css/category.css b/themes/hotel-reservation-theme/css/category.css index f06f2b686..37175f9e5 100644 --- a/themes/hotel-reservation-theme/css/category.css +++ b/themes/hotel-reservation-theme/css/category.css @@ -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; + } +}