Merge pull request #1941 from amitsharma322/gli-3283
Fixed: Improved amenities management, filtering, and room type display across the frontend
@@ -25,8 +25,34 @@
|
||||
{extends file="helpers/form/form.tpl"}
|
||||
|
||||
{block name="input_row"}
|
||||
<style>
|
||||
#logo_image-images-thumbnails img {
|
||||
max-width: 80px;
|
||||
max-height: 80px;
|
||||
padding: 5px;
|
||||
}
|
||||
</style>
|
||||
{$smarty.block.parent}
|
||||
{if $input.name == 'name'}
|
||||
{hook h="displayFeatureForm" id_feature=$form_id}
|
||||
{/if}
|
||||
{if $input.name == 'logo_icon'}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
// the uploader renders its own nested .form-group, so pick the field row that holds the label
|
||||
function getFieldRow(selector) {
|
||||
return $(selector).parents('.form-group').filter(function() {
|
||||
return $(this).children('label.control-label').length > 0;
|
||||
}).first();
|
||||
}
|
||||
function toggleFeatureLogoType() {
|
||||
var isIcon = $('#logo_type').val() === 'icon';
|
||||
getFieldRow('#logo_image').toggle(!isIcon);
|
||||
getFieldRow('#logo_icon').toggle(isIcon);
|
||||
}
|
||||
$('#logo_type').on('change', toggleFeatureLogoType);
|
||||
toggleFeatureLogoType();
|
||||
});
|
||||
</script>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
@@ -29,6 +29,9 @@ class FeatureCore extends ObjectModel
|
||||
/** @var string Name */
|
||||
public $name;
|
||||
public $position;
|
||||
public $logo_type;
|
||||
public $logo;
|
||||
public $is_featured;
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
@@ -39,6 +42,9 @@ class FeatureCore extends ObjectModel
|
||||
'multilang' => true,
|
||||
'fields' => array(
|
||||
'position' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
|
||||
'logo_type' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 10),
|
||||
'logo' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 255),
|
||||
'is_featured' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
|
||||
/* Lang fields */
|
||||
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 128),
|
||||
@@ -117,11 +123,16 @@ class FeatureCore extends ObjectModel
|
||||
$this->position = Feature::getHigherPosition() + 1;
|
||||
}
|
||||
|
||||
$return = parent::add($autodate, true);
|
||||
$return = parent::add($autodate, $nullValues);
|
||||
Hook::exec('actionFeatureSave', array('id_feature' => $this->id));
|
||||
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 */
|
||||
|
||||
@@ -4859,7 +4859,7 @@ class ProductCore extends ObjectModel
|
||||
}
|
||||
if (!array_key_exists($id_product.'-'.$id_lang, self::$_frontFeaturesCache)) {
|
||||
self::$_frontFeaturesCache[$id_product.'-'.$id_lang] = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
|
||||
SELECT name, value, pf.id_feature
|
||||
SELECT name, value, pf.id_feature, f.logo_type, f.logo, f.is_featured
|
||||
FROM '._DB_PREFIX_.'feature_product pf
|
||||
LEFT JOIN '._DB_PREFIX_.'feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = '.(int)$id_lang.')
|
||||
LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = '.(int)$id_lang.')
|
||||
@@ -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];
|
||||
}
|
||||
@@ -7045,6 +7049,12 @@ class ProductCore extends ObjectModel
|
||||
$feature['value'] = (int) $feature['id_feature'];
|
||||
$feature['input_name'] = 'feature_value_parents';
|
||||
$feature['children'] = array();
|
||||
if (!empty($feature['is_featured'])) {
|
||||
$feature['badge'] = array(
|
||||
'class' => 'badge-success',
|
||||
'title' => Translate::getAdminTranslation('Featured', 'AdminProducts'),
|
||||
);
|
||||
}
|
||||
$selectedValues = isset($selectedFeatureValues[(int) $feature['id_feature']])
|
||||
? $selectedFeatureValues[(int) $feature['id_feature']]
|
||||
: array();
|
||||
|
||||
@@ -397,6 +397,8 @@ class ValidateCore
|
||||
*/
|
||||
public static function isCleanHtml($html, $allow_iframe = false)
|
||||
{
|
||||
$html = (string) $html;
|
||||
|
||||
$eventAttributeRegex = '/<\s*\w+[^>]*\s(on\w+)=["\'][^"\']*["\']/ims';
|
||||
|
||||
$events = 'onabort|onactivate|onactive|onaddsourcebuffer|onaddstream|onaddtrack|onafterprint|onafterscriptexecute|onafterupdate|onalerting|onanimationcancel|onanimationend|onanimationiteration|onanimationstart'
|
||||
|
||||
@@ -52,19 +52,20 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
'align' => 'center',
|
||||
'class' => 'fixed-width-xs'
|
||||
),
|
||||
'logo' => array(
|
||||
'title' => $this->l('Icon'),
|
||||
'align' => 'text-center',
|
||||
'callback' => 'displayLogo',
|
||||
'orderby' => false,
|
||||
'search' => false,
|
||||
'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',
|
||||
'image' => 'rf',
|
||||
'orderby' => false,
|
||||
'search' => false,
|
||||
'class' => 'fixed-width-xs'
|
||||
),/*by webkul to show feature image*/
|
||||
/*by webkul to show feature image*/
|
||||
/*'value' => array(
|
||||
'title' => $this->l('Values'),
|
||||
'orderby' => false,
|
||||
@@ -72,6 +73,16 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
'align' => 'center',
|
||||
'class' => 'fixed-width-xs'
|
||||
),*/
|
||||
'is_featured' => array(
|
||||
'title' => $this->l('Is Featured'),
|
||||
'type' => 'bool',
|
||||
'active' => 'is_featured',
|
||||
'align' => 'center',
|
||||
'filter_key' => 'a!is_featured',
|
||||
'filter_type' => 'int',
|
||||
'class' => 'fixed-width-sm',
|
||||
'orderby' => false
|
||||
),
|
||||
'position' => array(
|
||||
'title' => $this->l('Position'),
|
||||
'filter_key' => 'a!position',
|
||||
@@ -179,9 +190,9 @@ 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 = "<img class='img-thumbnail img-responsive' style='max-width:100px' src='".$img_url."'>";
|
||||
$image = "<img class='img-thumbnail img-responsive' src='".$img_url."'>";
|
||||
}
|
||||
|
||||
$this->toolbar_title = $this->l('Add a new room feature');
|
||||
@@ -200,14 +211,50 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
'hint' => $this->l('Enter a name for the room feature. Invalid characters:').' <>;=#{}',
|
||||
'required' => true
|
||||
),
|
||||
array(
|
||||
'type' => 'switch',
|
||||
'label' => $this->l('Is Featured'),
|
||||
'name' => 'is_featured',
|
||||
'is_bool' => true,
|
||||
'values' => array(
|
||||
array('id' => 'is_featured_on', 'value' => 1, 'label' => $this->l('Yes')),
|
||||
array('id' => 'is_featured_off', 'value' => 0, 'label' => $this->l('No')),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'select',
|
||||
'label' => $this->l('Logo Type'),
|
||||
'name' => 'logo_type',
|
||||
'required' => true,
|
||||
'options' => array(
|
||||
'query' => array(
|
||||
array('id' => 'image', 'name' => $this->l('Image (Upload)')),
|
||||
array('id' => 'icon', 'name' => $this->l('Icon (Font Awesome)')),
|
||||
),
|
||||
'id' => 'id',
|
||||
'name' => 'name',
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'file',
|
||||
'label' => $this->l('Room Feature Logo'),
|
||||
'name' => 'logo',
|
||||
'name' => 'logo_image',
|
||||
'image' => $img_exist ? $image : false,
|
||||
'display_image' => true,
|
||||
'hint' => $this->l('Upload a room feature logo.'),
|
||||
'required' => true
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Icon Class'),
|
||||
'name' => 'logo_icon',
|
||||
'required' => true,
|
||||
'col' => 4,
|
||||
'hint' => $this->l('Font Awesome icon class. Replace fa- with icon- (e.g. fa-wifi becomes icon-wifi).'),
|
||||
'desc' => sprintf(
|
||||
$this->l('Refer to %s for available icons.'),
|
||||
'<a href="https://fontawesome.com/v4/cheatsheet" target="_blank">https://fontawesome.com/v4/cheatsheet</a>'
|
||||
),
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -234,9 +281,51 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
)
|
||||
);
|
||||
|
||||
$this->fields_value['logo_icon'] = ($obj->logo_type == 'icon') ? $obj->logo : '';
|
||||
|
||||
return parent::renderForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* List callback: render the feature logo as an icon or as the uploaded image thumbnail.
|
||||
*
|
||||
* @param string $logo Icon class (when logo type is icon)
|
||||
* @param array $row List row
|
||||
* @return string
|
||||
*/
|
||||
public function displayLogo($logo, $row)
|
||||
{
|
||||
if (isset($row['logo_type']) && $row['logo_type'] == 'icon') {
|
||||
return $logo ? '<i class="'.Tools::safeOutput($logo).'"></i>' : '';
|
||||
}
|
||||
|
||||
$imageName = Feature::getLogoImageName($row['id_feature'], $logo);
|
||||
|
||||
return ImageManager::thumbnail(
|
||||
_PS_IMG_DIR_.'rf/'.$imageName,
|
||||
'feature_mini_'.basename($imageName, '.jpg').'_'.(int) $this->context->shop->id.'.jpg',
|
||||
45,
|
||||
'jpg'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle the Is Featured value from the list (like the status toggle).
|
||||
*/
|
||||
public function processToggleIsFeatured()
|
||||
{
|
||||
if (!$this->loadObject()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$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()
|
||||
{
|
||||
if (empty($this->display)) {
|
||||
@@ -528,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()
|
||||
@@ -622,31 +720,65 @@ class AdminFeaturesControllerCore extends AdminController
|
||||
$_POST[$key] = str_replace('\n', '', str_replace('\r', '', $value));
|
||||
}
|
||||
}
|
||||
$featureImage = $_FILES['logo'];
|
||||
if (!$idFeature || (isset($featureImage['tmp_name']) && $featureImage['tmp_name'])) {
|
||||
if ($featureImage && $featureImage['tmp_name'] && $featureImage['name']) {
|
||||
$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.');
|
||||
$logoType = 'image';
|
||||
}
|
||||
if (!in_array(Tools::getValue('is_featured', 0), array('0', '1', 0, 1), true)) {
|
||||
$this->errors[] = $this->l('Is Featured value is invalid.');
|
||||
}
|
||||
$_POST['logo_type'] = $logoType;
|
||||
// Empty logo would be saved as NULL (Feature::add() uses null values), so image type keeps a placeholder until the image is saved.
|
||||
$_POST['logo'] = 'image';
|
||||
|
||||
if ($logoType === 'icon') {
|
||||
$logoIcon = trim(Tools::getValue('logo_icon'));
|
||||
if (!$logoIcon) {
|
||||
$this->errors[] = $this->l('Icon class is required.');
|
||||
} elseif (Tools::strlen($logoIcon) > 255) {
|
||||
$this->errors[] = $this->l('Icon class is too long.');
|
||||
} elseif (!preg_match('/^icon-[a-z0-9]+(-[a-z0-9]+)*$/', $logoIcon)) {
|
||||
$this->errors[] = $this->l('Icon class is invalid. It must start with "icon-" and contain only lowercase letters, numbers and hyphens (e.g. icon-wifi).');
|
||||
} else {
|
||||
$_POST['logo'] = $logoIcon;
|
||||
}
|
||||
} else {
|
||||
$hasUpload = $featureImage && !empty($featureImage['tmp_name']);
|
||||
$hasExisting = $idFeature && file_exists(_PS_IMG_DIR_.'rf/'.Feature::getLogoImageName($idFeature, $oldLogo));
|
||||
if ($hasUpload) {
|
||||
if ($error = ImageManager::validateUpload($featureImage, Tools::getMaxUploadSize())) {
|
||||
$this->errors[] = $error;
|
||||
}
|
||||
} else {
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
|
||||
if (count($this->errors)) {
|
||||
$this->display = $idFeature ? 'edit' : 'add';
|
||||
return false;
|
||||
}
|
||||
|
||||
$objFeature = parent::processSave();
|
||||
if (!count($this->errors)) {
|
||||
// save feature image
|
||||
if (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
|
||||
// save feature image: <id>.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']) {
|
||||
$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.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,6 +183,7 @@ class CategoryControllerCore extends FrontController
|
||||
$sort_value = Tools::getValue('sort_value');
|
||||
$filter_data = Tools::getValue('filter_data');
|
||||
$amenities = [];
|
||||
$featureValues = [];
|
||||
$price = [];
|
||||
if (!empty($filter_data)) {
|
||||
foreach ($filter_data as $key => $value) {
|
||||
@@ -190,6 +191,11 @@ class CategoryControllerCore extends FrontController
|
||||
foreach ($value as $a_k => $a_v) {
|
||||
$amenities[] = $a_v;
|
||||
}
|
||||
} elseif ($key == 'features') {
|
||||
// one group of feature value ids per feature
|
||||
foreach ($value as $idFeatureValues) {
|
||||
$featureValues[] = array_map('intval', (array) $idFeatureValues);
|
||||
}
|
||||
} elseif ($key == 'price') {
|
||||
$price['from'] = $value[0];
|
||||
$price['to'] = $value[1];
|
||||
@@ -207,6 +213,7 @@ class CategoryControllerCore extends FrontController
|
||||
'id_cart' => $this->context->cart->id,
|
||||
'id_guest' => $this->context->cookie->id_guest,
|
||||
'amenities' => $amenities,
|
||||
'feature_values' => $featureValues,
|
||||
'price' => $price,
|
||||
);
|
||||
|
||||
|
||||
@@ -411,6 +411,23 @@ class ProductControllerCore extends FrontController
|
||||
$roomAmenities = HotelRoomTypeAmenities::getAmenities($this->product->id, $this->context->language->id);
|
||||
$hotelAmenities = HotelBranchAmenities::getAmenities($hotel_id, $this->context->language->id);
|
||||
|
||||
// featured amenities: room type level first, then hotel level, without duplicates
|
||||
$featuredAmenities = array();
|
||||
$featuredAmenitiesList = array_merge(
|
||||
HotelRoomTypeAmenities::getAmenities($this->product->id, $this->context->language->id, true),
|
||||
HotelBranchAmenities::getAmenities($hotel_id, $this->context->language->id, true)
|
||||
);
|
||||
|
||||
$featuredAmenities = array_values(array_column(
|
||||
array_reverse($featuredAmenitiesList),
|
||||
null,
|
||||
'id'
|
||||
));
|
||||
|
||||
usort($featuredAmenities, function ($a, $b) {
|
||||
return strcmp($a['name'], $b['name']);
|
||||
});
|
||||
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'id_hotel' => $hotel_id,
|
||||
@@ -440,6 +457,7 @@ class ProductControllerCore extends FrontController
|
||||
'room_type_features' => $roomFeatures,
|
||||
'room_dynamic_amenities' => $roomAmenities,
|
||||
'hotel_dynamic_amenities' => $hotelAmenities,
|
||||
'featured_amenities' => $featuredAmenities,
|
||||
'amenity_img_dir' => _MODULE_DIR_.'hotelreservationsystem/views/img/hotel_amenities/',
|
||||
'hotel_image_link' => $hotelImageLink,
|
||||
'hotel_has_images' => (bool) HotelImage::getCover($hotel_id),
|
||||
|
||||
BIN
img/rf/1.jpg
|
Before Width: | Height: | Size: 1.3 KiB |
BIN
img/rf/10.jpg
|
Before Width: | Height: | Size: 1.1 KiB |
BIN
img/rf/11.jpg
|
Before Width: | Height: | Size: 1.2 KiB |
BIN
img/rf/4.jpg
|
Before Width: | Height: | Size: 1.1 KiB |
BIN
img/rf/5.jpg
|
Before Width: | Height: | Size: 1.3 KiB |
BIN
img/rf/9.jpg
|
Before Width: | Height: | Size: 1.3 KiB |
@@ -824,6 +824,9 @@ CREATE TABLE `PREFIX_employee_shop` (
|
||||
CREATE TABLE `PREFIX_feature` (
|
||||
`id_feature` int(10) unsigned NOT NULL auto_increment,
|
||||
`position` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`logo_type` varchar(10) NOT NULL DEFAULT 'image',
|
||||
`logo` varchar(255) NOT NULL DEFAULT '',
|
||||
`is_featured` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id_feature`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -308,6 +308,9 @@ class HotelBookingDetail extends ObjectModel
|
||||
if (!isset($params['amenities'])) {
|
||||
$params['amenities'] = 0;
|
||||
}
|
||||
if (!isset($params['feature_values'])) {
|
||||
$params['feature_values'] = 0;
|
||||
}
|
||||
if (!isset($params['price'])) {
|
||||
$params['price'] = 0;
|
||||
}
|
||||
@@ -1829,13 +1832,19 @@ class HotelBookingDetail extends ObjectModel
|
||||
|
||||
if (!$only_search_data) {
|
||||
if (!empty($bookingData)) {
|
||||
$maxAmenities = (int) Configuration::get('WK_MAX_AMENITIES_ROOM_SEARCH');
|
||||
$maxFeatures = (int) Configuration::get('WK_MAX_FEATURES_ROOM_SEARCH');
|
||||
$maxFeatureValues = (int) Configuration::get('WK_MAX_FEATURE_VALUES_ROOM_SEARCH');
|
||||
foreach ($bookingData['rm_data'] as $key => $value) {
|
||||
// featured amenities for display in room type list
|
||||
$product_feature = HotelRoomTypeAmenities::getAmenities(
|
||||
$featured_amenities = HotelRoomTypeAmenities::getAmenities(
|
||||
$value['id_product'],
|
||||
$context->language->id,
|
||||
true
|
||||
);
|
||||
if ($maxAmenities) {
|
||||
$featured_amenities = array_slice($featured_amenities, 0, $maxAmenities);
|
||||
}
|
||||
if (!empty($amenities) && $amenities) {
|
||||
$roomAmenityIds = array_column(HotelRoomTypeAmenities::getAmenities($value['id_product']), 'id');
|
||||
if (array_diff($amenities, $roomAmenityIds)) {
|
||||
@@ -1843,6 +1852,16 @@ class HotelBookingDetail extends ObjectModel
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (!empty($feature_values)) {
|
||||
$roomFeatureValueIds = array_map('intval', array_column(Product::getFeaturesStatic($value['id_product']), 'id_feature_value'));
|
||||
// AND between features, OR between the values of one feature
|
||||
foreach ($feature_values as $featureValueGroup) {
|
||||
if (!array_intersect($featureValueGroup, $roomFeatureValueIds)) {
|
||||
unset($bookingData['rm_data'][$key]);
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
$productFeaturePrice = HotelRoomTypeFeaturePricing::getRoomTypeFeaturePricesPerDay($value['id_product'], $date_from, $date_to, self::useTax(), 0, 0, 0, 0, 1, 1, $bookingParams['occupancy']);
|
||||
if (!empty($price) && ((float) $price['from'] > $productFeaturePrice || (float) $price['to'] < $productFeaturePrice)) {
|
||||
unset($bookingData['rm_data'][$key]);
|
||||
@@ -1859,7 +1878,32 @@ class HotelBookingDetail extends ObjectModel
|
||||
$cover_img = $context->link->getImageLink($value['link_rewrite'], $context->language->iso_code.'-default', 'home_default');
|
||||
}
|
||||
$bookingData['rm_data'][$key]['image'] = $cover_img;
|
||||
$bookingData['rm_data'][$key]['feature'] = $product_feature;
|
||||
$bookingData['rm_data'][$key]['featured_amenities'] = $featured_amenities;
|
||||
|
||||
// featured room features (is_featured) for display below the short description
|
||||
$featuredFeatures = array();
|
||||
foreach (Product::getFrontFeaturesStatic($context->language->id, $value['id_product']) as $roomFeature) {
|
||||
// one entry per featured feature, its values are shown together after the feature icon
|
||||
if ($roomFeature['is_featured']) {
|
||||
if (!isset($featuredFeatures[$roomFeature['id_feature']])) {
|
||||
$featuredFeatures[$roomFeature['id_feature']] = $roomFeature;
|
||||
$featuredFeatures[$roomFeature['id_feature']]['values'] = array();
|
||||
}
|
||||
$featuredFeatures[$roomFeature['id_feature']]['values'][] = $roomFeature['value'];
|
||||
}
|
||||
}
|
||||
$featuredFeatures = array_values($featuredFeatures);
|
||||
if ($maxFeatures) {
|
||||
$featuredFeatures = array_slice($featuredFeatures, 0, $maxFeatures);
|
||||
}
|
||||
foreach ($featuredFeatures as &$featuredFeature) {
|
||||
if ($maxFeatureValues) {
|
||||
$featuredFeature['values'] = array_slice($featuredFeature['values'], 0, $maxFeatureValues);
|
||||
}
|
||||
$featuredFeature['value'] = implode(', ', $featuredFeature['values']);
|
||||
}
|
||||
unset($featuredFeature);
|
||||
$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;
|
||||
|
||||
@@ -1515,6 +1515,8 @@ class HotelCartBookingData extends ObjectModel
|
||||
$objCartBookingData = new HotelCartBookingData();
|
||||
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
|
||||
$objServiceProductCartDetail = new ServiceProductCartDetail();
|
||||
$maxFeatures = (int) Configuration::get('WK_MAX_FEATURES_ROOM_SEARCH');
|
||||
$maxFeatureValues = (int) Configuration::get('WK_MAX_ROOM_TYPE_FEATURE_VALUES');
|
||||
|
||||
foreach ($cartRoomTypes as $prodKey => $product) {
|
||||
if (Validate::isLoadedObject(
|
||||
@@ -1596,8 +1598,29 @@ 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();
|
||||
foreach ($objProduct->getFrontFeatures($idLang) as $roomFeature) {
|
||||
if ($roomFeature['is_featured']) {
|
||||
// the values of a feature are shown together
|
||||
if (!isset($hotelInfo['room_features'][$roomFeature['id_feature']])) {
|
||||
$hotelInfo['room_features'][$roomFeature['id_feature']] = $roomFeature;
|
||||
$hotelInfo['room_features'][$roomFeature['id_feature']]['values'] = array();
|
||||
}
|
||||
$hotelInfo['room_features'][$roomFeature['id_feature']]['values'][] = $roomFeature['value'];
|
||||
}
|
||||
}
|
||||
$hotelInfo['room_features'] = array_values($hotelInfo['room_features']);
|
||||
if ($maxFeatures) {
|
||||
$hotelInfo['room_features'] = array_slice($hotelInfo['room_features'], 0, $maxFeatures);
|
||||
}
|
||||
foreach ($hotelInfo['room_features'] as &$roomFeature) {
|
||||
if ($maxFeatureValues) {
|
||||
$roomFeature['values'] = array_slice($roomFeature['values'], 0, $maxFeatureValues);
|
||||
}
|
||||
$roomFeature['value'] = implode(', ', $roomFeature['values']);
|
||||
}
|
||||
unset($roomFeature);
|
||||
|
||||
$cartHotelData[$prodKey]['hotel_info'] = $hotelInfo;
|
||||
}
|
||||
|
||||
@@ -977,6 +977,66 @@ class HotelHelper
|
||||
);
|
||||
// lang fields
|
||||
$languages = Language::getLanguages(false);
|
||||
// FontAwesome icons (admin/front icon- classes) for default amenities, keyed by amenity position.
|
||||
// Amenities without a suitable icon keep their default image.
|
||||
$amenityIcons = array(
|
||||
1 => 'icon-building',
|
||||
2 => 'icon-video-camera',
|
||||
3 => 'icon-users',
|
||||
4 => 'icon-microphone',
|
||||
5 => 'icon-pencil',
|
||||
6 => 'icon-fax',
|
||||
7 => 'icon-wifi',
|
||||
8 => 'icon-wifi',
|
||||
9 => 'icon-bus',
|
||||
10 => 'icon-newspaper-o',
|
||||
11 => 'icon-shopping-cart',
|
||||
12 => 'icon-glass',
|
||||
14 => 'icon-diamond',
|
||||
16 => 'icon-music',
|
||||
17 => 'icon-microphone',
|
||||
18 => 'icon-film',
|
||||
21 => 'icon-plug',
|
||||
22 => 'icon-credit-card',
|
||||
23 => 'icon-money',
|
||||
25 => 'icon-book',
|
||||
26 => 'icon-medkit',
|
||||
27 => 'icon-gift',
|
||||
29 => 'icon-paw',
|
||||
30 => 'icon-child',
|
||||
32 => 'icon-fire',
|
||||
33 => 'icon-bell',
|
||||
34 => 'icon-cutlery',
|
||||
35 => 'icon-car',
|
||||
37 => 'icon-shopping-cart',
|
||||
38 => 'icon-hospital-o',
|
||||
39 => 'icon-envelope',
|
||||
41 => 'icon-language',
|
||||
42 => 'icon-car',
|
||||
45 => 'icon-wifi',
|
||||
46 => 'icon-fax',
|
||||
47 => 'icon-tree',
|
||||
48 => 'icon-car',
|
||||
49 => 'icon-fire',
|
||||
50 => 'icon-child',
|
||||
53 => 'icon-car',
|
||||
55 => 'icon-leaf',
|
||||
56 => 'icon-car',
|
||||
57 => 'icon-car',
|
||||
58 => 'icon-key',
|
||||
59 => 'icon-heartbeat',
|
||||
60 => 'icon-bicycle',
|
||||
64 => 'icon-ship',
|
||||
69 => 'icon-life-ring',
|
||||
70 => 'icon-gamepad',
|
||||
72 => 'icon-anchor',
|
||||
73 => 'icon-leaf',
|
||||
87 => 'icon-glass',
|
||||
88 => 'icon-cutlery',
|
||||
90 => 'icon-coffee',
|
||||
91 => 'icon-cutlery',
|
||||
98 => 'icon-leaf',
|
||||
);
|
||||
$imgDir = dirname(__FILE__).'/../views/img/hotel_amenities/';
|
||||
$i = 1;
|
||||
$defaultImageIndex = 0;
|
||||
@@ -1009,6 +1069,13 @@ class HotelHelper
|
||||
$obj_amenity->id_parent = $idParent;
|
||||
$obj_amenity->save();
|
||||
|
||||
if (isset($amenityIcons[$defaultImageIndex])) {
|
||||
$obj_amenity->logo_type = 'icon';
|
||||
$obj_amenity->logo = $amenityIcons[$defaultImageIndex];
|
||||
$obj_amenity->save();
|
||||
continue;
|
||||
}
|
||||
|
||||
$srcImg = $imgDir.'_default/'.$defaultImageIndex.'.jpg';
|
||||
if (file_exists($srcImg)) {
|
||||
if (ImageManager::resize($srcImg, $imgDir.$obj_amenity->id.'.jpg')) {
|
||||
@@ -1114,6 +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_GOOGLE_ACTIVE_MAP', 0);
|
||||
Configuration::updateValue('WK_MAP_HOTEL_ACTIVE_ONLY', 1);
|
||||
|
||||
@@ -1165,6 +1235,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);
|
||||
@@ -1172,6 +1245,15 @@ class HotelHelper
|
||||
return false;
|
||||
}
|
||||
|
||||
$objFeature = new Feature($idFeature);
|
||||
$objFeature->is_featured = in_array($featureName, $featuredFeatures);
|
||||
// features without an icon keep their default image (img/rf/<id>.jpg)
|
||||
if (isset($featureIcons[$featureName])) {
|
||||
$objFeature->logo_type = 'icon';
|
||||
$objFeature->logo = $featureIcons[$featureName];
|
||||
}
|
||||
$objFeature->update();
|
||||
|
||||
foreach ($featureValues as $featureValue) {
|
||||
$idFeatureValue = (int) FeatureValue::addFeatureValueImport($idFeature, $featureValue, null, $idLang, false);
|
||||
if (!$idFeatureValue) {
|
||||
@@ -1185,6 +1267,23 @@ 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',
|
||||
'Room Size' => 'icon-arrows-alt',
|
||||
'View' => 'icon-eye',
|
||||
'Heating Type' => 'icon-fire',
|
||||
'TV Type' => 'icon-desktop',
|
||||
'Wi-Fi Speed' => 'icon-wifi',
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the default room feature/value seed set.
|
||||
*
|
||||
@@ -2192,6 +2291,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.');
|
||||
|
||||
@@ -165,6 +165,33 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController
|
||||
),
|
||||
'hint' => $this->l('Enable to display hotels list on the contact us page.'),
|
||||
),
|
||||
'WK_MAX_AMENITIES_ROOM_SEARCH' => array(
|
||||
'title' => $this->l('Maximum featured amenities in room search'),
|
||||
'hint' => $this->l('Maximum number of featured amenities to display for each room type on the front office room search page.'),
|
||||
'desc' => $this->l('Set to 0 to display all featured amenities.'),
|
||||
'type' => 'text',
|
||||
'cast' => 'intval',
|
||||
'class' => 'fixed-width-xl',
|
||||
'default' => '0',
|
||||
),
|
||||
'WK_MAX_FEATURES_ROOM_SEARCH' => array(
|
||||
'title' => $this->l('Maximum featured 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',
|
||||
),
|
||||
'WK_MAX_ROOM_TYPE_FEATURE_VALUES' => array(
|
||||
'title' => $this->l('Maximum room type feature values per featured feature'),
|
||||
'hint' => $this->l('Maximum number of room type feature values to display for each featured feature on the front office room search and order pages. For example, if the featured feature Bed Type has the values Single, Double and Queen and this is set to 2, only "Single, Double" is displayed.'),
|
||||
'desc' => $this->l('Set to 0 to display all values of each featured feature.'),
|
||||
'type' => 'text',
|
||||
'cast' => 'intval',
|
||||
'class' => 'fixed-width-xl',
|
||||
'default' => '0',
|
||||
),
|
||||
),
|
||||
'submit' => array('title' => $this->l('Save')),
|
||||
),
|
||||
@@ -529,6 +556,15 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController
|
||||
} elseif (Tools::getValue('WK_ADVANCED_PAYMENT_GLOBAL_MIN_AMOUNT') > 100) {
|
||||
$this->errors[] = $this->l('Minimum partial payment percentage should not be more than 100.');
|
||||
}
|
||||
if (!Validate::isUnsignedInt(Tools::getValue('WK_MAX_AMENITIES_ROOM_SEARCH'))) {
|
||||
$this->errors[] = $this->l('Maximum featured 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 featured features in room search is invalid. Enter 0 or a positive number.');
|
||||
}
|
||||
if (!Validate::isUnsignedInt(Tools::getValue('WK_MAX_ROOM_TYPE_FEATURE_VALUES'))) {
|
||||
$this->errors[] = $this->l('Maximum room type feature values per featured feature 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.');
|
||||
|
||||
@@ -607,6 +607,9 @@ class HotelReservationSystem extends Module
|
||||
'WK_CUSTOMER_SUPPORT_PHONE_NUMBER',
|
||||
'WK_CUSTOMER_SUPPORT_EMAIL',
|
||||
'WK_DISPLAY_CONTACT_PAGE_HOTEL_LIST',
|
||||
'WK_MAX_AMENITIES_ROOM_SEARCH',
|
||||
'WK_MAX_FEATURES_ROOM_SEARCH',
|
||||
'WK_MAX_ROOM_TYPE_FEATURE_VALUES',
|
||||
'QLO_HEADER_MEDIA_TYPE',
|
||||
'QLO_HEADER_CONTENT_ALIGN',
|
||||
'QLO_HEADER_VIDEO_SOURCE_TYPE',
|
||||
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -68,9 +68,9 @@
|
||||
<tr id="amenity_row_{$amenity.id}">
|
||||
<td class="fixed-width-xs">
|
||||
{if $amenity.logo_type == 'icon' && $amenity.logo}
|
||||
<i class="{$amenity.logo|escape:'htmlall':'UTF-8'}"></i>
|
||||
<i class="{$amenity.logo|escape:'htmlall':'UTF-8'}" style="color: #555555;"></i>
|
||||
{elseif $amenity.logo_type == 'image' && $amenity.logo}
|
||||
<img src="{$img_base_url}{$amenity.id}.jpg"
|
||||
<img src="{$img_base_url}{$amenity.logo|escape:'htmlall':'UTF-8'}"
|
||||
alt="{$amenity.name|escape:'htmlall':'UTF-8'}"
|
||||
class="htl-amenity-logo-img" />
|
||||
{else}
|
||||
|
||||
@@ -61,6 +61,22 @@
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.layered_filt_category
|
||||
{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.layered_filt_category_name
|
||||
{
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.layered_filt_category_children
|
||||
{
|
||||
padding-left: 15px;
|
||||
border-left: 1px solid #d6d4d4;
|
||||
}
|
||||
|
||||
.filters_name, .price_filter_subcont span
|
||||
{
|
||||
font-size: 16px;
|
||||
|
||||
@@ -26,7 +26,7 @@ $(document).ready(function()
|
||||
{
|
||||
var filter_wrapper = $(this).parents(".layered_filter_heading").siblings(".lf_sub_cont");
|
||||
var make_diff = filter_wrapper.children("div"); //use to make difference between checkbox and price slider
|
||||
if (make_diff.hasClass("layered_filt")) // for checkbox
|
||||
if (make_diff.hasClass("layered_filt") || make_diff.hasClass("layered_filt_category")) // for checkbox (flat or tree)
|
||||
{
|
||||
var selected_filter = filter_wrapper.find("div.layered_filt input.filter:checked").prop("checked", false);
|
||||
selected_filter.parent("span.checked").removeClass("checked");
|
||||
@@ -142,7 +142,15 @@ $(document).ready(function()
|
||||
if ($(this).is(':checked'))
|
||||
{
|
||||
var temp_type = $(this).attr('data-type');
|
||||
if (typeof filter[temp_type] != 'undefined')
|
||||
var feature_group = $(this).attr('data-feature-group');
|
||||
if (typeof feature_group != 'undefined')
|
||||
{
|
||||
// features: values of one feature are grouped (OR inside, AND between features)
|
||||
filter[temp_type] = filter[temp_type] || {};
|
||||
filter[temp_type][feature_group] = filter[temp_type][feature_group] || [];
|
||||
filter[temp_type][feature_group].push($(this).val());
|
||||
}
|
||||
else if (typeof filter[temp_type] != 'undefined')
|
||||
{
|
||||
filter[temp_type].push($(this).val());
|
||||
}
|
||||
|
||||
@@ -23,6 +23,29 @@
|
||||
{block name='room_types_filters_block'}
|
||||
<div id="filter_results" class="row block">
|
||||
<div class="col-sm-12">
|
||||
{block name='room_types_price_filter'}
|
||||
{if isset($config) && $config['SHOW_PRICE_FILTER']}
|
||||
<div class="row margin-lr-0 layered_filter_cont">
|
||||
<div class="col-sm-12 layered_filter_heading">
|
||||
<div class="row margin-lr-0">
|
||||
<div class="pull-left lf_headingmain_wrapper">
|
||||
<span>{l s='Price' mod='wkhotelfilterblock'}</span>
|
||||
<hr class="theme-text-underline">
|
||||
</div>
|
||||
<span class="pull-right clear_filter">{l s='Clear Filter' mod='wkhotelfilterblock'}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 lf_sub_cont">
|
||||
<div class="row margin-lr-0 price_filter_subcont">
|
||||
<span class="pull-left"><span id="filter_price_from">{displayPrice price=$min_price}</span></span>
|
||||
<span class="pull-right"><span id="filter_price_to">{displayPrice price=$max_price}</span></span>
|
||||
</div>
|
||||
<div id="filter_price_silder"></div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block name='room_types_amenities_filter'}
|
||||
{if isset($config) && $config['SHOW_AMENITIES_FILTER'] && $all_amenities}
|
||||
<div class="row margin-lr-0 layered_filter_cont">
|
||||
@@ -47,26 +70,29 @@
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block name='room_types_price_filter'}
|
||||
{if isset($config) && $config['SHOW_PRICE_FILTER']}
|
||||
<div class="row margin-lr-0 layered_filter_cont">
|
||||
<div class="col-sm-12 layered_filter_heading">
|
||||
<div class="row margin-lr-0">
|
||||
<div class="pull-left lf_headingmain_wrapper">
|
||||
<span>{l s='Price' mod='wkhotelfilterblock'}</span>
|
||||
<hr class="theme-text-underline">
|
||||
{block name='room_types_features_filter'}
|
||||
{if isset($config) && $config['SHOW_FEATURES_FILTER'] && isset($room_type_features) && $room_type_features}
|
||||
{foreach $room_type_features as $feature}
|
||||
<div class="row margin-lr-0 layered_filter_cont">
|
||||
<div class="col-sm-12 layered_filter_heading">
|
||||
<div class="row margin-lr-0">
|
||||
<div class="pull-left lf_headingmain_wrapper">
|
||||
<span>{$feature.name|escape:'html':'UTF-8'}</span>
|
||||
<hr class="theme-text-underline">
|
||||
</div>
|
||||
<span class="pull-right clear_filter">{l s='Clear Filter' mod='wkhotelfilterblock'}</span>
|
||||
</div>
|
||||
<span class="pull-right clear_filter">{l s='Clear Filter' mod='wkhotelfilterblock'}</span>
|
||||
</div>
|
||||
<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}">
|
||||
<span class="filters_name">{$featureValue.value|escape:'html':'UTF-8'}</span>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 lf_sub_cont">
|
||||
<div class="row margin-lr-0 price_filter_subcont">
|
||||
<span class="pull-left"><span id="filter_price_from">{displayPrice price=$min_price}</span></span>
|
||||
<span class="pull-right"><span id="filter_price_to">{displayPrice price=$max_price}</span></span>
|
||||
</div>
|
||||
<div id="filter_price_silder"></div>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
{/block}
|
||||
</div>
|
||||
|
||||
@@ -61,6 +61,15 @@ class wkhotelfilterblock extends Module
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
|
||||
|
||||
$features = array();
|
||||
$featuresList = Feature::getFeatures($this->context->language->id);
|
||||
foreach ($featuresList as $feature) {
|
||||
$features[] = array('id_group' => (int) $feature['id_feature'], 'name' => $feature['name']);
|
||||
}
|
||||
|
||||
|
||||
$fields_form = array();
|
||||
$fields_form['form'] = array(
|
||||
'legend' => array(
|
||||
@@ -102,6 +111,33 @@ class wkhotelfilterblock extends Module
|
||||
),
|
||||
'hint' => $this->l('Enable to display Price filter.'),
|
||||
),
|
||||
array(
|
||||
'type' => 'switch',
|
||||
'label' => $this->l('Show Features filter'),
|
||||
'name' => 'SHOW_FEATURES_FILTER',
|
||||
'is_bool' => true,
|
||||
'values' => array(
|
||||
array(
|
||||
'id' => 'features_on',
|
||||
'value' => 1,
|
||||
),
|
||||
array(
|
||||
'id' => 'features_off',
|
||||
'value' => 0,
|
||||
),
|
||||
),
|
||||
'hint' => $this->l('Enable to display Room Features filter.'),
|
||||
),
|
||||
array(
|
||||
'type' => 'group',
|
||||
'label' => $this->l('Features'),
|
||||
'name' => 'FEATURES_FILTER_BOX',
|
||||
'form_group_class' => 'features_filter_group',
|
||||
'groups_id_title' => $this->l('ID'),
|
||||
'groups_title' => $this->l('Feature name'),
|
||||
'values' => $features,
|
||||
'hint' => $this->l('Mark the features that will be displayed in the Features filter.'),
|
||||
),
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save'),
|
||||
@@ -120,24 +156,54 @@ class wkhotelfilterblock extends Module
|
||||
'&configure='.$this->name.'&module_name='.$this->name;
|
||||
$helper->token = Tools::getAdminTokenLite('AdminModules');
|
||||
|
||||
$fieldsValue = $this->getConfigFieldsValues();
|
||||
$selectedFeatures = $this->getSelectedFeatureIds();
|
||||
foreach ($features as $feature) {
|
||||
$fieldsValue['FEATURES_FILTER_BOX_'.$feature['id_group']] = in_array($feature['id_group'], $selectedFeatures);
|
||||
}
|
||||
|
||||
$helper->tpl_vars = array(
|
||||
'fields_value' => $this->getConfigFieldsValues(),
|
||||
'fields_value' => $fieldsValue,
|
||||
'languages' => $this->context->controller->getLanguages(),
|
||||
'id_language' => $this->context->language->id,
|
||||
);
|
||||
|
||||
return $helper->generateForm(array($fields_form));
|
||||
// show the features list only when the Features filter is enabled
|
||||
$script = '<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
function toggleFeaturesGroup() {
|
||||
$(".features_filter_group").toggle($("input[name=\'SHOW_FEATURES_FILTER\']:checked").val() == 1);
|
||||
}
|
||||
$("input[name=\'SHOW_FEATURES_FILTER\']").on("change", toggleFeaturesGroup);
|
||||
toggleFeaturesGroup();
|
||||
});
|
||||
</script>';
|
||||
|
||||
return $helper->generateForm(array($fields_form)).$script;
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::isSubmit('btnConfigSubmit')) {
|
||||
if (Tools::getValue('SHOW_FEATURES_FILTER') && !array_filter((array) Tools::getValue('FEATURES_FILTER_BOX', array()))) {
|
||||
$this->html .= $this->displayError($this->l('Please select at least one feature to show in the Features filter.'));
|
||||
|
||||
return;
|
||||
}
|
||||
Configuration::updateValue(
|
||||
'SHOW_AMENITIES_FILTER',
|
||||
Tools::getValue('SHOW_AMENITIES_FILTER')
|
||||
);
|
||||
Configuration::updateValue('SHOW_PRICE_FILTER', Tools::getValue('SHOW_PRICE_FILTER'));
|
||||
|
||||
Configuration::updateValue('SHOW_FEATURES_FILTER', (int) Tools::getValue('SHOW_FEATURES_FILTER'));
|
||||
if(Tools::getValue('SHOW_FEATURES_FILTER')){
|
||||
Configuration::updateValue(
|
||||
'FEATURES_FILTER_IDS',
|
||||
implode(',', array_map('intval', (array) Tools::getValue('FEATURES_FILTER_BOX', array())))
|
||||
);
|
||||
}else{
|
||||
Configuration::updateValue('FEATURES_FILTER_IDS', '');
|
||||
}
|
||||
// redirect after saving the configuration
|
||||
Tools::redirectAdmin(
|
||||
$this->context->link->getAdminLink('AdminModules').'&configure='.$this->name.'&tab_module='.$this->tab.
|
||||
@@ -154,6 +220,8 @@ class wkhotelfilterblock extends Module
|
||||
|| !$this->registerHook('displayLeftColumn')
|
||||
|| !Configuration::updateValue('SHOW_AMENITIES_FILTER', 1)
|
||||
|| !Configuration::updateValue('SHOW_PRICE_FILTER', 1)
|
||||
|| !Configuration::updateValue('SHOW_FEATURES_FILTER', 0)
|
||||
|| !Configuration::updateValue('FEATURES_FILTER_IDS', '')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
@@ -229,6 +297,20 @@ class wkhotelfilterblock extends Module
|
||||
$currency = $this->context->currency;
|
||||
|
||||
$config = $this->getConfigFieldsValues();
|
||||
// features with their values for the features tree filter
|
||||
$room_type_features = array();
|
||||
if ($config['SHOW_FEATURES_FILTER'] && Feature::isFeatureActive()) {
|
||||
$selectedFeatures = $this->getSelectedFeatureIds();
|
||||
foreach (Feature::getFeatures($id_lang) as $feature) {
|
||||
if (!in_array((int) $feature['id_feature'], $selectedFeatures)) {
|
||||
continue;
|
||||
}
|
||||
if ($values = FeatureValue::getFeatureValuesWithLang($id_lang, (int) $feature['id_feature'])) {
|
||||
$feature['values'] = $values;
|
||||
$room_type_features[] = $feature;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$num_days = HotelHelper::getNumberOfDays($date_from, $date_to);
|
||||
|
||||
@@ -236,6 +318,7 @@ class wkhotelfilterblock extends Module
|
||||
$this->context->smarty->assign(array(
|
||||
'warning_num' => $warning_num,
|
||||
'all_amenities' => $all_amenities,
|
||||
'room_type_features' => $room_type_features,
|
||||
'max_adult' => $max_adult,
|
||||
'max_child' => $max_child,
|
||||
'cat_link' => $categoryUrl,
|
||||
@@ -259,14 +342,29 @@ class wkhotelfilterblock extends Module
|
||||
return array(
|
||||
'SHOW_AMENITIES_FILTER' => Configuration::get('SHOW_AMENITIES_FILTER'),
|
||||
'SHOW_PRICE_FILTER' => Configuration::get('SHOW_PRICE_FILTER'),
|
||||
'SHOW_FEATURES_FILTER' => Configuration::get('SHOW_FEATURES_FILTER'),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the ids of the features selected in the configuration for the Features filter.
|
||||
*
|
||||
* @return int[]
|
||||
*/
|
||||
public function getSelectedFeatureIds()
|
||||
{
|
||||
$ids = (string) Configuration::get('FEATURES_FILTER_IDS');
|
||||
|
||||
return $ids === '' ? array() : array_map('intval', explode(',', $ids));
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
if (!parent::uninstall()
|
||||
|| !Configuration::deleteByName('SHOW_AMENITIES_FILTER')
|
||||
|| !Configuration::deleteByName('SHOW_PRICE_FILTER')
|
||||
|| !Configuration::deleteByName('SHOW_FEATURES_FILTER')
|
||||
|| !Configuration::deleteByName('FEATURES_FILTER_IDS')
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
<p>{l s='qty'}: {$product['quantity']}</p>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<div class="text-right service-price-action">
|
||||
<p>{displayPrice price=$product['price']}</p>
|
||||
<a class="btn btn-sm btn-default remove_roomtype_product" data-id-product="{$product['id_product']}"><i class="icon-trash"></i></a>
|
||||
</div>
|
||||
|
||||
@@ -53,18 +53,36 @@
|
||||
{block name='room_type_list_room_description'}
|
||||
<div class="rm_desc">{$room_v['description_short']|truncate:190:"":true} <a class="view_more" href="{$room_v['product_link']|escape:'htmlall':'UTF-8'}">{l s='View More'}....</a></div>
|
||||
{/block}
|
||||
{block name='room_type_list_room_featured_features'}
|
||||
{if !empty($room_v['featured_features'])}
|
||||
<div class="row">
|
||||
<div class="col-sm-12 room_featured_features">
|
||||
{foreach from=$room_v['featured_features'] item=featured_feature}
|
||||
<span class="room_featured_feature">
|
||||
{if $featured_feature.logo_type == 'icon' && $featured_feature.logo}
|
||||
<i class="{$featured_feature.logo|escape:'htmlall':'UTF-8'}"></i>
|
||||
{else}
|
||||
<img src="{$smarty.const._PS_IMG_}rf/{$featured_feature.logo_image|escape:'html':'UTF-8'}" alt="" onerror="this.style.display='none'" />
|
||||
{/if}
|
||||
{$featured_feature.value|escape:'htmlall':'UTF-8'}{if !$featured_feature@last} |{/if}
|
||||
</span>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
<div class="room_features_cont">
|
||||
<div class="row">
|
||||
{block name='room_type_list_room_features'}
|
||||
<div class="col-sm-12 col-md-5 col-lg-6">
|
||||
{if !empty($room_v['feature'])}
|
||||
{if !empty($room_v['featured_amenities'])}
|
||||
<p class="rm_amenities_cont">
|
||||
{foreach from=$room_v['feature'] key=feat_k item=feat_v}
|
||||
{foreach from=$room_v['featured_amenities'] key=feat_k item=feat_v}
|
||||
{if $feat_v.logo_type == 'icon' && $feat_v.logo}
|
||||
<i class="{$feat_v.logo|escape:'htmlall':'UTF-8'} rm_amen" title="{$feat_v.name|escape:'htmlall':'UTF-8'}"></i>
|
||||
{elseif $feat_v.logo_type == 'image' && $feat_v.logo}
|
||||
<img title="{$feat_v.name|escape:'htmlall':'UTF-8'}"
|
||||
src="{$amenity_img_dir|escape:'htmlall':'UTF-8'}{$feat_v.id|intval}.jpg"
|
||||
src="{$amenity_img_dir|escape:'htmlall':'UTF-8'}{$feat_v.logo|escape:'htmlall':'UTF-8'}"
|
||||
class="rm_amen" />
|
||||
{/if}
|
||||
{/foreach}
|
||||
|
||||
@@ -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;
|
||||
@@ -108,9 +109,6 @@
|
||||
p.capa_txt {
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
.visible-md .capa_txt {
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.rm_review_cont
|
||||
{
|
||||
@@ -155,10 +153,31 @@ p.capa_txt {
|
||||
|
||||
.rm_amen
|
||||
{
|
||||
width: 20px;
|
||||
color: #555555;
|
||||
width: 18px;
|
||||
display: inline-block;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 5px;
|
||||
font-size: 16px;
|
||||
color: #555555;
|
||||
}
|
||||
|
||||
.room_featured_feature
|
||||
{
|
||||
display: inline-block;
|
||||
margin: 0 10px 10px 0;
|
||||
color: #555;
|
||||
}
|
||||
.room_featured_feature i{
|
||||
|
||||
font-size: 16px;
|
||||
color: #555555;
|
||||
}
|
||||
|
||||
.room_featured_feature img
|
||||
{
|
||||
max-height: 20px;
|
||||
max-width: 20px;
|
||||
}
|
||||
|
||||
.rm_price_val
|
||||
@@ -258,7 +277,6 @@ p.capa_txt {
|
||||
left: unset;
|
||||
}
|
||||
.room_features_cont > div {
|
||||
min-height: 47px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
|
||||
@@ -200,15 +200,38 @@
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.order-detail-content span.room-type-feature {
|
||||
white-space: nowrap;
|
||||
line-height: 35px;
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
line-height: 24px;
|
||||
background-color: #eee;
|
||||
border-radius: 10px;
|
||||
margin-right: 10px;
|
||||
padding: 3px 10px 6px 0px;
|
||||
font-size: 14px;
|
||||
border-radius: 10px 10px 10px 11px;
|
||||
margin: 0 10px 10px 0;
|
||||
padding: 0px 8px 0px 0px;
|
||||
font-size: 12px;
|
||||
color: #555555;
|
||||
}
|
||||
.room-type-feature i,
|
||||
.room-type-feature img {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #000000;
|
||||
border-radius: 50%;
|
||||
background-color: #ffffff;
|
||||
color: #000000;
|
||||
vertical-align: middle;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.room-type-feature i {
|
||||
font-size: 12px;
|
||||
color: #555555;
|
||||
}
|
||||
.room-type-feature img {
|
||||
padding: 3px;
|
||||
}
|
||||
.order-detail-content .room_duration_block_head {
|
||||
font-size: 12px;
|
||||
color: #777777;
|
||||
|
||||
@@ -1294,14 +1294,13 @@ 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;
|
||||
gap: 5px;
|
||||
margin-bottom: 3px;}
|
||||
|
||||
.room_info_heading i {
|
||||
font-size: 16px;}
|
||||
.product_wrapper .form-control {
|
||||
background-color: transparent!important;
|
||||
border: 1px solid #999999;
|
||||
@@ -1442,6 +1441,24 @@ Quick View Styles
|
||||
color: #505050;
|
||||
}
|
||||
|
||||
/* featured amenities (room type + hotel) */
|
||||
.featured_amenities .featured_amenity {
|
||||
display: inline-block;
|
||||
margin: 0 20px 8px 0;
|
||||
}
|
||||
.featured_amenities .featured_amenity img {
|
||||
max-height: 20px;
|
||||
max-width: 20px;
|
||||
}
|
||||
|
||||
/* font icons use the same color as the amenity/feature jpg images */
|
||||
.featured_amenities .featured_amenity i,
|
||||
.info_margin_div .col-sm-4 > i,
|
||||
.room_info_heading i {
|
||||
color: #555555;
|
||||
}
|
||||
/* end */
|
||||
|
||||
/* service popup design */
|
||||
.services-info-tooltip-cont {
|
||||
min-width: 240px;
|
||||
@@ -1471,6 +1488,18 @@ 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;
|
||||
justify-content: flex-end;
|
||||
gap: 10px;
|
||||
}
|
||||
.extra-service-panel .services-list .services-list-row .service-price-action p {
|
||||
margin: 0;
|
||||
}
|
||||
.extra-service-panel .summary-row .service_price {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
@@ -261,40 +261,69 @@
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
{block name='product_info_tab_featured_amenities'}
|
||||
{if isset($featured_amenities) && $featured_amenities}
|
||||
<div class="row info_margin_div featured_amenities">
|
||||
<div class="col-sm-12">
|
||||
<div class="room_info_heading">
|
||||
<span>{l s='Featured Amenities'}</span>
|
||||
</div>
|
||||
<div class="room_info_content row">
|
||||
{foreach from=$featured_amenities item=amenity}
|
||||
<div class="col-sm-4 col-xs-6">
|
||||
<span class="featured_amenity" title="{$amenity.name|escape:'html':'UTF-8'}">
|
||||
{if $amenity.logo_type == 'icon' && $amenity.logo}
|
||||
<i class="{$amenity.logo|escape:'html':'UTF-8'}"></i>
|
||||
{elseif $amenity.logo_type == 'image' && $amenity.logo}
|
||||
<img src="{$amenity_img_dir|escape:'html':'UTF-8'}{$amenity.logo|escape:'html':'UTF-8'}" alt="{$amenity.name|escape:'html':'UTF-8'}" />
|
||||
{/if}
|
||||
<span class="amenity-name">{$amenity.name|escape:'html':'UTF-8'}</span>
|
||||
</span>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
{block name='product_info_tab_room_features'}
|
||||
{if isset($room_type_features) && $room_type_features}
|
||||
<div class="info_margin_div">
|
||||
{assign var="current_feature_name" value=""}
|
||||
{assign var="current_feature_values" value=""}
|
||||
{assign var="current_feature_id" value=0}
|
||||
{foreach from=$room_type_features item=feature}
|
||||
{if $feature.name != $current_feature_name}
|
||||
{if $current_feature_name != ""}
|
||||
<div class="room_feature_group">
|
||||
<div class="room_info_heading">
|
||||
<img src="{$smarty.const._PS_IMG_}rf/{$current_feature_id|intval}.jpg" alt="{$current_feature_name|escape:'html':'UTF-8'}" title="{$current_feature_name|escape:'html':'UTF-8'}" style="max-height:20px;max-width:20px;" onerror="this.style.display='none'" />
|
||||
<span>{$current_feature_name|escape:'html':'UTF-8'}</span>
|
||||
</div>
|
||||
<div class="room_info_content">{$current_feature_values|escape:'html':'UTF-8'}</div>
|
||||
</div>
|
||||
{/if}
|
||||
{assign var="current_feature_name" value=$feature.name}
|
||||
{assign var="current_feature_id" value=$feature.id_feature}
|
||||
{assign var="current_feature_values" value=$feature.value}
|
||||
{else}
|
||||
{assign var="current_feature_values" value="`$current_feature_values`, `$feature.value`"}
|
||||
{/if}
|
||||
{if $feature@last}
|
||||
<div class="room_feature_group">
|
||||
{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 != ""}
|
||||
<div class="info_margin_div room_feature_group">
|
||||
<div class="room_info_heading">
|
||||
<img src="{$smarty.const._PS_IMG_}rf/{$current_feature_id|intval}.jpg" alt="{$current_feature_name|escape:'html':'UTF-8'}" title="{$current_feature_name|escape:'html':'UTF-8'}" style="max-height:20px;max-width:20px;" onerror="this.style.display='none'" />
|
||||
{if $current_feature_logo_type == 'icon' && $current_feature_logo}<i class="{$current_feature_logo|escape:'html':'UTF-8'}"></i>{else}<img src="{$smarty.const._PS_IMG_}rf/{$current_feature_logo_image|escape:'html':'UTF-8'}" alt="{$current_feature_name|escape:'html':'UTF-8'}" title="{$current_feature_name|escape:'html':'UTF-8'}" style="max-height:20px;max-width:20px;" onerror="this.style.display='none'" />{/if}
|
||||
<span>{$current_feature_name|escape:'html':'UTF-8'}</span>
|
||||
</div>
|
||||
<div class="room_info_content">{$current_feature_values|escape:'html':'UTF-8'}</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</div>
|
||||
{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}
|
||||
<div class="info_margin_div room_feature_group">
|
||||
<div class="room_info_heading">
|
||||
{if $current_feature_logo_type == 'icon' && $current_feature_logo}<i class="{$current_feature_logo|escape:'html':'UTF-8'}"></i>{else}<img src="{$smarty.const._PS_IMG_}rf/{$current_feature_logo_image|escape:'html':'UTF-8'}" alt="{$current_feature_name|escape:'html':'UTF-8'}" title="{$current_feature_name|escape:'html':'UTF-8'}" style="max-height:20px;max-width:20px;" onerror="this.style.display='none'" />{/if}
|
||||
<span>{$current_feature_name|escape:'html':'UTF-8'}</span>
|
||||
</div>
|
||||
<div class="room_info_content">{$current_feature_values|escape:'html':'UTF-8'}</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{/if}
|
||||
{/block}
|
||||
{* Block for booking products *}
|
||||
@@ -303,15 +332,15 @@
|
||||
{if isset($room_dynamic_amenities) && $room_dynamic_amenities}
|
||||
<div class="info_margin_div">
|
||||
<div class="room_info_heading">
|
||||
<span>{l s='%s Amenities' sprintf=$property_type}</span>
|
||||
<span>{l s='%s Amenities' sprintf=$room_type_info['selling_object_name']}</span>
|
||||
</div>
|
||||
<div class="room_info_content row">
|
||||
{foreach from=$room_dynamic_amenities item=amenity}
|
||||
<div class="col-sm-4 col-xs-12" title="{$amenity.name|escape:'html':'UTF-8'}">
|
||||
<div class="col-sm-4 col-xs-6" title="{$amenity.name|escape:'html':'UTF-8'}">
|
||||
{if $amenity.logo_type == 'icon' && $amenity.logo}
|
||||
<i class="{$amenity.logo|escape:'html':'UTF-8'}"></i>
|
||||
{elseif $amenity.logo_type == 'image' && $amenity.logo}
|
||||
<img src="{$amenity_img_dir|escape:'html':'UTF-8'}{$amenity.id|intval}.jpg"
|
||||
<img src="{$amenity_img_dir|escape:'html':'UTF-8'}{$amenity.logo|escape:'html':'UTF-8'}"
|
||||
alt="{$amenity.name|escape:'html':'UTF-8'}"
|
||||
title="{$amenity.name|escape:'html':'UTF-8'}"
|
||||
style="max-height:20px;max-width:20px;" />
|
||||
@@ -331,11 +360,11 @@
|
||||
</div>
|
||||
<div class="room_info_content row">
|
||||
{foreach from=$hotel_dynamic_amenities item=amenity}
|
||||
<div class="col-sm-4 col-xs-12" title="{$amenity.name|escape:'html':'UTF-8'}">
|
||||
<div class="col-sm-4 col-xs-6" title="{$amenity.name|escape:'html':'UTF-8'}">
|
||||
{if $amenity.logo_type == 'icon' && $amenity.logo}
|
||||
<i class="{$amenity.logo|escape:'html':'UTF-8'}"></i>
|
||||
{elseif $amenity.logo_type == 'image' && $amenity.logo}
|
||||
<img src="{$amenity_img_dir|escape:'html':'UTF-8'}{$amenity.id|intval}.jpg"
|
||||
<img src="{$amenity_img_dir|escape:'html':'UTF-8'}{$amenity.logo|escape:'html':'UTF-8'}"
|
||||
alt="{$amenity.name|escape:'html':'UTF-8'}"
|
||||
title="{$amenity.name|escape:'html':'UTF-8'}"
|
||||
style="max-height:20px;max-width:20px;" />
|
||||
|
||||
@@ -79,11 +79,16 @@
|
||||
{/block}
|
||||
</div>
|
||||
{block name='shopping_cart_room_type_features'}
|
||||
{if isset($data_v['hotel_info']['room_features'])}
|
||||
{if !empty($data_v['hotel_info']['room_features'])}
|
||||
<div class="room-type-features">
|
||||
{foreach $data_v['hotel_info']['room_features'] as $feature}
|
||||
<span class="room-type-feature">
|
||||
<img src="{$THEME_DIR}img/icon/form-ok-circle.svg" /> {$feature['value']|escape:'html':'UTF-8'}
|
||||
{if $feature['logo_type'] == 'icon' && $feature['logo']}
|
||||
<i class="{$feature['logo']|escape:'html':'UTF-8'}"></i>
|
||||
{else}
|
||||
<img src="{$smarty.const._PS_IMG_}rf/{$feature['logo_image']|escape:'html':'UTF-8'}" alt="" onerror="this.style.display='none'" />
|
||||
{/if}
|
||||
{$feature['value']|escape:'html':'UTF-8'}
|
||||
</span>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
||||