diff --git a/modules/wkhotelroom/views/css/WkHotelRoomBlockFront.css b/modules/wkhotelroom/views/css/WkHotelRoomBlockFront.css index 35c0a41cb..c8a0d6286 100644 --- a/modules/wkhotelroom/views/css/WkHotelRoomBlockFront.css +++ b/modules/wkhotelroom/views/css/WkHotelRoomBlockFront.css @@ -98,12 +98,206 @@ a.htlRoomTypeBookNow { text-transform: capitalize; } -.btn.htlRoomTypeBookNow:hover{ - border: 1px solid #333333; -} .room_type_old_price { text-decoration: line-through; color:#555555; font-size:14px; -} \ No newline at end of file +} + +/* room type cards slider */ +.htlRoom-owlCarousel .owl-carousel { + padding: 0 0 6px; +} +.htlRoomCard { + background: #fff; + border: 1px solid #E5E5E5; + border-radius: 8px; + overflow: hidden; + box-shadow: 0 1px 4px rgba(0, 0, 0, .06); +} +.htlRoomCardImg { + display: block; + aspect-ratio: 4 / 3; + overflow: hidden; +} +.htlRoomCardImg img { + width: 100%; + height: 100%; + object-fit: cover; +} +.htlRoomCardBody { + padding: 16px; +} +.htlRoomCardBody .htlRoomTypeNameText { + float: none; + margin: 0 0 12px; + font-size: 22px; +} +.htlRoomCardFeatured { + display: flex; + flex-wrap: wrap; + gap: 6px 16px; + padding: 0 0 12px; + color: #555; + font-size: 15px; +} +.htlRoomCardFeatured img.htlRoomFeatureImg { + width: 16px; + height: 16px; + max-width: 16px; + flex: 0 0 16px; + margin-right: 0; + object-fit: contain; +} +.htlRoomCardAmen > span img.htlRoomAmenityImg { + width: 18px; + height: 18px; + max-width: 18px; + object-fit: contain; +} +.htlRoomCardFeatured > span { + display: inline-flex; + align-items: center; + gap: 4px; + white-space: nowrap; +} +.htlRoomCardFeatured i { + margin-right: 0; + color: #777; +} +.htlRoomCardMeta { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; + padding: 12px 0; + border-top: 1px solid #E5E5E5; + border-bottom: 1px solid #E5E5E5; + color: #555; + font-size: 15px; +} +.htlRoomCardGuests i { + margin-right: 4px; + color: #777; +} +.htlRoomCardAmen { + display: flex; + gap: 6px; +} +.htlRoomCardAmen > span { + display: inline-flex; + align-items: center; + justify-content: center; + width: 32px; + height: 32px; + border: 1px solid #D6D6D6; + border-radius: 50%; + font-size: 14px; + color: #666; +} +.htlRoomCardFoot { + display: flex; + align-items: center; + justify-content: space-between; + gap: 10px; + padding-top: 14px; +} +.htlRoomCardFoot .htlRoomTypePriceText { + float: none; + margin: 0; + font-size: 22px; + font-weight: 700; + line-height: 1.2; +} +.htlRoomCardFoot .wk_roomType_price_type { + font-size: 14px; + font-weight: 400; + color: #777; +} +.htlRoomCardFoot .room_type_old_price { + display: block; + width: auto; + font-size: 14px; + font-weight: 400; +} +a.htlRoomTypeBookNow { + padding: 10px 20px; + border: 0; + border-radius: 3px; + background: #379BF0; + color: #fff; + font-weight: 700; + white-space: nowrap; +} +a.htlRoomTypeBookNow:hover { + background: #2d86d3; + color: #fff; +} +.htlRoom-owlCarousel .owl-nav .owl-prev, +.htlRoom-owlCarousel .owl-nav .owl-next { + position: absolute; + top: 38%; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + width: 44px; + height: 44px; + border-radius: 50%; + background: #fff; + box-shadow: 0 2px 8px rgba(0, 0, 0, .2); + font-size: 22px; + line-height: 1; +} +.htlRoom-owlCarousel .owl-nav .owl-prev { + left: -12px; +} +.htlRoom-owlCarousel .owl-nav .owl-next { + right: -12px; +} +.htlRoom-owlCarousel .owl-nav .disabled { + display: none; +} +@media (max-width: 767px) { + .htlRoom-owlCarousel .owl-nav .owl-prev { + left: 4px; + } + .htlRoom-owlCarousel .owl-nav .owl-next { + right: 4px; + } + .htlRoomCardBody .htlRoomTypeNameText { + font-size: 20px; + } +} + +/* equal height cards: price row sits at the bottom, occupancy row keeps the same height with or without amenities */ +.htlRoom-owlCarousel .owl-stage { + display: flex; +} +.htlRoom-owlCarousel .owl-item { + display: flex; +} +.htlRoomCard { + display: flex; + flex-direction: column; + width: 100%; +} +.htlRoomCardBody { + display: flex; + flex: 1; + flex-direction: column; +} +.htlRoomCardFoot { + margin-top: auto; +} +.htlRoomCardGuests { + display: inline-flex; + align-items: center; + min-height: 32px; +} + +.htlRoomCard { + width: calc(100% - 4px); + margin: 2px; +} diff --git a/modules/wkhotelroom/views/js/WkHotelRoomBlockFront.js b/modules/wkhotelroom/views/js/WkHotelRoomBlockFront.js index 216c2be8c..815afb812 100644 --- a/modules/wkhotelroom/views/js/WkHotelRoomBlockFront.js +++ b/modules/wkhotelroom/views/js/WkHotelRoomBlockFront.js @@ -21,6 +21,19 @@ */ $(document).ready(function() { + $('.htlRoom-owlCarousel .owl-carousel').owlCarousel({ + loop: true, + nav: true, + navText: ['', ''], + dots: false, + margin: 24, + items: 1, + rtl: typeof language_is_rtl != 'undefined' && language_is_rtl, + responsive: { + 768: { items: 2 }, + 992: { items: 3 } + } + }); applyChangesToDescription(); $(window).on('resize', function() { resetDescriptionChanges(); diff --git a/modules/wkhotelroom/views/templates/hook/hotelRoomDisplayBlock.tpl b/modules/wkhotelroom/views/templates/hook/hotelRoomDisplayBlock.tpl index 09d0cf9cd..a8a286ffb 100644 --- a/modules/wkhotelroom/views/templates/hook/hotelRoomDisplayBlock.tpl +++ b/modules/wkhotelroom/views/templates/hook/hotelRoomDisplayBlock.tpl @@ -38,59 +38,67 @@ {/if} {block name='hotel_room_block_content'} -
+
- {assign var='htlRoomBlockIteration' value=0} - {foreach from=$hotelRoomDisplay item=roomDisplay name=htlRoom} - {if $smarty.foreach.htlRoom.iteration%2} -
- {/if} -
- {block name='hotel_room_block_room_type_image'} - - {$roomDisplay.name|escape:'htmlall':'UTF-8'} - - {/block} - {block name='displayHotelRoomsBlockImageAfter'} - {hook h='displayHotelRoomsBlockImageAfter' room_type=$roomDisplay} - {/block} -
- {block name='hotel_room_block_room_type_description'} -
-

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

- {if $roomDisplay.show_price && !isset($restricted_country_mode) && !$PS_CATALOG_MODE} -

- {if $roomDisplay.feature_price_diff >= 0} - {convertPrice price = $roomDisplay.price_without_reduction} - {/if} - {if $roomDisplay.feature_price_diff} - {convertPrice price = $roomDisplay.feature_price} - {/if} - - / {l s='Per Night' mod='wkhotelroom'} +

- {/if} - {assign var='htlRoomBlockIteration' value=$smarty.foreach.htlRoom.iteration} - {/foreach} - {if $htlRoomBlockIteration%2} -
- {/if} + {/foreach} +
{/block} diff --git a/modules/wkhotelroom/wkhotelroom.php b/modules/wkhotelroom/wkhotelroom.php index 190f3bcc9..6e5d872fd 100644 --- a/modules/wkhotelroom/wkhotelroom.php +++ b/modules/wkhotelroom/wkhotelroom.php @@ -51,6 +51,8 @@ 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'); foreach ($hotelRoomDisplay as &$htlRoom) { $idProduct = $htlRoom['id_product']; $product = new Product($idProduct, false, $idLang); @@ -109,6 +111,28 @@ class WkHotelRoom extends Module 1, array(array('adults' => 1, 'children' => 0, 'child_ages' => array())) ); + $objRoomType = new HotelRoomType(); + $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(); + 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; + } + } + } + $htlRoom['feature'] = array_values($htlRoom['feature']); + $htlRoom['feature'] = array_slice($htlRoom['feature'], 0, $maxFeatures); + $htlRoom['amenities'] = array_slice( + HotelRoomTypeAmenities::getAmenities($idProduct, $idLang, true), + 0, + $maxAmenities + ); $htlRoom['feature_price'] = $featurePrice; $htlRoom['feature_price_diff'] = (float)($priceWithoutReduction - $featurePrice); } @@ -123,16 +147,27 @@ class WkHotelRoom extends Module 'HOTEL_ROOM_DISPLAY_DESCRIPTION', $this->context->language->id ), + 'amenity_img_dir' => _MODULE_DIR_.'hotelreservationsystem/views/img/hotel_amenities/', 'hotelRoomDisplay' => $hotelRoomDisplay ) ); + $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'); $this->context->controller->addJs($this->_path.'/views/js/WkHotelRoomBlockFront.js'); $this->context->controller->addCSS($this->_path.'/views/css/WkHotelRoomBlockFront.css'); 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 472225e01..f06f2b686 100644 --- a/themes/hotel-reservation-theme/css/category.css +++ b/themes/hotel-reservation-theme/css/category.css @@ -213,11 +213,19 @@ p.capa_txt { color: #555555; } +.room_featured_features { + display: flex; + flex-wrap: wrap; + gap: 8px 18px; +} .room_featured_feature { - display: inline-block; - margin: 0 10px 10px 0; + display: inline-flex; + align-items: center; + gap: 6px; + margin: 0; color: #555; + white-space: nowrap; } .room_featured_feature i{ @@ -469,3 +477,30 @@ p.capa_txt { vertical-align: top; } } + +@media (max-width: 567px) { + .booking_room_fields > div, + .booking_room_fields .booking_guest_occupancy_conatiner, + .booking_room_fields .booking_guest_occupancy_conatiner > .form-group, + .booking_room_fields .booking_guest_occupancy_conatiner .booking_guest_occupancy, + .booking_room_fields .btn_book_now_with_occupancy { + width: 100%; + } +} + +@media (min-width: 568px) and (max-width: 767px) { + .booking_room_fields > div { + width: calc(50% - 5px); + } + .booking_room_fields .booking_guest_occupancy_conatiner > .form-group, + .booking_room_fields .booking_guest_occupancy_conatiner .booking_guest_occupancy, + .booking_room_fields .btn_book_now_with_occupancy { + width: 100%; + } +} + +@media (max-width: 767px) { + .booking_room_fields .btn_book_now_with_occupancy { + text-align: center; + } +} diff --git a/themes/hotel-reservation-theme/css/modules/blockcart/blockcart.css b/themes/hotel-reservation-theme/css/modules/blockcart/blockcart.css index 31ee8504d..1a38645c9 100644 --- a/themes/hotel-reservation-theme/css/modules/blockcart/blockcart.css +++ b/themes/hotel-reservation-theme/css/modules/blockcart/blockcart.css @@ -419,6 +419,9 @@ text-align: center; } #layer_cart .layer_cart_cart .button-container span.exclusive-medium { margin-right: 0; } } + @media (min-width: 576px) and (max-width: 991px) { + #layer_cart .layer_cart_cart .button-container { + text-align: center; } } #layer_cart .cross { position: absolute; right: 7px; diff --git a/themes/hotel-reservation-theme/css/occupancy.css b/themes/hotel-reservation-theme/css/occupancy.css index 7adb772b7..8105bcdf3 100644 --- a/themes/hotel-reservation-theme/css/occupancy.css +++ b/themes/hotel-reservation-theme/css/occupancy.css @@ -133,9 +133,11 @@ width: 100%;} .booking_occupancy_wrapper .occupancy_info_block .occupancy_count { width: 80%;} - /* room list: keep adults and children side by side, same as desktop */ - .booking_guest_occupancy_conatiner .booking_occupancy_wrapper .occupancy_info_block .occupancy_count_block { + /* room list and product page booking form: keep adults and children side by side, same as desktop */ + .booking_guest_occupancy_conatiner .booking_occupancy_wrapper .occupancy_info_block .occupancy_count_block, + .booking-form .booking_occupancy_wrapper .occupancy_info_block .occupancy_count_block { width: 50%;} - .booking_guest_occupancy_conatiner .booking_occupancy_wrapper .occupancy_info_block .occupancy_count { + .booking_guest_occupancy_conatiner .booking_occupancy_wrapper .occupancy_info_block .occupancy_count, + .booking-form .booking_occupancy_wrapper .occupancy_info_block .occupancy_count { width: auto;} } \ No newline at end of file diff --git a/themes/hotel-reservation-theme/css/product.css b/themes/hotel-reservation-theme/css/product.css index 91b79305d..61ecddb2b 100644 --- a/themes/hotel-reservation-theme/css/product.css +++ b/themes/hotel-reservation-theme/css/product.css @@ -1336,12 +1336,12 @@ Quick View Styles @media (min-width: 768px) and (max-width: 1199px) { .num_avail_rooms_alert { float: left!important;} - .booking_room_fields .form-group { + .booking_room_fields .form-group:not(.occupancy_count_block) { width: 100%;}} @media (max-width: 450px) { .num_avail_rooms_alert { float: left!important;} - .booking_room_fields .form-group { + .booking_room_fields .form-group:not(.occupancy_count_block) { width: 100%;}} /* booking form loading */ @@ -1827,3 +1827,40 @@ ul.service-product-nav > li:hover { display: block; } } + +/* mobile and tablet: show the booking form right after the images, before the service products */ +@media (max-width: 991px) { + .primary_block { + display: flex; + flex-direction: column; + } + .primary_block:before, + .primary_block:after { + display: none; + } + .primary_block .pb-left-column, + .primary_block .pb-right-column { + display: contents; + } + .primary_block .room_type_img_containter { + order: 1; + } + .primary_block .booking-form { + order: 2; + margin-bottom: 20px; + } + /* the column wrappers are gone, so give the sections their side gutter back */ + .primary_block .room_type_img_containter, + .primary_block .booking-form, + .primary_block #service_products_cont, + .primary_block .product_info_containter { + margin-left: 15px; + margin-right: 15px; + } + .primary_block #service_products_cont { + order: 3; + } + .primary_block .product_info_containter { + order: 4; + } +}