diff --git a/classes/Feature.php b/classes/Feature.php index f1deab32a..00d31c01c 100644 --- a/classes/Feature.php +++ b/classes/Feature.php @@ -128,6 +128,11 @@ class FeatureCore extends ObjectModel return $return; } + public static function getLogoImageName($idFeature, $logo) + { + return preg_match('/^[A-Za-z0-9_]+\.jpg$/', (string) $logo) ? $logo : (int) $idFeature.'.jpg'; + } + public function delete() { /* Also delete related attributes */ diff --git a/classes/Product.php b/classes/Product.php index fba163da5..a6c3d67b2 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -4868,6 +4868,10 @@ class ProductCore extends ObjectModel WHERE pf.id_product = '.(int)$id_product.' ORDER BY f.position ASC' ); + foreach (self::$_frontFeaturesCache[$id_product.'-'.$id_lang] as &$frontFeature) { + $frontFeature['logo_image'] = Feature::getLogoImageName($frontFeature['id_feature'], $frontFeature['logo']); + } + unset($frontFeature); } return self::$_frontFeaturesCache[$id_product.'-'.$id_lang]; } diff --git a/controllers/admin/AdminFeaturesController.php b/controllers/admin/AdminFeaturesController.php index 1b45cf26b..8ec89b7ca 100644 --- a/controllers/admin/AdminFeaturesController.php +++ b/controllers/admin/AdminFeaturesController.php @@ -52,11 +52,6 @@ class AdminFeaturesControllerCore extends AdminController 'align' => 'center', 'class' => 'fixed-width-xs' ), - 'name' => array( - 'title' => $this->l('Name'), - 'width' => 'auto', - 'filter_key' => 'b!name' - ), 'logo' => array( 'title' => $this->l('Icon'), 'align' => 'text-center', @@ -64,7 +59,13 @@ class AdminFeaturesControllerCore extends AdminController 'orderby' => false, 'search' => false, 'class' => 'fixed-width-xs' - ),/*by webkul to show feature image*/ + ), + 'name' => array( + 'title' => $this->l('Name'), + 'width' => 'auto', + 'filter_key' => 'b!name' + ), + /*by webkul to show feature image*/ /*'value' => array( 'title' => $this->l('Values'), 'orderby' => false, @@ -74,10 +75,9 @@ class AdminFeaturesControllerCore extends AdminController ),*/ 'is_featured' => array( 'title' => $this->l('Is Featured'), - 'type' => 'select', - 'list' => array(1 => $this->l('Yes'), 0 => $this->l('No')), + 'type' => 'bool', + 'active' => 'is_featured', 'align' => 'center', - 'callback' => 'displayIsFeatured', 'filter_key' => 'a!is_featured', 'filter_type' => 'int', 'class' => 'fixed-width-sm', @@ -190,7 +190,7 @@ class AdminFeaturesControllerCore extends AdminController } // by webkul to get media link. // $ps_img_url = _PS_IMG_DIR_.'rf/'.$obj->id.'.jpg'; - $img_url = $this->context->link->getMediaLink(_PS_IMG_.'rf/'.$obj->id.'.jpg'); + $img_url = $this->context->link->getMediaLink(_PS_IMG_.'rf/'.Feature::getLogoImageName($obj->id, $obj->logo)); if ($img_exist = Tools::file_get_contents($img_url)) { $image = ""; } @@ -299,30 +299,31 @@ class AdminFeaturesControllerCore extends AdminController return $logo ? '' : ''; } - $idFeature = (int) $row['id_feature']; + $imageName = Feature::getLogoImageName($row['id_feature'], $logo); return ImageManager::thumbnail( - _PS_IMG_DIR_.'rf/'.$idFeature.'.jpg', - 'feature_mini_'.$idFeature.'_'.(int) $this->context->shop->id.'.jpg', + _PS_IMG_DIR_.'rf/'.$imageName, + 'feature_mini_'.basename($imageName, '.jpg').'_'.(int) $this->context->shop->id.'.jpg', 45, 'jpg' ); } /** - * List callback: render the Is Featured value as a status-like label. - * - * @param int $isFeatured Is featured flag - * @param array $row List row - * @return string + * Toggle the Is Featured value from the list (like the status toggle). */ - public function displayIsFeatured($isFeatured, $row) + public function processToggleIsFeatured() { - if ((int) $isFeatured) { - return ''.$this->l('Yes').''; + if (!$this->loadObject()) { + return false; } - return ''.$this->l('No').''; + $this->object->is_featured = !$this->object->is_featured; + if ($this->object->save()) { + Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&conf=4'); + } else { + $this->errors[] = $this->l('An error occurred while updating "is featured".'); + } } public function initPageHeaderToolbar() @@ -616,6 +617,15 @@ class AdminFeaturesControllerCore extends AdminController } parent::initProcess(); + + // Toggle Is Featured from the list + if (Tools::getIsset('is_featured'.$this->table)) { + if ($this->tabAccess['edit'] === 1) { + $this->action = 'toggleIsFeatured'; + } else { + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); + } + } } public function postProcess() @@ -712,6 +722,9 @@ class AdminFeaturesControllerCore extends AdminController } $logoType = Tools::getValue('logo_type'); $featureImage = isset($_FILES['logo_image']) ? $_FILES['logo_image'] : null; + $objCurrentFeature = new Feature($idFeature); + $oldLogo = $objCurrentFeature->logo; + $oldLogoType = $objCurrentFeature->logo_type; if (!in_array($logoType, array('image', 'icon'))) { $this->errors[] = $this->l('Logo type is invalid.'); @@ -737,13 +750,16 @@ class AdminFeaturesControllerCore extends AdminController } } else { $hasUpload = $featureImage && !empty($featureImage['tmp_name']); - $hasExisting = $idFeature && file_exists(_PS_IMG_DIR_.'rf/'.$idFeature.'.jpg'); + $hasExisting = $idFeature && file_exists(_PS_IMG_DIR_.'rf/'.Feature::getLogoImageName($idFeature, $oldLogo)); if ($hasUpload) { if ($error = ImageManager::validateUpload($featureImage, Tools::getMaxUploadSize())) { $this->errors[] = $error; } } elseif (!$hasExisting) { $this->errors[] = $this->l('Please select a logo for this feature.'); + } elseif ($oldLogoType === 'image' && $oldLogo) { + // no new image: keep the current image name + $_POST['logo'] = $oldLogo; } } @@ -754,29 +770,15 @@ class AdminFeaturesControllerCore extends AdminController $objFeature = parent::processSave(); if (!count($this->errors)) { - // icon type does not need the uploaded image - if ($logoType === 'icon' && file_exists(_PS_IMG_DIR_.'rf/'.$objFeature->id.'.jpg')) { - unlink(_PS_IMG_DIR_.'rf/'.$objFeature->id.'.jpg'); - } - - // image type stores the image file name - if ($logoType === 'image' && $objFeature->logo !== $objFeature->id.'.jpg') { - $objFeature->logo = $objFeature->id.'.jpg'; - $objFeature->update(); - } - - // save feature image + // save feature image: .jpg is kept for the webservice, a random named copy is used for display + // so that browsers do not show a cached old image if ($logoType === 'image' && isset($featureImage['tmp_name']) && $featureImage['tmp_name']) { - // if already feature image then delete it once before uploading new image - if ($idFeature) { - $currentImg = _PS_TMP_IMG_DIR_.'feature_mini_'.$objFeature->id.'_'.$this->context->shop->id.'.jpg'; - if (file_exists($currentImg)) { - unlink($currentImg); - } - } - // upload feature image $imgPath = _PS_IMG_DIR_.'rf/'.$objFeature->id.'.jpg'; - if (!ImageManager::resize($featureImage['tmp_name'], $imgPath)) { + $imageName = $objFeature->id.'_'.substr(md5(uniqid(mt_rand(), true)), 0, 12).'.jpg'; + if (ImageManager::resize($featureImage['tmp_name'], $imgPath) && copy($imgPath, _PS_IMG_DIR_.'rf/'.$imageName)) { + $objFeature->logo = $imageName; + $objFeature->update(); + } else { $this->errors[] = $this->l('Some error occurred while uploding room feature logo. Please try again.'); } } diff --git a/modules/hotelreservationsystem/classes/HotelAmenities.php b/modules/hotelreservationsystem/classes/HotelAmenities.php index 8dcabfd64..f517d891d 100644 --- a/modules/hotelreservationsystem/classes/HotelAmenities.php +++ b/modules/hotelreservationsystem/classes/HotelAmenities.php @@ -59,7 +59,7 @@ class HotelAmenities extends ObjectModel public function delete() { if ($id = $this->id) { - $imgFile = dirname(__FILE__).'/../views/img/hotel_amenities/'.(int)$id.'.jpg'; + $imgFile = dirname(__FILE__).'/../views/img/hotel_amenities/'.($this->logo_type == 'image' && $this->logo ? basename($this->logo) : (int)$id.'.jpg'); if (file_exists($imgFile)) { unlink($imgFile); } diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index 10b6e88e5..d6599d8f0 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -1844,7 +1844,7 @@ class HotelBookingDetail extends ObjectModel } if (!empty($amenities) && $amenities) { $roomAmenityIds = array_column(HotelRoomTypeAmenities::getAmenities($value['id_product']), 'id'); - if (!array_intersect($amenities, $roomAmenityIds)) { + if (array_diff($amenities, $roomAmenityIds)) { unset($bookingData['rm_data'][$key]); continue; } @@ -1877,11 +1877,16 @@ class HotelBookingDetail extends ObjectModel // featured room features (is_featured) for display below the short description $featuredFeatures = array(); foreach (Product::getFrontFeaturesStatic($context->language->id, $value['id_product']) as $roomFeature) { - if ($roomFeature['is_featured'] && !isset($featuredFeatures[$roomFeature['id_feature']])) { - $featuredFeatures[$roomFeature['id_feature']] = $roomFeature; + // one entry per featured feature value, each shown with the feature icon + if ($roomFeature['is_featured']) { + $featuredFeatures[] = $roomFeature; } } - $bookingData['rm_data'][$key]['featured_features'] = array_values($featuredFeatures); + $featuredFeatures = array_values($featuredFeatures); + if ($maxFeatures = (int) Configuration::get('WK_MAX_FEATURES_ROOM_SEARCH')) { + $featuredFeatures = array_slice($featuredFeatures, 0, $maxFeatures); + } + $bookingData['rm_data'][$key]['featured_features'] = $featuredFeatures; $bookingData['rm_data'][$key]['price'] = $prod_price; $bookingData['rm_data'][$key]['feature_price'] = $productFeaturePrice; $bookingData['rm_data'][$key]['price_without_reduction'] = $productPriceWithoutReduction; diff --git a/modules/hotelreservationsystem/classes/HotelCartBookingData.php b/modules/hotelreservationsystem/classes/HotelCartBookingData.php index 78822d985..f94ccb3f5 100644 --- a/modules/hotelreservationsystem/classes/HotelCartBookingData.php +++ b/modules/hotelreservationsystem/classes/HotelCartBookingData.php @@ -1596,8 +1596,13 @@ class HotelCartBookingData extends ObjectModel $hotelInfo['htl_features'] = $hotelAmenities; } } - // append roomtype features - $hotelInfo['room_features'] = $objProduct->getFrontFeatures($idLang); + // append featured roomtype features + $hotelInfo['room_features'] = array_filter( + $objProduct->getFrontFeatures($idLang), + function ($feature) { + return $feature['is_featured']; + } + ); $cartHotelData[$prodKey]['hotel_info'] = $hotelInfo; } diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php index b73d37a63..99c5b87dd 100644 --- a/modules/hotelreservationsystem/classes/HotelHelper.php +++ b/modules/hotelreservationsystem/classes/HotelHelper.php @@ -1190,6 +1190,7 @@ class HotelHelper 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_GOOGLE_ACTIVE_MAP', 0); Configuration::updateValue('WK_MAP_HOTEL_ACTIVE_ONLY', 1); @@ -1257,6 +1258,9 @@ class HotelHelper { $idLang = (int) Configuration::get('PS_LANG_DEFAULT'); $position = 0; + $featureIcons = $this->getDefaultRoomFeatureIcons(); + // features marked as featured by default + $featuredFeatures = array('Bed Type', 'Room Size', 'Balcony Type', 'Wi-Fi Speed', 'AC Type', 'TV Type'); foreach ($this->getDefaultRoomFeatures() as $featureName => $featureValues) { $idFeature = (int) Feature::addFeatureImport($featureName, $position); @@ -1264,6 +1268,14 @@ class HotelHelper return false; } + if (isset($featureIcons[$featureName])) { + $objFeature = new Feature($idFeature); + $objFeature->logo_type = 'icon'; + $objFeature->logo = $featureIcons[$featureName]; + $objFeature->is_featured = in_array($featureName, $featuredFeatures); + $objFeature->update(); + } + foreach ($featureValues as $featureValue) { $idFeatureValue = (int) FeatureValue::addFeatureValueImport($idFeature, $featureValue, null, $idLang, false); if (!$idFeatureValue) { @@ -1277,6 +1289,30 @@ class HotelHelper return true; } + /** + * Return the icon class (admin/front icon- classes) of each default room feature. + * + * @return array + */ + protected function getDefaultRoomFeatureIcons() + { + return array( + 'Bed Type' => 'icon-bed', + 'Extra Bed Available' => 'icon-plus-square', + 'Crib/Cot Available' => 'icon-child', + 'Room Size' => 'icon-arrows-alt', + 'View' => 'icon-eye', + 'Balcony Type' => 'icon-home', + 'Bathroom Type' => 'icon-tint', + 'AC Type' => 'icon-cloud', + 'Heating Type' => 'icon-fire', + 'TV Type' => 'icon-desktop', + 'Wi-Fi Speed' => 'icon-wifi', + 'Smoke Detection' => 'icon-fire-extinguisher', + 'Smoking Policy' => 'icon-ban', + ); + } + /** * Return the default room feature/value seed set. * @@ -2284,6 +2320,73 @@ class HotelHelper // save advance payment information $this->saveAdvancedPaymentInfo($product_id); + + // assign features to the room type as per the room type + $roomTypeFeatures = $this->getDefaultRoomTypeFeatures(); + if (isset($roomTypeFeatures[$roomTypeDataDefult['name']])) { + $this->saveDummyRoomTypeFeatures($product, $roomTypeFeatures[$roomTypeDataDefult['name']]); + } + } + } + + /** + * Return the features (and their values) of each demo room type, keyed by the room type name. + * + * @return array + */ + protected function getDefaultRoomTypeFeatures() + { + return array( + 'General Rooms' => array( + 'Bed Type' => array('Double', 'Bunk Bed'), + 'Room Size' => array('300 sq ft'), + 'Balcony Type' => array('None'), + 'AC Type' => array('Fan Only'), + 'TV Type' => array('LED TV'), + 'Wi-Fi Speed' => array('Basic'), + ), + 'Delux Rooms' => array( + 'Bed Type' => array('Queen'), + 'Room Size' => array('400 sq ft'), + 'Balcony Type' => array('Private Balcony'), + 'AC Type' => array('Split AC'), + 'TV Type' => array('Smart TV'), + 'Wi-Fi Speed' => array('High Speed'), + ), + 'Executive Rooms' => array( + 'Bed Type' => array('King'), + 'Room Size' => array('600 sq ft'), + 'Balcony Type' => array('Juliet Balcony', 'Patio'), + 'AC Type' => array('Central AC'), + 'TV Type' => array('Smart TV'), + 'Wi-Fi Speed' => array('High Speed'), + ), + 'Luxury Rooms' => array( + 'Bed Type' => array('Super King'), + 'Room Size' => array('800 sq ft'), + 'Balcony Type' => array('Rooftop Access', 'Veranda'), + 'AC Type' => array('Central AC'), + 'TV Type' => array('OLED TV'), + 'Wi-Fi Speed' => array('Premium/Fiber'), + ), + ); + } + + /** + * Assign the given features to a demo room type. + * + * @param Product $objProduct + * @param array $features Feature name => array of feature values + */ + public function saveDummyRoomTypeFeatures($objProduct, $features) + { + $idLang = (int) Configuration::get('PS_LANG_DEFAULT'); + foreach ($features as $featureName => $featureValues) { + $idFeature = (int) Feature::addFeatureImport($featureName); + foreach ($featureValues as $featureValue) { + $idFeatureValue = (int) FeatureValue::addFeatureValueImport($idFeature, $featureValue, null, $idLang, false); + $objProduct->addFeaturesToDB($idFeature, $idFeatureValue); + } } } diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelAmenitiesController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelAmenitiesController.php index 6001b3546..14b3c2c3e 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelAmenitiesController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelAmenitiesController.php @@ -127,12 +127,12 @@ class AdminHotelAmenitiesController extends ModuleAdminController } } - $imgPath = $this->module->getLocalPath().self::IMG_DIR.$idAmenity.'.jpg'; + $logoFile = (isset($amenity['logo_type']) && $amenity['logo_type'] == 'image') ? $amenity['logo'] : ''; $this->context->smarty->assign(array( 'amenity' => $amenity, 'id_category' => $idCategory, - 'existing_img' => ($idAmenity && file_exists($imgPath)) - ? $this->module->getPathUri().self::IMG_DIR.$idAmenity.'.jpg' + 'existing_img' => ($logoFile && file_exists($this->module->getLocalPath().self::IMG_DIR.$logoFile)) + ? $this->module->getPathUri().self::IMG_DIR.$logoFile : false, )); } else { @@ -236,7 +236,9 @@ class AdminHotelAmenitiesController extends ModuleAdminController } } else { $hasUpload = isset($_FILES['logo_image']) && !empty($_FILES['logo_image']['tmp_name']); - $hasExisting = $idAmenity && file_exists($this->module->getLocalPath().self::IMG_DIR.$idAmenity.'.jpg'); + $objCurrent = new HotelAmenities($idAmenity); + $hasExisting = $idAmenity && $objCurrent->logo_type == 'image' && $objCurrent->logo + && file_exists($this->module->getLocalPath().self::IMG_DIR.$objCurrent->logo); if (!$hasUpload && !$hasExisting) { $this->errors[] = $this->l('Please upload an image for this amenity.'); } @@ -248,6 +250,7 @@ class AdminHotelAmenitiesController extends ModuleAdminController } $objHotelAmenities = $idAmenity ? new HotelAmenities($idAmenity) : new HotelAmenities(); + $oldImage = ($objHotelAmenities->logo_type == 'image') ? $objHotelAmenities->logo : ''; foreach ($languages as $lang) { $val = trim(Tools::getValue('amenity_name_'.$lang['id_lang'])); $objHotelAmenities->name[$lang['id_lang']] = $val ?: $nameDefault; @@ -263,8 +266,8 @@ class AdminHotelAmenitiesController extends ModuleAdminController return; } - if ($logoType === 'icon') { - $imgFile = $this->module->getLocalPath().self::IMG_DIR.$objHotelAmenities->id.'.jpg'; + if ($logoType === 'icon' && $oldImage) { + $imgFile = $this->module->getLocalPath().self::IMG_DIR.$oldImage; if (file_exists($imgFile)) { unlink($imgFile); } @@ -279,8 +282,13 @@ class AdminHotelAmenitiesController extends ModuleAdminController if (!is_dir($imgDir)) { mkdir($imgDir, 0755, true); } - if (ImageManager::resize($imgFile['tmp_name'], $imgDir.$objHotelAmenities->id.'.jpg')) { - $objHotelAmenities->logo = $objHotelAmenities->id.'.jpg'; + // random file name so that browsers do not show a cached old image + $imageName = $objHotelAmenities->id.'_'.substr(md5(uniqid(mt_rand(), true)), 0, 12).'.jpg'; + if (ImageManager::resize($imgFile['tmp_name'], $imgDir.$imageName)) { + if ($oldImage && file_exists($imgDir.$oldImage)) { + unlink($imgDir.$oldImage); + } + $objHotelAmenities->logo = $imageName; $objHotelAmenities->save(); } else { $this->errors[] = $this->l('Error uploading amenity image.'); diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php index 6215121d7..f75bfd554 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php @@ -198,6 +198,15 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController 'class' => 'fixed-width-xl', 'default' => '0', ), + 'WK_MAX_FEATURES_ROOM_SEARCH' => array( + 'title' => $this->l('Maximum features in room search'), + 'hint' => $this->l('Maximum number of featured features to display for each room type on the front office room search page.'), + 'desc' => $this->l('Set to 0 to display all featured features.'), + 'type' => 'text', + 'cast' => 'intval', + 'class' => 'fixed-width-xl', + 'default' => '0', + ), ), 'submit' => array('title' => $this->l('Save')), ), @@ -582,6 +591,9 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController if (!Validate::isUnsignedInt(Tools::getValue('WK_MAX_AMENITIES_ROOM_SEARCH'))) { $this->errors[] = $this->l('Maximum amenities in room search is invalid. Enter 0 or a positive number.'); } + if (!Validate::isUnsignedInt(Tools::getValue('WK_MAX_FEATURES_ROOM_SEARCH'))) { + $this->errors[] = $this->l('Maximum features in room search is invalid. Enter 0 or a positive number.'); + } if (Tools::getValue('WK_GOOGLE_ACTIVE_MAP')) { if (!Tools::getValue('PS_API_KEY')) { $this->errors[] = $this->l('Please enter Google API key.'); diff --git a/modules/hotelreservationsystem/hotelreservationsystem.php b/modules/hotelreservationsystem/hotelreservationsystem.php index c935220f4..e5b7b5369 100644 --- a/modules/hotelreservationsystem/hotelreservationsystem.php +++ b/modules/hotelreservationsystem/hotelreservationsystem.php @@ -614,6 +614,7 @@ class HotelReservationSystem extends Module 'WK_CUSTOMER_SUPPORT_EMAIL', 'WK_DISPLAY_CONTACT_PAGE_HOTEL_LIST', 'WK_MAX_AMENITIES_ROOM_SEARCH', + 'WK_MAX_FEATURES_ROOM_SEARCH', 'QLO_HEADER_MEDIA_TYPE', 'QLO_HEADER_CONTENT_ALIGN', 'QLO_HEADER_VIDEO_SOURCE_TYPE', diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_amenities/helpers/view/view.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_amenities/helpers/view/view.tpl index 1a1585bef..0cf8fe1a2 100644 --- a/modules/hotelreservationsystem/views/templates/admin/hotel_amenities/helpers/view/view.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/hotel_amenities/helpers/view/view.tpl @@ -70,7 +70,7 @@ {if $amenity.logo_type == 'icon' && $amenity.logo} {elseif $amenity.logo_type == 'image' && $amenity.logo} - {$amenity.name|escape:'htmlall':'UTF-8'} {else} diff --git a/themes/hotel-reservation-theme/_partials/room_type_list.tpl b/themes/hotel-reservation-theme/_partials/room_type_list.tpl index 3f997a131..6dd5d8152 100644 --- a/themes/hotel-reservation-theme/_partials/room_type_list.tpl +++ b/themes/hotel-reservation-theme/_partials/room_type_list.tpl @@ -62,9 +62,9 @@ {if $featured_feature.logo_type == 'icon' && $featured_feature.logo} {else} - + {/if} - {$featured_feature.name|escape:'htmlall':'UTF-8'} + {$featured_feature.value|escape:'htmlall':'UTF-8'}{if !$featured_feature@last}  |{/if} {/foreach} @@ -82,7 +82,7 @@ {elseif $feat_v.logo_type == 'image' && $feat_v.logo} {/if} {/foreach} diff --git a/themes/hotel-reservation-theme/css/category.css b/themes/hotel-reservation-theme/css/category.css index b34d43a77..fa002286a 100644 --- a/themes/hotel-reservation-theme/css/category.css +++ b/themes/hotel-reservation-theme/css/category.css @@ -83,9 +83,10 @@ color: #555555; font-size: 14px; font-weight: 400; - margin-bottom: 15px; } - +.room_featured_features, .room_features_cont{ + margin-top: 10px; +} .rm_desc p { display: inline; @@ -156,12 +157,14 @@ p.capa_txt { display: inline-block; margin-right: 10px; margin-bottom: 5px; + font-size: 18px; + color: #737877d1; } .room_featured_feature { display: inline-block; - margin: 0 15px 5px 0; + margin: 0 10px 5px 0; } .room_featured_feature img diff --git a/themes/hotel-reservation-theme/css/product.css b/themes/hotel-reservation-theme/css/product.css index 4f0f7f4c5..f68132cb3 100644 --- a/themes/hotel-reservation-theme/css/product.css +++ b/themes/hotel-reservation-theme/css/product.css @@ -1294,8 +1294,6 @@ Quick View Styles .room_info_content.row .col-sm-4 .amenity-name { white-space: nowrap; overflow: hidden;} -.room_feature_group { - margin-bottom: 15px;} .room_feature_group .room_info_heading { display: flex; align-items: center; @@ -1482,6 +1480,9 @@ Quick View Styles flex-wrap: wrap; justify-content: space-between; } +.extra-service-panel .services-list .services-list-row { + align-items: center; +} .extra-service-panel .services-list .services-list-row .service-price-action { display: flex; align-items: center; diff --git a/themes/hotel-reservation-theme/product.tpl b/themes/hotel-reservation-theme/product.tpl index 47feeb317..cd9a33c9b 100644 --- a/themes/hotel-reservation-theme/product.tpl +++ b/themes/hotel-reservation-theme/product.tpl @@ -275,7 +275,7 @@ {if $amenity.logo_type == 'icon' && $amenity.logo} {elseif $amenity.logo_type == 'image' && $amenity.logo} - {$amenity.name|escape:'html':'UTF-8'} + {$amenity.name|escape:'html':'UTF-8'} {/if} {$amenity.name|escape:'html':'UTF-8'} @@ -288,42 +288,42 @@ {/block} {block name='product_info_tab_room_features'} {if isset($room_type_features) && $room_type_features} -
- {assign var="current_feature_name" value=""} - {assign var="current_feature_values" value=""} - {assign var="current_feature_id" value=0} - {assign var="current_feature_logo_type" value=""} - {assign var="current_feature_logo" value=""} - {foreach from=$room_type_features item=feature} - {if $feature.name != $current_feature_name} - {if $current_feature_name != ""} -
-
- {if $current_feature_logo_type == 'icon' && $current_feature_logo}{else}{$current_feature_name|escape:'html':'UTF-8'}{/if} - {$current_feature_name|escape:'html':'UTF-8'} -
-
{$current_feature_values|escape:'html':'UTF-8'}
-
- {/if} - {assign var="current_feature_name" value=$feature.name} - {assign var="current_feature_id" value=$feature.id_feature} - {assign var="current_feature_logo_type" value=$feature.logo_type} - {assign var="current_feature_logo" value=$feature.logo} - {assign var="current_feature_values" value=$feature.value} - {else} - {assign var="current_feature_values" value="`$current_feature_values`, `$feature.value`"} - {/if} - {if $feature@last} -
+ {assign var="current_feature_name" value=""} + {assign var="current_feature_values" value=""} + {assign var="current_feature_id" value=0} + {assign var="current_feature_logo_type" value=""} + {assign var="current_feature_logo" value=""} + {assign var="current_feature_logo_image" value=""} + {foreach from=$room_type_features item=feature} + {if $feature.name != $current_feature_name} + {if $current_feature_name != ""} +
- {if $current_feature_logo_type == 'icon' && $current_feature_logo}{else}{$current_feature_name|escape:'html':'UTF-8'}{/if} + {if $current_feature_logo_type == 'icon' && $current_feature_logo}{else}{$current_feature_name|escape:'html':'UTF-8'}{/if} {$current_feature_name|escape:'html':'UTF-8'}
{$current_feature_values|escape:'html':'UTF-8'}
{/if} - {/foreach} -
+ {assign var="current_feature_name" value=$feature.name} + {assign var="current_feature_id" value=$feature.id_feature} + {assign var="current_feature_logo_type" value=$feature.logo_type} + {assign var="current_feature_logo" value=$feature.logo} + {assign var="current_feature_logo_image" value=$feature.logo_image} + {assign var="current_feature_values" value=$feature.value} + {else} + {assign var="current_feature_values" value="`$current_feature_values`, `$feature.value`"} + {/if} + {if $feature@last} +
+
+ {if $current_feature_logo_type == 'icon' && $current_feature_logo}{else}{$current_feature_name|escape:'html':'UTF-8'}{/if} + {$current_feature_name|escape:'html':'UTF-8'} +
+
{$current_feature_values|escape:'html':'UTF-8'}
+
+ {/if} + {/foreach} {/if} {/block} {* Block for booking products *} @@ -340,7 +340,7 @@ {if $amenity.logo_type == 'icon' && $amenity.logo} {elseif $amenity.logo_type == 'image' && $amenity.logo} - {$amenity.name|escape:'html':'UTF-8'} @@ -364,7 +364,7 @@ {if $amenity.logo_type == 'icon' && $amenity.logo} {elseif $amenity.logo_type == 'image' && $amenity.logo} - {$amenity.name|escape:'html':'UTF-8'} diff --git a/themes/hotel-reservation-theme/shopping-cart-detail.tpl b/themes/hotel-reservation-theme/shopping-cart-detail.tpl index 2923944f0..8afbd52cf 100644 --- a/themes/hotel-reservation-theme/shopping-cart-detail.tpl +++ b/themes/hotel-reservation-theme/shopping-cart-detail.tpl @@ -79,7 +79,7 @@ {/block}
{block name='shopping_cart_room_type_features'} - {if isset($data_v['hotel_info']['room_features'])} + {if !empty($data_v['hotel_info']['room_features'])}
{foreach $data_v['hotel_info']['room_features'] as $feature}