From ece7f8a899d896acaf82837201cc95ad15b72bbb Mon Sep 17 00:00:00 2001 From: amit sharma Date: Mon, 7 Sep 2026 20:07:42 +0530 Subject: [PATCH 01/90] fixed: render formatted tooltip text in debug mode Co-authored-by: Name --- classes/controller/AdminController.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 2b6636eef..43d66aa9b 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -2894,6 +2894,18 @@ class AdminControllerCore extends Controller public function setDeprecatedMedia() { } + + public function addJqueryUI($component, $theme = 'base', $check_dependencies = true) + { + parent::addJqueryUI($component, $theme, $check_dependencies); + + if ($component === 'ui.tooltip' || (is_array($component) && in_array('ui.tooltip', $component))) { + $bootstrap_js = Media::getJSPath(__PS_BASE_URI__.$this->admin_webpath.'/themes/'.$this->bo_theme.'/js/vendor/bootstrap.min.js'); + if ($bootstrap_js) { + $this->js_files[] = $bootstrap_js.'?reclaim_tooltip=1'; + } + } + } public function setMedia() { From 0f6436617c0c47d1f24494b259f89398f2cc39fc Mon Sep 17 00:00:00 2001 From: amit sharma Date: Wed, 9 Sep 2026 16:22:28 +0530 Subject: [PATCH 02/90] Fixed: Resolved tooltip rendering issue caused by conflicts between jQuery and Bootstrap tooltip libraries. Co-authored-by: Name --- admin/themes/default/js/admin-theme.js | 19 +++++++++++++++++-- .../default/js/bootstrap-tooltip-alias.js | 8 ++++++++ admin/themes/default/template/header.tpl | 4 ++-- classes/controller/AdminController.php | 13 +------------ 4 files changed, 28 insertions(+), 16 deletions(-) create mode 100644 admin/themes/default/js/bootstrap-tooltip-alias.js diff --git a/admin/themes/default/js/admin-theme.js b/admin/themes/default/js/admin-theme.js index 04acc90b5..8d2ad1b1f 100644 --- a/admin/themes/default/js/admin-theme.js +++ b/admin/themes/default/js/admin-theme.js @@ -377,7 +377,20 @@ $(document).ready(function() { //bootstrap components init $('.dropdown-toggle').dropdown(); - $('.label-tooltip, .help-tooltip').tooltip(); + $('.label-tooltip, .help-tooltip').not('.debug-mode-tooltip').tooltip(); + + $('.debug-mode-tooltip').each(function () { + var $tooltip = $(this); + + if ($.isFunction($.fn.bootstrapTooltip)) { + if (!$tooltip.data('bs.tooltip')) { + $tooltip.bootstrapTooltip({ + html: true, + placement: 'bottom' + }); + } + } + }); $('#error-modal').modal('show'); //init footer @@ -478,7 +491,9 @@ $(document).ready(function() { $('.no-htl-access-option').on('click', function() { $(this).prop('selected', false); }); + initTooltip(); + }); //end dom ready function initTooltip($target, contentFn, items) { @@ -516,4 +531,4 @@ function initTooltip($target, contentFn, items) { } }); }); -} \ No newline at end of file +} diff --git a/admin/themes/default/js/bootstrap-tooltip-alias.js b/admin/themes/default/js/bootstrap-tooltip-alias.js new file mode 100644 index 000000000..00ef3623c --- /dev/null +++ b/admin/themes/default/js/bootstrap-tooltip-alias.js @@ -0,0 +1,8 @@ +/* Preserve Bootstrap 3's tooltip before jQuery UI overwrites $.fn.tooltip. */ +(function ($) { + 'use strict'; + + if ($ && $.fn && $.isFunction($.fn.tooltip) && $.fn.tooltip.Constructor) { + $.fn.bootstrapTooltip = $.fn.tooltip; + } +}(window.jQuery)); diff --git a/admin/themes/default/template/header.tpl b/admin/themes/default/template/header.tpl index bb6f6f97f..1316ec153 100644 --- a/admin/themes/default/template/header.tpl +++ b/admin/themes/default/template/header.tpl @@ -301,7 +301,7 @@ {if isset($debug_mode) && $debug_mode == true}
  • {$node.name|escape:'html':'UTF-8'} - {if $node.children|@count > 0} + {if $node.children|@count > 0 || (isset($node.room_types) && $node.room_types|@count > 0)}
      {foreach from=$node.children item=child name=categoryTreeBranch} - {if $smarty.foreach.categoryTreeBranch.last} + {if $smarty.foreach.categoryTreeBranch.last && !(isset($node.room_types) && $node.room_types|@count > 0)} {include file="$tpl_dir./category-tree-branch.tpl" node=$child last='true'} {else} {include file="$tpl_dir./category-tree-branch.tpl" node=$child last='false'} {/if} {/foreach} + {if isset($node.room_types)} + {foreach from=$node.room_types item=roomType name=roomTypeBranch} +
    • + {$roomType.name|escape:'html':'UTF-8'} +
    • + {/foreach} + {/if}
    {/if}
  • \ No newline at end of file diff --git a/themes/hotel-reservation-theme/sitemap.tpl b/themes/hotel-reservation-theme/sitemap.tpl new file mode 100644 index 000000000..862b93590 --- /dev/null +++ b/themes/hotel-reservation-theme/sitemap.tpl @@ -0,0 +1,185 @@ +{* +* 2007-2017 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2017 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + +{capture name=path}{l s='Sitemap'}{/capture} + +

    + {l s='Sitemap'} +

    +
    +
    +
    +

    {l s='Our properties'}

    + +
    +
    +
    +
    +

    + {l s='Your Account'} +

    + +
    +
    +
    +
    +
    +
    +

    {l s='Categories'}

    +
    + +
    +
      + {if isset($categoriesTree.children)} + {foreach $categoriesTree.children as $child} + {if $child@last} + {include file="$tpl_dir./category-tree-branch.tpl" node=$child last='true'} + {else} + {include file="$tpl_dir./category-tree-branch.tpl" node=$child} + {/if} + {/foreach} + {/if} +
    +
    +
    +
    +
    +

    {l s='Pages'}

    + +
    +
    +
    From 5be7de3177162d8a172749e334f5a454c509878b Mon Sep 17 00:00:00 2001 From: amit sharma Date: Wed, 14 Oct 2026 16:13:43 +0530 Subject: [PATCH 66/90] Fixed: standalone product contains booking voucher having Rooms and Room type related fields Co-authored-by: Name --- classes/pdf/HTMLTemplateBookingVoucher.php | 41 ++++++++++++++++++- controllers/front/GuestTrackingController.php | 1 + controllers/front/OrderDetailController.php | 1 + .../front/PdfBookingVoucherController.php | 4 ++ pdf/booking-voucher.tpl | 33 +++++++++++++++ .../$tpl_dir./shopping-cart.tpl | 0 .../hotel-reservation-theme/order-detail.tpl | 4 ++ 7 files changed, 83 insertions(+), 1 deletion(-) delete mode 100644 themes/hotel-reservation-theme/$tpl_dir./shopping-cart.tpl diff --git a/classes/pdf/HTMLTemplateBookingVoucher.php b/classes/pdf/HTMLTemplateBookingVoucher.php index 03cf50a15..b3b2fece0 100644 --- a/classes/pdf/HTMLTemplateBookingVoucher.php +++ b/classes/pdf/HTMLTemplateBookingVoucher.php @@ -141,6 +141,8 @@ class HTMLTemplateBookingVoucherCore extends HTMLTemplate $serviceGroups = array(); $roomTypeRows = array(); + $objServiceProductOrderDetail = new ServiceProductOrderDetail(); + foreach ($bookings as $booking) { $nights = (int)HotelHelper::getNumberOfDays($booking['date_from'], $booking['date_to']); if ($nights <= 0) { @@ -160,7 +162,6 @@ class HTMLTemplateBookingVoucherCore extends HTMLTemplate $bookingServices = array(); // Auto-added services bundled with room price (for cost calculation only) - $objServiceProductOrderDetail = new ServiceProductOrderDetail(); $autoAddedWithRoomPriceTaxExcl = (float)$objServiceProductOrderDetail->getRoomTypeServiceProducts( (int)$this->order->id, 0, 0, isset($booking['id_product']) ? (int)$booking['id_product'] : 0, @@ -245,6 +246,43 @@ class HTMLTemplateBookingVoucherCore extends HTMLTemplate } unset($roomTypeRow); + // --- Hotel products --- + $hotelProducts = array(); + + $products = $objServiceProductOrderDetail->getServiceProductsInOrder( + (int) $this->order->id, + 0, + 0, + Product::SELLING_PREFERENCE_WITH_HOTEL + ); + + if (is_array($products)) { + foreach ($products as $product) { + $taxLabel = self::l('No tax'); + if ($taxes = OrderDetail::getTaxListStatic((int) $product['id_order_detail'])) { + $taxTemp = array(); + foreach ($taxes as $tax) { + $objTax = new Tax($tax['id_tax']); + $taxTemp[] = sprintf(self::l('%1$s%2$s%%'), $objTax->rate + 0, ' '); + } + $taxLabel = implode(', ', $taxTemp); + } + $hotelName = ''; + if (!empty($product['id_hotel'])) { + $objProductHotel = new HotelBranchInformation((int) $product['id_hotel'], (int) $this->order->id_lang); + $hotelName = $objProductHotel->hotel_name; + } + $hotelProducts[] = array( + 'name' => $product['name'].(!empty($product['option_name']) ? ' : '.$product['option_name'] : ''), + 'hotel_name' => $hotelName, + 'tax_label' => $taxLabel, + 'quantity' => (int) $product['quantity'], + 'unit_price_tax_excl' => (float) $product['unit_price_tax_excl'], + 'total_price_tax_excl' => (float) $product['total_price_tax_excl'], + ); + } + } + $guestAddress = ''; $guest = new Customer((int)$this->order->id_customer); @@ -353,6 +391,7 @@ class HTMLTemplateBookingVoucherCore extends HTMLTemplate 'total_room_nights' => (int)$totalRoomNights, 'room_type_rows' => array_values($roomTypeRows), 'service_groups' => $serviceGroups, + 'hotel_products' => $hotelProducts, 'payment_method' => $paymentMethod, 'footer' => $footer, 'payment_policy' => $paymentPolicy, diff --git a/controllers/front/GuestTrackingController.php b/controllers/front/GuestTrackingController.php index 62885ecb6..fa3aafc6d 100644 --- a/controllers/front/GuestTrackingController.php +++ b/controllers/front/GuestTrackingController.php @@ -560,6 +560,7 @@ class GuestTrackingControllerCore extends FrontController 'refund_allowed' => false, 'invoiceAllowed' => (int)Configuration::get('PS_INVOICE'), 'is_guest' => true, + 'has_room_booking' => (bool) HotelBookingDetail::getIdHotelByIdOrder((int) $order->id, false), 'group_use_tax' => (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC), 'CUSTOMIZE_FILE' => Product::CUSTOMIZE_FILE, 'CUSTOMIZE_TEXTFIELD' => Product::CUSTOMIZE_TEXTFIELD, diff --git a/controllers/front/OrderDetailController.php b/controllers/front/OrderDetailController.php index 3b954dbc8..b3756f4be 100644 --- a/controllers/front/OrderDetailController.php +++ b/controllers/front/OrderDetailController.php @@ -464,6 +464,7 @@ class OrderDetailControllerCore extends FrontController 'deliveryAddressFormatedValues' => $deliveryAddressFormatedValues, 'deliveryState' => (Validate::isLoadedObject($addressDelivery) && $addressDelivery->id_state) ? new State($addressDelivery->id_state) : false, 'is_guest' => false, + 'has_room_booking' => (bool) HotelBookingDetail::getIdHotelByIdOrder((int) $order->id, false), 'messages' => CustomerMessage::getMessagesByOrderId((int) $order->id, false), 'CUSTOMIZE_FILE' => Product::CUSTOMIZE_FILE, 'CUSTOMIZE_TEXTFIELD' => Product::CUSTOMIZE_TEXTFIELD, diff --git a/controllers/front/PdfBookingVoucherController.php b/controllers/front/PdfBookingVoucherController.php index 0ba3302c9..f29d8b3eb 100644 --- a/controllers/front/PdfBookingVoucherController.php +++ b/controllers/front/PdfBookingVoucherController.php @@ -59,6 +59,10 @@ class PdfBookingVoucherControllerCore extends FrontController die(Tools::displayError('The booking voucher was not found.')); } + if (!HotelBookingDetail::getIdHotelByIdOrder((int) $order->id, false)) { + die(Tools::displayError('The booking voucher was not found.')); + } + $this->order = $order; } diff --git a/pdf/booking-voucher.tpl b/pdf/booking-voucher.tpl index 25aae5901..bcc0fc8f0 100644 --- a/pdf/booking-voucher.tpl +++ b/pdf/booking-voucher.tpl @@ -198,6 +198,39 @@ {/if} + {if $hotel_products} + +   + + + + + + + + + + + + + + + + {foreach from=$hotel_products item=product} + + + + + + + + {/foreach} + +
    {l s='PRODUCTS DETAILS' pdf='true'}
    {l s='Product Name' pdf='true'}{l s='Tax' pdf='true'}{l s='Unit Price (tax excl.)' pdf='true'}{l s='Qty' pdf='true'}{l s='Total (tax excl.)' pdf='true'}
    {$product.name|escape:'html':'UTF-8'}{if $product.hotel_name}
    {$product.hotel_name|escape:'html':'UTF-8'}{/if}
    {$product.tax_label nofilter}{displayPrice currency=$order->id_currency price=$product.unit_price_tax_excl}{$product.quantity|intval}{displayPrice currency=$order->id_currency price=$product.total_price_tax_excl}
    + + + {/if} +
     
    diff --git a/themes/hotel-reservation-theme/$tpl_dir./shopping-cart.tpl b/themes/hotel-reservation-theme/$tpl_dir./shopping-cart.tpl deleted file mode 100644 index e69de29bb..000000000 diff --git a/themes/hotel-reservation-theme/order-detail.tpl b/themes/hotel-reservation-theme/order-detail.tpl index 14866703b..1e836ae77 100644 --- a/themes/hotel-reservation-theme/order-detail.tpl +++ b/themes/hotel-reservation-theme/order-detail.tpl @@ -148,6 +148,7 @@ + {if $has_room_booking}
    {l s='Booking Voucher'}
    @@ -157,6 +158,7 @@
    + {/if}
    {l s='Status'}
    @@ -673,6 +675,7 @@
    + {if $has_room_booking}
    {l s='Booking Voucher'}
    @@ -682,6 +685,7 @@
    + {/if}
    {l s='Status'}
    From d103f9814835c15d568ca4ff2833879ac5483cab Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Wed, 14 Oct 2026 17:18:13 +0530 Subject: [PATCH 67/90] sitemap(html)design fix --- controllers/front/SitemapController.php | 15 ++++ modules/qlogsitemap/classes/QgsHelper.php | 7 ++ modules/qlogsitemap/qlogsitemap.php | 45 ++++++------ .../hotel-reservation-theme/css/sitemap.css | 43 ++++++++++++ .../img/sitemap-horizontal.png | Bin 0 -> 71 bytes .../img/sitemap-last.png | Bin 0 -> 97 bytes .../hotel-reservation-theme/sass/sitemap.scss | 66 ++++++++++++++++++ themes/hotel-reservation-theme/sitemap.tpl | 5 -- 8 files changed, 156 insertions(+), 25 deletions(-) create mode 100644 themes/hotel-reservation-theme/css/sitemap.css create mode 100644 themes/hotel-reservation-theme/img/sitemap-horizontal.png create mode 100644 themes/hotel-reservation-theme/img/sitemap-last.png create mode 100644 themes/hotel-reservation-theme/sass/sitemap.scss diff --git a/controllers/front/SitemapController.php b/controllers/front/SitemapController.php index 8621c27af..8fb39deff 100644 --- a/controllers/front/SitemapController.php +++ b/controllers/front/SitemapController.php @@ -45,6 +45,7 @@ class SitemapControllerCore extends FrontController $categoriesTree = Category::getRootCategory()->recurseLiteCategTree(0); $this->addRoomTypes($categoriesTree); + $categoriesTree['children'] = $this->getHotelNodes($categoriesTree); $this->context->smarty->assign('categoriesTree', $categoriesTree); $this->context->smarty->assign('categoriescmsTree', CMSCategory::getRecurseCategory($this->context->language->id, 1, 1, 1)); $this->context->smarty->assign('voucherAllowed', (int)CartRule::isFeatureActive()); @@ -98,4 +99,18 @@ class SitemapControllerCore extends FrontController $this->addRoomTypes($child); } } + protected function getHotelNodes($node) + { + $hotels = array(); + if (isset($node['room_types'])) { + $node['children'] = array(); + $hotels[] = $node; + } else { + foreach ($node['children'] as $child) { + $hotels = array_merge($hotels, $this->getHotelNodes($child)); + } + } + + return $hotels; + } } diff --git a/modules/qlogsitemap/classes/QgsHelper.php b/modules/qlogsitemap/classes/QgsHelper.php index 8150f068c..3c131074b 100644 --- a/modules/qlogsitemap/classes/QgsHelper.php +++ b/modules/qlogsitemap/classes/QgsHelper.php @@ -75,6 +75,13 @@ class QgsHelper return $pages; } + public static function getMetaIdByPage($page) + { + return (int) Db::getInstance()->getValue( + 'SELECT `id_meta` FROM `'._DB_PREFIX_.'meta` WHERE `page` = \''.pSQL($page).'\'' + ); + } + protected static function getProductGroupJoin() { if (!Group::isFeatureActive() || !Configuration::get('PS_UNIDENTIFIED_GROUP')) { diff --git a/modules/qlogsitemap/qlogsitemap.php b/modules/qlogsitemap/qlogsitemap.php index 1d7af83df..2f93b9de7 100644 --- a/modules/qlogsitemap/qlogsitemap.php +++ b/modules/qlogsitemap/qlogsitemap.php @@ -42,22 +42,12 @@ class Qlogsitemap extends Module 'our-properties' => 'meta', ); - /** - * Front pages listed after the CMS pages (page name => URL type). - * - * @var array - */ protected $pagesAfter = array( 'contact' => 'contact', 'authentication' => 'login', 'sitemap' => 'sitemapPage', ); - /** - * Fixed priority of each URL type. - * - * @var array - */ protected $priorities = array( 'home' => 1.0, 'meta' => 0.8, @@ -71,22 +61,12 @@ class Qlogsitemap extends Module 'sitemapPage' => 0.2, ); - /** - * Cron expression of each automatic generation option (never disables the task). - * - * @var array - */ protected $cronOptions = array( 'weekly' => '0 0 * * 0', 'monthly' => '0 0 1 * *', 'yearly' => '0 0 1 1 *', ); - /** - * Writer state while a sitemap is generated. - * - * @var resource|null - */ protected $fileHandle = null; protected $fileUrlCount = 0; protected $fileIndex = 0; @@ -405,6 +385,7 @@ class Qlogsitemap extends Module } QgsHelper::deleteSitemapFiles(); + $this->sitemapPageMeta(); $disabledPages = QgsHelper::getDisabledPages(); foreach (Language::getLanguages(true, (int) $this->context->shop->id) as $lang) { @@ -434,6 +415,30 @@ class Qlogsitemap extends Module return $result; } + protected function sitemapPageMeta() + { + $idMeta = QgsHelper::getMetaIdByPage('sitemap'); + $objMeta = new Meta($idMeta ?: null); + if (!$idMeta) { + $objMeta->page = 'sitemap'; + $objMeta->configurable = 1; + } + + $missing = false; + foreach (Language::getLanguages(false) as $lang) { + $idLang = (int) $lang['id_lang']; + if ($idMeta && Meta::getMetaByPage('sitemap', $idLang)) { + continue; + } + $objMeta->title[$idLang] = $this->l('Sitemap'); + $objMeta->description[$idLang] = $this->l('Lost? Find what you are looking for'); + $objMeta->keywords[$idLang] = ''; + $objMeta->url_rewrite[$idLang] = 'sitemap'; + $missing = true; + } + + return $missing ? (bool) $objMeta->save() : true; + } protected function startSitemapSet($iso) { diff --git a/themes/hotel-reservation-theme/css/sitemap.css b/themes/hotel-reservation-theme/css/sitemap.css new file mode 100644 index 000000000..56a530856 --- /dev/null +++ b/themes/hotel-reservation-theme/css/sitemap.css @@ -0,0 +1,43 @@ +/****************************************************************** + Sitemap Page Styles +*******************************************************************/ +#sitemap .sitemap_block .page-subheading { + margin-bottom: 16px; } +#sitemap .sitemap_block li { + line-height: 16px; + padding-bottom: 11px; } + #sitemap .sitemap_block li a:before { + content: "\f105"; + display: inline-block; + font-family: "FontAwesome"; + padding-right: 10px; } + #sitemap .sitemap_block li a:hover { + font-weight: bold; } + +#listpage_content div.tree_top { + padding: 5px 0 0 27px; } + #listpage_content div.tree_top a:before { + content: "\f015"; + display: inline-block; + font-family: "FontAwesome"; + font-size: 20px; + color: #333; } + #listpage_content div.tree_top a:hover:before { + color: #515151; } + +ul.tree { + padding-left: 24px; } + ul.tree li { + margin: 0 0 0 21px; + padding: 5px 0 0 33px; + border-left: 1px solid #d6d4d4; + background: url(../img/sitemap-horizontal.png) no-repeat left 15px transparent; } + ul.tree li a:hover { + font-weight: bold; } + ul.tree > li { + margin: 0 0 0 11px; } + ul.tree li.last { + border: medium none; + background: url(../img/sitemap-last.png) no-repeat 0px -4px transparent; } + +/*# sourceMappingURL=sitemap.css.map */ diff --git a/themes/hotel-reservation-theme/img/sitemap-horizontal.png b/themes/hotel-reservation-theme/img/sitemap-horizontal.png new file mode 100644 index 0000000000000000000000000000000000000000..231e716f01a3a476332a1d592035f4122528e36a GIT binary patch literal 71 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W@!2~1&KS&k li { + margin: 0 0 0 11px; + } + li.last { + border: medium none; + background: url(../img/sitemap-last.png) no-repeat 0px -4px transparent; + } +} \ No newline at end of file diff --git a/themes/hotel-reservation-theme/sitemap.tpl b/themes/hotel-reservation-theme/sitemap.tpl index 862b93590..d404dd5d4 100644 --- a/themes/hotel-reservation-theme/sitemap.tpl +++ b/themes/hotel-reservation-theme/sitemap.tpl @@ -148,11 +148,6 @@

    {l s='Pages'}

      -
    • - - {$categoriescmsTree.name|escape:'html':'UTF-8'} - -
    • {if isset($categoriescmsTree.children)} {foreach $categoriescmsTree.children as $child} {if (isset($child.children) && $child.children|@count > 0) || $child.cms|@count > 0} From 150a5a40ca16a08f819869fa24ffb2a07a151015 Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Wed, 14 Oct 2026 17:39:06 +0530 Subject: [PATCH 68/90] Fixed: new thread created when name, phone, title or email differs --- controllers/front/ContactController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/controllers/front/ContactController.php b/controllers/front/ContactController.php index 4faa76dea..35399f6d5 100644 --- a/controllers/front/ContactController.php +++ b/controllers/front/ContactController.php @@ -101,6 +101,9 @@ class ContactControllerCore extends FrontController $id_order, $id_contact, ' AND a.`status` !='. CustomerThread::QLO_CUSTOMER_THREAD_STATUS_CLOSED + .' AND a.`user_name` = \''.pSQL($userName).'\'' + .' AND a.`phone` = \''.pSQL($phone).'\'' + .' AND a.`subject` = \''.pSQL($subject).'\'' ); } From 18a90cc4a454266fd58e5675817d8f040d7c6727 Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Thu, 15 Oct 2026 10:44:50 +0530 Subject: [PATCH 69/90] sitemaphtml page creation updated --- modules/qlogsitemap/qlogsitemap.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/qlogsitemap/qlogsitemap.php b/modules/qlogsitemap/qlogsitemap.php index 2f93b9de7..b0a4780e2 100644 --- a/modules/qlogsitemap/qlogsitemap.php +++ b/modules/qlogsitemap/qlogsitemap.php @@ -92,9 +92,14 @@ class Qlogsitemap extends Module public function install() { - return parent::install() - && $this->registerHook('displayAdminMetaOptions') - && $this->registerHook('registerCronTasks'); + if (!parent::install() + || !$this->registerHook('displayAdminMetaOptions') + || !$this->registerHook('registerCronTasks') + ) { + return false; + } + $this->sitemapPageMeta(); + return true; } public function uninstall() @@ -385,7 +390,6 @@ class Qlogsitemap extends Module } QgsHelper::deleteSitemapFiles(); - $this->sitemapPageMeta(); $disabledPages = QgsHelper::getDisabledPages(); foreach (Language::getLanguages(true, (int) $this->context->shop->id) as $lang) { From 6c192e4faf82a3c000e97064b42f7ac741d9f039 Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Thu, 15 Oct 2026 12:12:56 +0530 Subject: [PATCH 70/90] text changes --- .../default/template/controllers/cart_rules/conditions.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin-dev/themes/default/template/controllers/cart_rules/conditions.tpl b/admin-dev/themes/default/template/controllers/cart_rules/conditions.tpl index b4d80f043..dd2e4f3bc 100644 --- a/admin-dev/themes/default/template/controllers/cart_rules/conditions.tpl +++ b/admin-dev/themes/default/template/controllers/cart_rules/conditions.tpl @@ -223,7 +223,7 @@

      From 2c54a1ea4e195dec9b6725bdf3bd0131c12c7b0d Mon Sep 17 00:00:00 2001 From: "abhishek.qlo" Date: Thu, 15 Oct 2026 12:49:55 +0530 Subject: [PATCH 71/90] Updated the version and the code for the warnings and error messages --- modules/qlogooglehotelconnector/CHANGELOG.txt | 2 +- modules/qlogooglehotelconnector/README.md | 4 +- .../classes/QghcPropertyService.php | 14 ++++-- .../AdminGoogleHotelConfigController.php | 28 +++++++++++ .../qlogooglehotelconnector.php | 28 ++++++++--- .../views/css/admin/qlo_ghc_admin.css | 3 ++ .../views/templates/admin/config.tpl | 49 +++++++++++++++++-- .../templates/hook/dashboard_notification.tpl | 18 +++---- .../templates/hook/dashboard_top_warning.tpl | 48 ++++++++++++------ .../templates/hook/hotel_form_top_warning.tpl | 23 ++++----- .../templates/hook/hotel_list_warning.tpl | 45 ++++++++++++----- 11 files changed, 192 insertions(+), 70 deletions(-) diff --git a/modules/qlogooglehotelconnector/CHANGELOG.txt b/modules/qlogooglehotelconnector/CHANGELOG.txt index 00f06a35e..775e6979a 100644 --- a/modules/qlogooglehotelconnector/CHANGELOG.txt +++ b/modules/qlogooglehotelconnector/CHANGELOG.txt @@ -1,3 +1,3 @@ --------------------------------------------------------------- -# V1.0.0 | COMPATIBLE:: QloApps V1.8.x +# V4.0.0 | COMPATIBLE:: QloApps V1.8.x --------------------------------------------------------------- diff --git a/modules/qlogooglehotelconnector/README.md b/modules/qlogooglehotelconnector/README.md index 20c773511..107f1dce8 100644 --- a/modules/qlogooglehotelconnector/README.md +++ b/modules/qlogooglehotelconnector/README.md @@ -19,9 +19,9 @@ https://qloapps.com/addons/ ### Module Versions and Compatibility: -- **Current version:** `1.0.0` +- **Current version:** `4.0.0` -- Module version `1.0.0` compatible with QloApps version `1.8.x` +- Module version `4.0.0` compatible with QloApps version `1.8.x` ### Refund Policy: diff --git a/modules/qlogooglehotelconnector/classes/QghcPropertyService.php b/modules/qlogooglehotelconnector/classes/QghcPropertyService.php index fb160a2c0..9ac9e8d88 100644 --- a/modules/qlogooglehotelconnector/classes/QghcPropertyService.php +++ b/modules/qlogooglehotelconnector/classes/QghcPropertyService.php @@ -175,18 +175,26 @@ class QghcPropertyService if ($property) { if ((int) $property->google_status === QghcProperty::GOOGLE_STATUS_FAILED) { return array($property->failure_reason - ? self::l('Google Hotel: Google could not verify this hotel — ') . $property->failure_reason - : self::l('Google Hotel: Google reported an issue connecting this hotel. Please contact support.')); + ? self::l('Google could not verify this hotel — ') . $property->failure_reason + : self::l('Google reported an issue connecting this hotel. Please contact support.')); } return array(); } $errors = self::validateRequiredFields($idHotel, $idLang); if ($errors) { + // Shown as a list under a "Need to fix" heading, so the "Google Hotel: " prefix is redundant. + $prefix = self::l('Google Hotel: '); + foreach ($errors as $key => $error) { + if (strpos($error, $prefix) === 0) { + $errors[$key] = Tools::substr($error, Tools::strlen($prefix)); + } + } + return $errors; } - return array(self::l('Google Hotel: This hotel is not yet enabled for Google Hotel.')); + return array(self::l('This hotel is not yet enabled for Google Hotel.')); } /** diff --git a/modules/qlogooglehotelconnector/controllers/admin/AdminGoogleHotelConfigController.php b/modules/qlogooglehotelconnector/controllers/admin/AdminGoogleHotelConfigController.php index e5cd5c16a..8cc052e85 100644 --- a/modules/qlogooglehotelconnector/controllers/admin/AdminGoogleHotelConfigController.php +++ b/modules/qlogooglehotelconnector/controllers/admin/AdminGoogleHotelConfigController.php @@ -74,6 +74,22 @@ class AdminGoogleHotelConfigController extends ModuleAdminController } } + /** True when the current admin request came over HTTPS (directly or via a TLS-terminating proxy). */ + protected function isSecureRequest() + { + if (Tools::usingSecureMode()) { + return true; + } + + if (empty($_SERVER['HTTP_X_FORWARDED_PROTO'])) { + return false; + } + + $protos = explode(',', $_SERVER['HTTP_X_FORWARDED_PROTO']); + + return strtolower(trim($protos[0])) === 'https'; + } + /** Renders the configuration page into the admin layout. */ public function initContent() { @@ -129,6 +145,8 @@ class AdminGoogleHotelConfigController extends ModuleAdminController 'configs' => $configs, 'ws_key' => $wsKey, 'is_connected' => $isConnected, + 'is_secure' => $this->isSecureRequest(), + 'ssl_settings_url' => $this->context->link->getAdminLink('AdminPreferences'), 'action_url' => $this->context->link->getAdminLink('AdminGoogleHotelConfig'), 'cron_url' => $cronUrl, 'hotel_list_url' => $hotelEditBase, @@ -143,6 +161,11 @@ class AdminGoogleHotelConfigController extends ModuleAdminController return; } + if (!$this->isSecureRequest()) { + $this->errors[] = $this->l('Connection cannot be created from an unsecure (HTTP) server. Please use HTTPS.'); + return; + } + $wsKey = trim(Tools::getValue(QloGoogleHotelConnector::CONFIG_WS_KEY)); $pmsUrl = Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__; @@ -219,6 +242,11 @@ class AdminGoogleHotelConfigController extends ModuleAdminController return; } + if (!$this->isSecureRequest()) { + $this->errors[] = $this->l('The webservice key cannot be regenerated from an unsecure (HTTP) server. Please use HTTPS.'); + return; + } + $newKey = QghcWebserviceSetup::regenerateKey(); if (!$newKey) { $this->errors[] = $this->l('Failed to regenerate the webservice key.'); diff --git a/modules/qlogooglehotelconnector/qlogooglehotelconnector.php b/modules/qlogooglehotelconnector/qlogooglehotelconnector.php index ceb554e58..30fb1b909 100644 --- a/modules/qlogooglehotelconnector/qlogooglehotelconnector.php +++ b/modules/qlogooglehotelconnector/qlogooglehotelconnector.php @@ -42,7 +42,7 @@ class QloGoogleHotelConnector extends Module { $this->name = 'qlogooglehotelconnector'; $this->tab = 'administration'; - $this->version = '1.0.0'; + $this->version = '4.0.0'; $this->author = 'Webkul'; $this->need_instance = 0; $this->bootstrap = true; @@ -387,10 +387,18 @@ class QloGoogleHotelConnector extends Module { $idLang = (int) $this->context->language->id; + $hotelEditBase = $this->context->link->getAdminLink('AdminAddHotel'); + $hotels = array(); + foreach (QghcPropertyService::getHotelsWithIssues($idLang) as $idHotel => $hotelName) { + $hotels[] = array( + 'name' => $hotelName, + 'url' => $hotelEditBase . '&id=' . (int) $idHotel . '&updatehtl_branch_info', + ); + } + $this->context->smarty->assign(array( 'is_connected' => (int) Configuration::get(self::CONFIG_STATUS) === QghcProperty::GOOGLE_STATUS_CONNECTED, - 'hotel_names' => array_values(QghcPropertyService::getHotelsWithIssues($idLang)), - 'hotel_list_url' => $this->context->link->getAdminLink('AdminAddHotel'), + 'hotels' => $hotels, 'config_url' => $this->context->link->getAdminLink('AdminGoogleHotelConfig'), )); @@ -402,16 +410,22 @@ class QloGoogleHotelConnector extends Module { $idLang = (int) $this->context->language->id; $isConnected = (int) Configuration::get(self::CONFIG_STATUS) === QghcProperty::GOOGLE_STATUS_CONNECTED; - $hotelNames = array_values(QghcPropertyService::getHotelsWithIssues($idLang)); + $editBaseUrl = $this->context->link->getAdminLink('AdminAddHotel'); + $hotels = array(); + foreach (QghcPropertyService::getHotelsWithIssues($idLang) as $idHotel => $hotelName) { + $hotels[] = array( + 'hotel_name' => $hotelName, + 'edit_url' => $editBaseUrl . '&id=' . (int) $idHotel . '&updatehtl_branch_info', + ); + } - if ($isConnected && !$hotelNames) { + if ($isConnected && !$hotels) { return ''; } $this->context->smarty->assign(array( 'is_connected' => $isConnected, - 'hotel_names' => $hotelNames, - 'hotel_list_url' => $this->context->link->getAdminLink('AdminAddHotel'), + 'hotels_with_issues' => $hotels, 'config_url' => $this->context->link->getAdminLink('AdminGoogleHotelConfig'), )); diff --git a/modules/qlogooglehotelconnector/views/css/admin/qlo_ghc_admin.css b/modules/qlogooglehotelconnector/views/css/admin/qlo_ghc_admin.css index 6264f8f88..6f7763d8c 100644 --- a/modules/qlogooglehotelconnector/views/css/admin/qlo_ghc_admin.css +++ b/modules/qlogooglehotelconnector/views/css/admin/qlo_ghc_admin.css @@ -110,6 +110,9 @@ table.qghc_api_log th.actions .pull-right { .qlo-ghc-col-padded { padding-top: 6px; } .qlo-ghc-status-label { font-size: 12px; padding: 5px 10px; } .qlo-ghc-missing-list { margin: 8px 0 0 0; padding-left: 20px; } +.qlo-ghc-warning-title { margin-top: 6px; } +.qlo-ghc-warning-title:first-child { margin-top: 0; } +.qlo-ghc-warning-title + .qlo-ghc-missing-list { margin-top: 2px; } .qlo-ghc-switch-disabled { opacity: 0.5; cursor: not-allowed; } /* Double class to out-specify core's ".bootstrap p { margin: ... }" without !important. */ .qlo-ghc-helpblock-top.qlo-ghc-helpblock-top { margin-top: 10px; } diff --git a/modules/qlogooglehotelconnector/views/templates/admin/config.tpl b/modules/qlogooglehotelconnector/views/templates/admin/config.tpl index 68816666c..3b52dda84 100644 --- a/modules/qlogooglehotelconnector/views/templates/admin/config.tpl +++ b/modules/qlogooglehotelconnector/views/templates/admin/config.tpl @@ -20,6 +20,14 @@ * @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 *} +{if !$is_secure} +
      + {l s='Unsecure server detected.' mod='qlogooglehotelconnector'} + {l s='Your store is not running on a secure (HTTPS) server, so the connection with Google Hotel cannot be created or updated.' mod='qlogooglehotelconnector'} + {l s='Please enable HTTPS to continue.' mod='qlogooglehotelconnector'} +
      +{/if} + {* ── Google Hotel Setup ───────────────────────────────────────────────── *}
      @@ -51,9 +59,10 @@ {l s='Important:' mod='qlogooglehotelconnector'} {l s='This key was automatically generated for the Google Hotel connection. Please do not change the permissions of this webservice key.' mod='qlogooglehotelconnector'} {if !$is_connected} -

      - {l s='To complete the setup, click' mod='qlogooglehotelconnector'} - {l s='Create Connection' mod='qlogooglehotelconnector'}. +
      + {l s='To complete the setup, click' mod='qlogooglehotelconnector'} + {l s='Create Connection' mod='qlogooglehotelconnector'}. +
      {/if}
      @@ -70,7 +79,7 @@ placeholder="{l s='Enter your webservice key' mod='qlogooglehotelconnector'}" /> {if $ws_key}

      - @@ -112,7 +121,7 @@ {else} {/if} -

      +{if !$is_secure} + +{/if} + {* ── Cron job setting ─────────────────────────────────────────────────── *}
      diff --git a/modules/qlogooglehotelconnector/views/templates/hook/dashboard_notification.tpl b/modules/qlogooglehotelconnector/views/templates/hook/dashboard_notification.tpl index 8606796ea..70e62bf3f 100644 --- a/modules/qlogooglehotelconnector/views/templates/hook/dashboard_notification.tpl +++ b/modules/qlogooglehotelconnector/views/templates/hook/dashboard_notification.tpl @@ -22,16 +22,16 @@

      - + {l s='Google Hotel Connector' mod='qlogooglehotelconnector'}

      {if !$is_connected}

      - {l s='Not connected to the Google Hotel Center.' mod='qlogooglehotelconnector'} -  {l s='Fix in Google Hotel Setup' mod='qlogooglehotelconnector'} + {l s='Connect to Google Hotel to get more commission-free direct bookings.' mod='qlogooglehotelconnector'} +  {l s='Connect in Google Hotel Setup' mod='qlogooglehotelconnector'}

      - {elseif !empty($hotel_names)} + {elseif !empty($hotels)}

      {l s='Connected to the Google Hotel Center, but some hotels are not listed.' mod='qlogooglehotelconnector'}

      @@ -41,22 +41,18 @@

      {/if} - {if !empty($hotel_names)} + {if !empty($hotels)}

      {l s='Hotels with an issue:' mod='qlogooglehotelconnector'} -  {l s='Urgent Action Needed' mod='qlogooglehotelconnector'}

      -

      - {l s='View Hotel List' mod='qlogooglehotelconnector'} -

      {/if} diff --git a/modules/qlogooglehotelconnector/views/templates/hook/dashboard_top_warning.tpl b/modules/qlogooglehotelconnector/views/templates/hook/dashboard_top_warning.tpl index 9837f502b..1e07f972f 100644 --- a/modules/qlogooglehotelconnector/views/templates/hook/dashboard_top_warning.tpl +++ b/modules/qlogooglehotelconnector/views/templates/hook/dashboard_top_warning.tpl @@ -21,24 +21,42 @@ *}
      - {if !$is_connected} - - {/if} +
      + + {if !$is_connected} + {l s='Connect to Google Hotel to get more commission-free direct bookings.' mod='qlogooglehotelconnector'} +  {l s='Connect in Google Hotel Setup' mod='qlogooglehotelconnector'} + {/if} - {if !empty($hotel_names)} -
      - {l s='The following hotels are not listed on Google Hotel:' mod='qlogooglehotelconnector'} + {if !empty($hotels_with_issues)} +
      {l s='The following hotels are not listed on Google Hotel:' mod='qlogooglehotelconnector'}
      - {l s='View Hotel List' mod='qlogooglehotelconnector'} -
      - {/if} + {/if} +
      + diff --git a/modules/qlogooglehotelconnector/views/templates/hook/hotel_form_top_warning.tpl b/modules/qlogooglehotelconnector/views/templates/hook/hotel_form_top_warning.tpl index 8fdb2b71e..fca379cce 100644 --- a/modules/qlogooglehotelconnector/views/templates/hook/hotel_form_top_warning.tpl +++ b/modules/qlogooglehotelconnector/views/templates/hook/hotel_form_top_warning.tpl @@ -20,22 +20,19 @@ * @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 *}
      - {if !$is_connected} -
      - {l s='Not connected to the Google Hotel Center.' mod='qlogooglehotelconnector'} - {l s='Hotels cannot sync with Google Hotel Ads until this is fixed.' mod='qlogooglehotelconnector'} -  {l s='Fix in Google Hotel Setup' mod='qlogooglehotelconnector'} -
      - {/if} +
      + {if !$is_connected} + {l s='Connect to Google Hotel to get more commission-free direct bookings.' mod='qlogooglehotelconnector'} +  {l s='Connect in Google Hotel Setup' mod='qlogooglehotelconnector'} + {/if} - {if !empty($issue_reasons)} -
      - {l s='This hotel is not listed on Google Hotel:' mod='qlogooglehotelconnector'} + {if !empty($issue_reasons)} +
      {l s='Need to fix the below mentioned issues:' mod='qlogooglehotelconnector'}
        {foreach from=$issue_reasons item=reason} -
      • {$reason|escape:'html':'UTF-8'} {l s='Use the Google Hotel tab below to enable it.' mod='qlogooglehotelconnector'}
      • +
      • {$reason|escape:'html':'UTF-8'}
      • {/foreach}
      -
      - {/if} + {/if} +
      diff --git a/modules/qlogooglehotelconnector/views/templates/hook/hotel_list_warning.tpl b/modules/qlogooglehotelconnector/views/templates/hook/hotel_list_warning.tpl index 28aed7f98..2fb0bfae1 100644 --- a/modules/qlogooglehotelconnector/views/templates/hook/hotel_list_warning.tpl +++ b/modules/qlogooglehotelconnector/views/templates/hook/hotel_list_warning.tpl @@ -19,21 +19,40 @@ * @copyright Since 2010 Webkul * @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 *} -{if !$is_connected} -
      - {l s='Not connected to the Google Hotel Center.' mod='qlogooglehotelconnector'} - {l s='Hotels cannot sync with Google Hotel Ads until this is fixed.' mod='qlogooglehotelconnector'} -  {l s='Fix in Google Hotel Setup' mod='qlogooglehotelconnector'} -
      -{/if} +
      + + {if !$is_connected} + {l s='Connect to Google Hotel to get more commission-free direct bookings.' mod='qlogooglehotelconnector'} +  {l s='Connect in Google Hotel Setup' mod='qlogooglehotelconnector'} + {/if} -{if !empty($hotels_with_issues)} -
      - {l s='The following hotels are not listed on Google Hotel:' mod='qlogooglehotelconnector'} + {if !empty($hotels_with_issues)} +
      {l s='The following hotels are not listed on Google Hotel:' mod='qlogooglehotelconnector'}
      -
      -{/if} + {/if} +
      + From 91189094f7d42983c4f8a24d2b9f38cd6e1e7cfa Mon Sep 17 00:00:00 2001 From: amit sharma Date: Thu, 15 Oct 2026 13:34:01 +0530 Subject: [PATCH 72/90] Fixed: review changes --- .../classes/HotelBookingDetail.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index 7ce514bda..dd5c68a76 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -766,7 +766,7 @@ class HotelBookingDetail extends ObjectModel $excludeRoomId = array(); $excludeRoomId['checked_out'] = 'SELECT `id_room` FROM `'._DB_PREFIX_.'htl_booking_detail` - WHERE `id_hotel` = '.(int)$idHotel.' AND `is_back_order` = 0 AND `id` NOT IN ('.OrderReturn::getRefundedBookingIdsSubquery().') AND `id_status` NOT IN ('.self::STATUS_CANCELLED.', '.self::STATUS_NO_SHOW.') AND IF(`id_status` = '. self::STATUS_CHECKED_OUT.', + WHERE `id_hotel` = '.(int)$idHotel.' AND `is_back_order` = 0 AND `id` NOT IN ('.OrderReturn::getRefundedBookingIdsSubquery().') AND `id_status` NOT IN ('.HotelBookingDetail::STATUS_CANCELLED.', '.HotelBookingDetail::STATUS_NO_SHOW.') AND IF(`id_status` = '. HotelBookingDetail::STATUS_CHECKED_OUT.', IF('.(int) $hourlyBooking.', 1, (DATE_FORMAT(`check_out`, "%Y-%m-%d") != DATE_FORMAT(\''.pSQL($dateFrom).'\', "%Y-%m-%d")) AND (`check_out` > \''.pSQL($dateFrom).'\' AND `check_out` <= \''.PSQL($dateTo).'\')) AND ( (`date_from` <= \''.pSQL($dateFrom).'\' AND `check_out` > \''.pSQL($dateFrom).'\' AND `check_out` <= \''.PSQL($dateTo).'\') OR (`date_from` >= \''.pSQL($dateFrom).'\' AND `check_out` > \''.pSQL($dateFrom).'\' AND `check_out` <= \''.pSQL($dateTo).'\') OR @@ -1096,7 +1096,7 @@ class HotelBookingDetail extends ObjectModel FROM `'._DB_PREFIX_.'htl_booking_detail` AS bd INNER JOIN `'._DB_PREFIX_.'htl_room_information` AS rf ON (rf.`id` = bd.`id_room`) INNER JOIN `'._DB_PREFIX_.'htl_room_type` AS hrt ON (hrt.`id_product` = rf.`id_product`) - WHERE bd.`id_hotel`='.(int)$idHotel.' AND rf.`id_status` != '. HotelRoomInformation::STATUS_INACTIVE .' AND bd.`is_back_order` = 0 AND bd.`id` NOT IN ('.OrderReturn::getRefundedBookingIdsSubquery().') AND bd.`id_status` NOT IN ('.self::STATUS_CANCELLED.', '.self::STATUS_NO_SHOW.') AND IF(bd.`id_status` = '. self::STATUS_CHECKED_OUT .', IF('.(int) $hourlyBooking.', 1, (DATE_FORMAT(`check_out`, "%Y-%m-%d") != DATE_FORMAT(\''.pSQL($dateFrom).'\', "%Y-%m-%d")) AND (`check_out` > \''.pSQL($dateFrom).'\' AND `check_out` <= \''.PSQL($dateTo).'\')) AND ( + WHERE bd.`id_hotel`='.(int)$idHotel.' AND rf.`id_status` != '. HotelRoomInformation::STATUS_INACTIVE .' AND bd.`is_back_order` = 0 AND bd.`id` NOT IN ('.OrderReturn::getRefundedBookingIdsSubquery().') AND bd.`id_status` NOT IN ('.HotelBookingDetail::STATUS_CANCELLED.', '.HotelBookingDetail::STATUS_NO_SHOW.') AND IF(bd.`id_status` = '. HotelBookingDetail::STATUS_CHECKED_OUT .', IF('.(int) $hourlyBooking.', 1, (DATE_FORMAT(`check_out`, "%Y-%m-%d") != DATE_FORMAT(\''.pSQL($dateFrom).'\', "%Y-%m-%d")) AND (`check_out` > \''.pSQL($dateFrom).'\' AND `check_out` <= \''.PSQL($dateTo).'\')) AND ( (bd.`date_from` <= \''.pSQL($dateFrom).'\' AND bd.`check_out` > \''.pSQL($dateFrom).'\' AND bd.`check_out` < \''.pSQL($dateTo).'\') OR (bd.`date_from` > \''.pSQL($dateFrom).'\' AND bd.`date_from` < \''.pSQL($dateTo).'\' AND bd.`check_out` >= \''.pSQL($dateTo).'\') OR (bd.`date_from` > \''.pSQL($dateFrom).'\' AND bd.`date_from` < \''.pSQL($dateTo).'\' AND bd.`check_out` > \''.pSQL($dateFrom).'\' AND bd.`check_out` < \''.pSQL($dateTo).'\') @@ -1429,7 +1429,7 @@ class HotelBookingDetail extends ObjectModel $selectBookedRoomSearch = 'SELECT `id`, `id_order`, `id_product`, `id_room`, `id_hotel`, `id_customer`, `booking_type`, `id_status` AS booking_status, `comment`, `room_num`, `date_from`, IF(`id_status` = '. self::STATUS_CHECKED_OUT.', `check_out`,`date_to`) AS `date_to`, `check_in`, `check_out`, `date_to` AS `booking_date_to`'; $joinBookedRoomSearch = ''; - $whereBookedRoomSearch = 'WHERE `id_hotel` = '.(int)$idHotel.' AND `is_back_order` = 0 AND `id` NOT IN ('.OrderReturn::getRefundedBookingIdsSubquery().') AND `id_status` NOT IN ('.self::STATUS_CANCELLED.', '.self::STATUS_NO_SHOW.') AND IF(`id_status` = '. self::STATUS_CHECKED_OUT.', ( + $whereBookedRoomSearch = 'WHERE `id_hotel` = '.(int)$idHotel.' AND `is_back_order` = 0 AND `id` NOT IN ('.OrderReturn::getRefundedBookingIdsSubquery().') AND `id_status` NOT IN ('.HotelBookingDetail::STATUS_CANCELLED.', '.HotelBookingDetail::STATUS_NO_SHOW.') AND IF(`id_status` = '. HotelBookingDetail::STATUS_CHECKED_OUT.', ( (`date_from` <= \''.pSQL($dateFrom).'\' AND `check_out` > \''.pSQL($dateFrom).'\' AND `check_out` <= \''.PSQL($dateTo).'\') OR (`date_from` >= \''.pSQL($dateFrom).'\' AND `check_out` > \''.pSQL($dateFrom).'\' AND `check_out` <= \''.pSQL($dateTo).'\') OR (`date_from` >= \''.pSQL($dateFrom).'\' AND `date_from` < \''.pSQL($dateTo).'\' AND `check_out` >= \''.pSQL($dateTo).'\') OR @@ -1502,7 +1502,7 @@ class HotelBookingDetail extends ObjectModel $sql = 'SELECT `id`, `id_product`, `id_order`, `id_cart`, `id_room`, `id_hotel`, `id_customer`, `check_out`, `check_in`, `id_status` FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `id_room` = '.(int)$id_room. - ' AND `is_back_order` = 0 AND `id` NOT IN ('.OrderReturn::getRefundedBookingIdsSubquery().') AND `id_status` NOT IN ('.self::STATUS_CANCELLED.', '.self::STATUS_NO_SHOW.') AND ((date_from <= \''.pSQL($date_from).'\' AND date_to > \''. + ' AND `is_back_order` = 0 AND `id` NOT IN ('.OrderReturn::getRefundedBookingIdsSubquery().') AND `id_status` NOT IN ('.HotelBookingDetail::STATUS_CANCELLED.', '.HotelBookingDetail::STATUS_NO_SHOW.') AND ((date_from <= \''.pSQL($date_from).'\' AND date_to > \''. pSQL($date_from).'\' AND date_to <= \''.pSQL($date_to).'\') OR (date_from > \''.pSQL($date_from). '\' AND date_to < \''.pSQL($date_to).'\') OR (date_from >= \''.pSQL($date_from).'\' AND date_from < \''. pSQL($date_to).'\' AND date_to >= \''.pSQL($date_to).'\') OR (date_from < \''.pSQL($date_from). @@ -1968,7 +1968,7 @@ class HotelBookingDetail extends ObjectModel FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `id_hotel` = '.(int)$hotel_id.' AND `id_product` = '.(int)$id_room_type.' AND `date_from` = \''.pSQL($date_from).'\' AND `date_to` = \''.pSQL($date_to).'\' - AND `id_room`!='.(int)$id_room.' AND `id` NOT IN ('.OrderReturn::getRefundedBookingIdsSubquery().') AND `id_status` NOT IN ('.self::STATUS_CANCELLED.', '.self::STATUS_NO_SHOW.') AND `is_back_order` = 0'; + AND `id_room`!='.(int)$id_room.' AND `id` NOT IN ('.OrderReturn::getRefundedBookingIdsSubquery().') AND `id_status` NOT IN ('.HotelBookingDetail::STATUS_CANCELLED.', '.HotelBookingDetail::STATUS_NO_SHOW.') AND `is_back_order` = 0'; return Db::getInstance()->executeS($sql); } @@ -2733,7 +2733,7 @@ class HotelBookingDetail extends ObjectModel `date_to` != \''.pSQL($old_date_to).'\' AND `date_to` > \''.pSQL($new_date_from).'\', `check_out` != \''.pSQL($old_date_to).'\' AND `check_out` > \''.pSQL($new_date_from).'\' ) - AND `id` NOT IN ('.OrderReturn::getRefundedBookingIdsSubquery().') AND `id_status` NOT IN ('.self::STATUS_CANCELLED.', '.self::STATUS_NO_SHOW.') AND `is_back_order`=0'; + AND `id` NOT IN ('.OrderReturn::getRefundedBookingIdsSubquery().') AND `id_status` NOT IN ('.HotelBookingDetail::STATUS_CANCELLED.', '.HotelBookingDetail::STATUS_NO_SHOW.') AND `is_back_order`=0'; return Db::getInstance()->executeS($sql); } From 00146eef9bb0e0ca5a222e105281e66461dc785f Mon Sep 17 00:00:00 2001 From: shazar rahman Date: Thu, 15 Oct 2026 13:41:11 +0530 Subject: [PATCH 73/90] Fixed: Tax labels (incl./excl.) shown in front office even when taxes are disabled Co-authored-by: Name --- modules/blockcart/blockcart.tpl | 10 ++++---- .../cart-total-block.tpl | 24 +++++++++---------- .../modules/blockcart/blockcart.tpl | 10 ++++---- .../shopping-cart-detail.tpl | 12 +++++----- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/modules/blockcart/blockcart.tpl b/modules/blockcart/blockcart.tpl index a4227cd3e..347cab3f9 100644 --- a/modules/blockcart/blockcart.tpl +++ b/modules/blockcart/blockcart.tpl @@ -273,7 +273,7 @@
      {l s='Total Rooms Cost in cart' mod='blockcart'} - {if $display_tax_label} + {if $use_taxes && $display_tax_label} {if $priceDisplay == 1} {l s='(tax excl.)' mod='blockcart'} {else} @@ -292,7 +292,7 @@
      {l s='Total Product Cost in cart' mod='blockcart'} - {if $display_tax_label} + {if $use_taxes && $display_tax_label} {if $priceDisplay == 1} {l s='(tax excl.)' mod='blockcart'} {else} @@ -331,7 +331,7 @@ {/if} --> + + Eigendommen + + + eigendommen + diff --git a/install-dev/langs/no/data/meta.xml b/install-dev/langs/no/data/meta.xml index 442acfa9e..37961d739 100644 --- a/install-dev/langs/no/data/meta.xml +++ b/install-dev/langs/no/data/meta.xml @@ -125,10 +125,10 @@ order-follow - Our Properties + Properties - our-properties + properties Order slip diff --git a/install-dev/langs/pl/data/meta.xml b/install-dev/langs/pl/data/meta.xml index 61c8f1c8c..cf6531280 100644 --- a/install-dev/langs/pl/data/meta.xml +++ b/install-dev/langs/pl/data/meta.xml @@ -125,10 +125,10 @@ sledzenie-zamowienia - Nasze nieruchomości + Nieruchomości - our-properties + nieruchomosci Pokwitowania diff --git a/install-dev/langs/pt/data/meta.xml b/install-dev/langs/pt/data/meta.xml index f46abbe2d..77805e795 100644 --- a/install-dev/langs/pt/data/meta.xml +++ b/install-dev/langs/pt/data/meta.xml @@ -125,10 +125,10 @@ acompanhar-encomenda - Nossas propriedades + Propriedades - our-properties + propriedades Nota de Encomenda diff --git a/install-dev/langs/qc/data/meta.xml b/install-dev/langs/qc/data/meta.xml index d83c56aa5..4754977ad 100644 --- a/install-dev/langs/qc/data/meta.xml +++ b/install-dev/langs/qc/data/meta.xml @@ -178,4 +178,10 @@ comparaison-produits --> + + Propriétés + + + proprietes + diff --git a/install-dev/langs/ro/data/meta.xml b/install-dev/langs/ro/data/meta.xml index 6b93eee1e..2ef3f3fd4 100644 --- a/install-dev/langs/ro/data/meta.xml +++ b/install-dev/langs/ro/data/meta.xml @@ -125,10 +125,10 @@ returnari - Proprietățile noastre + Proprietăți - our-properties + proprietati Bon de comandă diff --git a/install-dev/langs/ru/data/meta.xml b/install-dev/langs/ru/data/meta.xml index 908c81c4b..f650415ae 100644 --- a/install-dev/langs/ru/data/meta.xml +++ b/install-dev/langs/ru/data/meta.xml @@ -125,10 +125,10 @@ order-follow - Наши объекты + Объекты - our-properties + properties Бланк заказа diff --git a/install-dev/langs/si/data/meta.xml b/install-dev/langs/si/data/meta.xml index a6b3d6a23..0f90fd954 100644 --- a/install-dev/langs/si/data/meta.xml +++ b/install-dev/langs/si/data/meta.xml @@ -125,10 +125,10 @@ order-follow - Our Properties + Properties - our-properties + properties Credit slip diff --git a/install-dev/langs/sr/data/meta.xml b/install-dev/langs/sr/data/meta.xml index 7aff1d638..627c49699 100644 --- a/install-dev/langs/sr/data/meta.xml +++ b/install-dev/langs/sr/data/meta.xml @@ -119,10 +119,10 @@ my-account - Our Properties + Properties - our-properties + properties Order follow diff --git a/install-dev/langs/sv/data/meta.xml b/install-dev/langs/sv/data/meta.xml index ef818fd95..8dc2cd39d 100644 --- a/install-dev/langs/sv/data/meta.xml +++ b/install-dev/langs/sv/data/meta.xml @@ -125,10 +125,10 @@ order-follow - Our Properties + Properties - our-properties + properties Credit slip diff --git a/install-dev/langs/tw/data/meta.xml b/install-dev/langs/tw/data/meta.xml index a73b12ef7..d889dafd9 100644 --- a/install-dev/langs/tw/data/meta.xml +++ b/install-dev/langs/tw/data/meta.xml @@ -125,10 +125,10 @@ order-follow - 我們的物業 + 物業 - our-properties + properties 訂購單 diff --git a/install-dev/langs/vn/data/meta.xml b/install-dev/langs/vn/data/meta.xml index 1a84b1dc9..ba45c7365 100644 --- a/install-dev/langs/vn/data/meta.xml +++ b/install-dev/langs/vn/data/meta.xml @@ -125,10 +125,10 @@ order-follow - Các bất động sản của chúng tôi + Bất động sản - our-properties + properties Phiếu tín dụng diff --git a/install-dev/langs/zh/data/meta.xml b/install-dev/langs/zh/data/meta.xml index 2c6fe190c..f840044f0 100644 --- a/install-dev/langs/zh/data/meta.xml +++ b/install-dev/langs/zh/data/meta.xml @@ -125,10 +125,10 @@ order-follow - Our Properties + Properties - our-properties + properties Order slip diff --git a/modules/blocknavigationmenu/classes/WkCustomNavigationLink.php b/modules/blocknavigationmenu/classes/WkCustomNavigationLink.php index e4e86b593..ce34701ce 100644 --- a/modules/blocknavigationmenu/classes/WkCustomNavigationLink.php +++ b/modules/blocknavigationmenu/classes/WkCustomNavigationLink.php @@ -193,7 +193,7 @@ class WkCustomNavigationLink extends ObjectModel 'link' => 'index', ), array( - 'name' => 'Our Properties', + 'name' => 'Properties', 'id_cms' => 0, 'show_at_navigation' => 1, 'show_at_footer' => 0, diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php index 25b8279bc..c4b03fb7c 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php @@ -156,7 +156,7 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController 'class' => 'fixed-width-xxl', ), 'WK_DISPLAY_PROPERTIES_LINK_IN_HEADER' => array( - 'title' => $this->l('Display Our Properties link in Header'), + 'title' => $this->l('Display Properties link in Header'), 'cast' => 'intval', 'type' => 'bool', 'default' => '0', @@ -170,7 +170,7 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController 'value' => 0, ), ), - 'hint' => $this->l('Display Our Properties link in header in the front office'), + 'hint' => $this->l('Display Properties link in header in the front office'), ), 'WK_DISPLAY_CONTACT_PAGE_HOTEL_LIST' => array( 'title' => $this->l('Display Contact Page Hotel List'), @@ -423,7 +423,7 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController 'hint' => $this->l('If yes, only active hotels will be displayed on map.'), ), 'WK_DISPLAY_PROPERTIES_PAGE_GOOGLE_MAP' => array( - 'title' => $this->l('Display Our Properties page Google map'), + 'title' => $this->l('Display Properties page Google map'), 'cast' => 'intval', 'type' => 'bool', 'default' => '0', @@ -437,7 +437,7 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController 'value' => 0, ), ), - 'hint' => $this->l('Enable to display map with hotels locations on the our properties page.'), + 'hint' => $this->l('Enable to display map with hotels locations on the properties page.'), ), 'WK_DISPLAY_CONTACT_PAGE_GOOLGE_MAP' => array( 'title' => $this->l('Display Contact Us page Google map'), diff --git a/themes/hotel-reservation-theme/header.tpl b/themes/hotel-reservation-theme/header.tpl index af7919df6..dc7e76b6b 100644 --- a/themes/hotel-reservation-theme/header.tpl +++ b/themes/hotel-reservation-theme/header.tpl @@ -180,7 +180,7 @@ {/block} {if isset($WK_DISPLAY_PROPERTIES_LINK_IN_HEADER) && $WK_DISPLAY_PROPERTIES_LINK_IN_HEADER} {/if}
      diff --git a/themes/hotel-reservation-theme/our-properties.tpl b/themes/hotel-reservation-theme/our-properties.tpl index 720a9d8a8..4ab7714ba 100644 --- a/themes/hotel-reservation-theme/our-properties.tpl +++ b/themes/hotel-reservation-theme/our-properties.tpl @@ -21,11 +21,11 @@ *} {block name='our_properties'} -{capture name=path}{l s='Our Properties'}{/capture} +{capture name=path}{l s='Properties'}{/capture} {if isset($hotelsInfo) && $hotelsInfo} {block name='our_properties_list_title'}
      -

      {l s='Our Properties'}

      +

      {l s='Properties'}

      {$WK_HTL_SHORT_DESC|escape:'html':'UTF-8'}

      From ed1af74362df24533896781110e94c65dd702be7 Mon Sep 17 00:00:00 2001 From: amit sharma Date: Fri, 16 Oct 2026 12:56:32 +0530 Subject: [PATCH 78/90] Fixed: Improved amenities management, filtering, and room type display across the frontend Co-authored-by: Name --- .../features/helpers/form/form.tpl | 26 ++++ classes/Feature.php | 6 + classes/Product.php | 8 +- classes/Validate.php | 2 + controllers/admin/AdminFeaturesController.php | 146 +++++++++++++++++- controllers/front/CategoryController.php | 6 + controllers/front/ProductController.php | 18 +++ install-dev/data/db_structure.sql | 3 + .../classes/HotelBookingDetail.php | 28 +++- .../classes/HotelHelper.php | 76 +++++++++ .../AdminHotelGeneralSettingsController.php | 12 ++ .../hotelreservationsystem.php | 1 + .../views/css/wkhotelfilterblock.css | 16 ++ .../views/js/wkhotelfilterblock.js | 2 +- .../views/templates/hook/htlfilterblock.tpl | 60 +++++-- .../wkhotelfilterblock/wkhotelfilterblock.php | 99 +++++++++++- .../_partials/booking-form.tpl | 2 +- .../_partials/room_type_list.tpl | 22 ++- .../hotel-reservation-theme/css/category.css | 15 +- .../hotel-reservation-theme/css/product.css | 20 +++ themes/hotel-reservation-theme/product.tpl | 39 ++++- 21 files changed, 563 insertions(+), 44 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/features/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/features/helpers/form/form.tpl index 4e9b42939..fe4c71e17 100644 --- a/admin-dev/themes/default/template/controllers/features/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/features/helpers/form/form.tpl @@ -25,8 +25,34 @@ {extends file="helpers/form/form.tpl"} {block name="input_row"} + {$smarty.block.parent} {if $input.name == 'name'} {hook h="displayFeatureForm" id_feature=$form_id} {/if} + {if $input.name == 'logo_icon'} + + {/if} {/block} diff --git a/classes/Feature.php b/classes/Feature.php index 9b9035886..f1deab32a 100644 --- a/classes/Feature.php +++ b/classes/Feature.php @@ -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), diff --git a/classes/Product.php b/classes/Product.php index 4f280c742..fba163da5 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -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.') @@ -7045,6 +7045,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(); diff --git a/classes/Validate.php b/classes/Validate.php index 7fe6ab38e..2347aaf3d 100644 --- a/classes/Validate.php +++ b/classes/Validate.php @@ -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' diff --git a/controllers/admin/AdminFeaturesController.php b/controllers/admin/AdminFeaturesController.php index c90e51990..1b45cf26b 100644 --- a/controllers/admin/AdminFeaturesController.php +++ b/controllers/admin/AdminFeaturesController.php @@ -60,7 +60,7 @@ class AdminFeaturesControllerCore extends AdminController 'logo' => array( 'title' => $this->l('Icon'), 'align' => 'text-center', - 'image' => 'rf', + 'callback' => 'displayLogo', 'orderby' => false, 'search' => false, 'class' => 'fixed-width-xs' @@ -72,6 +72,17 @@ class AdminFeaturesControllerCore extends AdminController 'align' => 'center', 'class' => 'fixed-width-xs' ),*/ + 'is_featured' => array( + 'title' => $this->l('Is Featured'), + 'type' => 'select', + 'list' => array(1 => $this->l('Yes'), 0 => $this->l('No')), + 'align' => 'center', + 'callback' => 'displayIsFeatured', + 'filter_key' => 'a!is_featured', + 'filter_type' => 'int', + 'class' => 'fixed-width-sm', + 'orderby' => false + ), 'position' => array( 'title' => $this->l('Position'), 'filter_key' => 'a!position', @@ -181,7 +192,7 @@ class AdminFeaturesControllerCore extends AdminController // $ps_img_url = _PS_IMG_DIR_.'rf/'.$obj->id.'.jpg'; $img_url = $this->context->link->getMediaLink(_PS_IMG_.'rf/'.$obj->id.'.jpg'); if ($img_exist = Tools::file_get_contents($img_url)) { - $image = ""; + $image = ""; } $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.'), + 'https://fontawesome.com/v4/cheatsheet' + ), ) ) ); @@ -234,9 +281,50 @@ 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 ? '' : ''; + } + + $idFeature = (int) $row['id_feature']; + + return ImageManager::thumbnail( + _PS_IMG_DIR_.'rf/'.$idFeature.'.jpg', + 'feature_mini_'.$idFeature.'_'.(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 + */ + public function displayIsFeatured($isFeatured, $row) + { + if ((int) $isFeatured) { + return ''.$this->l('Yes').''; + } + + return ''.$this->l('No').''; + } + public function initPageHeaderToolbar() { if (empty($this->display)) { @@ -622,21 +710,63 @@ 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; + + 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/'.$idFeature.'.jpg'); + 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.'); } } + if (count($this->errors)) { + $this->display = $idFeature ? 'edit' : 'add'; + return false; + } + $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 - if (isset($featureImage['tmp_name']) && $featureImage['tmp_name']) { + 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'; diff --git a/controllers/front/CategoryController.php b/controllers/front/CategoryController.php index 7be5770b7..a9d2f635c 100644 --- a/controllers/front/CategoryController.php +++ b/controllers/front/CategoryController.php @@ -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,10 @@ class CategoryControllerCore extends FrontController foreach ($value as $a_k => $a_v) { $amenities[] = $a_v; } + } elseif ($key == 'features') { + foreach ($value as $idFeatureValue) { + $featureValues[] = (int) $idFeatureValue; + } } elseif ($key == 'price') { $price['from'] = $value[0]; $price['to'] = $value[1]; @@ -207,6 +212,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, ); diff --git a/controllers/front/ProductController.php b/controllers/front/ProductController.php index 1e4c5cc5d..e4d3a0389 100644 --- a/controllers/front/ProductController.php +++ b/controllers/front/ProductController.php @@ -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), diff --git a/install-dev/data/db_structure.sql b/install-dev/data/db_structure.sql index f253ba3ff..5afa159de 100644 --- a/install-dev/data/db_structure.sql +++ b/install-dev/data/db_structure.sql @@ -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; diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index fa032d053..10b6e88e5 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -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; } @@ -1831,14 +1834,24 @@ class HotelBookingDetail extends ObjectModel if (!empty($bookingData)) { 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 = (int) Configuration::get('WK_MAX_AMENITIES_ROOM_SEARCH')) { + $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)) { + if (!array_intersect($amenities, $roomAmenityIds)) { + unset($bookingData['rm_data'][$key]); + continue; + } + } + if (!empty($feature_values)) { + $roomFeatureValueIds = array_map('intval', array_column(Product::getFeaturesStatic($value['id_product']), 'id_feature_value')); + if (!array_intersect($feature_values, $roomFeatureValueIds)) { unset($bookingData['rm_data'][$key]); continue; } @@ -1859,7 +1872,16 @@ 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) { + if ($roomFeature['is_featured'] && !isset($featuredFeatures[$roomFeature['id_feature']])) { + $featuredFeatures[$roomFeature['id_feature']] = $roomFeature; + } + } + $bookingData['rm_data'][$key]['featured_features'] = array_values($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/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php index 324f7c4d8..b73d37a63 100644 --- a/modules/hotelreservationsystem/classes/HotelHelper.php +++ b/modules/hotelreservationsystem/classes/HotelHelper.php @@ -977,6 +977,74 @@ 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', + 13 => 'icon-music', + 14 => 'icon-diamond', + 16 => 'icon-music', + 17 => 'icon-microphone', + 18 => 'icon-film', + 19 => 'icon-moon-o', + 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', + 89 => 'icon-cutlery', + 90 => 'icon-coffee', + 91 => 'icon-cutlery', + 93 => 'icon-cutlery', + 94 => 'icon-cutlery', + 95 => 'icon-coffee', + 96 => 'icon-beer', + 97 => 'icon-cutlery', + 98 => 'icon-leaf', + ); $imgDir = dirname(__FILE__).'/../views/img/hotel_amenities/'; $i = 1; $defaultImageIndex = 0; @@ -1009,6 +1077,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 +1189,7 @@ 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_GOOGLE_ACTIVE_MAP', 0); Configuration::updateValue('WK_MAP_HOTEL_ACTIVE_ONLY', 1); diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php index 25b8279bc..6215121d7 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php @@ -189,6 +189,15 @@ 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 amenities in room search'), + 'hint' => $this->l('Maximum number of amenities to display for each room type on the front office room search page.'), + 'desc' => $this->l('Set to 0 to display all amenities.'), + 'type' => 'text', + 'cast' => 'intval', + 'class' => 'fixed-width-xl', + 'default' => '0', + ), ), 'submit' => array('title' => $this->l('Save')), ), @@ -570,6 +579,9 @@ 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 amenities 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 ad105af85..c935220f4 100644 --- a/modules/hotelreservationsystem/hotelreservationsystem.php +++ b/modules/hotelreservationsystem/hotelreservationsystem.php @@ -613,6 +613,7 @@ class HotelReservationSystem extends Module 'WK_CUSTOMER_SUPPORT_PHONE_NUMBER', 'WK_CUSTOMER_SUPPORT_EMAIL', 'WK_DISPLAY_CONTACT_PAGE_HOTEL_LIST', + 'WK_MAX_AMENITIES_ROOM_SEARCH', 'QLO_HEADER_MEDIA_TYPE', 'QLO_HEADER_CONTENT_ALIGN', 'QLO_HEADER_VIDEO_SOURCE_TYPE', diff --git a/modules/wkhotelfilterblock/views/css/wkhotelfilterblock.css b/modules/wkhotelfilterblock/views/css/wkhotelfilterblock.css index b0c3a78be..5c2e5cdbd 100644 --- a/modules/wkhotelfilterblock/views/css/wkhotelfilterblock.css +++ b/modules/wkhotelfilterblock/views/css/wkhotelfilterblock.css @@ -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; diff --git a/modules/wkhotelfilterblock/views/js/wkhotelfilterblock.js b/modules/wkhotelfilterblock/views/js/wkhotelfilterblock.js index e88cc649d..40a92d59e 100644 --- a/modules/wkhotelfilterblock/views/js/wkhotelfilterblock.js +++ b/modules/wkhotelfilterblock/views/js/wkhotelfilterblock.js @@ -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"); diff --git a/modules/wkhotelfilterblock/views/templates/hook/htlfilterblock.tpl b/modules/wkhotelfilterblock/views/templates/hook/htlfilterblock.tpl index 7f72fdca6..e02740e14 100644 --- a/modules/wkhotelfilterblock/views/templates/hook/htlfilterblock.tpl +++ b/modules/wkhotelfilterblock/views/templates/hook/htlfilterblock.tpl @@ -23,6 +23,29 @@ {block name='room_types_filters_block'}
      + {block name='room_types_price_filter'} + {if isset($config) && $config['SHOW_PRICE_FILTER']} +
      +
      +
      +
      + {l s='Price' mod='wkhotelfilterblock'} +
      +
      + {l s='Clear Filter' mod='wkhotelfilterblock'} +
      +
      +
      +
      + {displayPrice price=$min_price} + {displayPrice price=$max_price} +
      +
      +
      +
      + {/if} + {/block} + {block name='room_types_amenities_filter'} {if isset($config) && $config['SHOW_AMENITIES_FILTER'] && $all_amenities}
      @@ -47,26 +70,29 @@ {/if} {/block} - {block name='room_types_price_filter'} - {if isset($config) && $config['SHOW_PRICE_FILTER']} -
      -
      -
      -
      - {l s='Price' mod='wkhotelfilterblock'} -
      + {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} +
      +
      +
      +
      + {$feature.name|escape:'html':'UTF-8'} +
      +
      + {l s='Clear Filter' mod='wkhotelfilterblock'}
      - {l s='Clear Filter' mod='wkhotelfilterblock'} +
      +
      + {foreach $feature.values as $featureValue} +
      + + {$featureValue.value|escape:'html':'UTF-8'} +
      + {/foreach}
      -
      -
      - {displayPrice price=$min_price} - {displayPrice price=$max_price} -
      -
      -
      -
      + {/foreach} {/if} {/block}
      diff --git a/modules/wkhotelfilterblock/wkhotelfilterblock.php b/modules/wkhotelfilterblock/wkhotelfilterblock.php index c801b81f7..95c2b8507 100644 --- a/modules/wkhotelfilterblock/wkhotelfilterblock.php +++ b/modules/wkhotelfilterblock/wkhotelfilterblock.php @@ -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,13 +156,30 @@ 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 = ''; + + return $helper->generateForm(array($fields_form)).$script; } public function postProcess() @@ -137,7 +190,15 @@ class wkhotelfilterblock extends Module 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 +215,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 +292,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 +313,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 +337,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; } diff --git a/themes/hotel-reservation-theme/_partials/booking-form.tpl b/themes/hotel-reservation-theme/_partials/booking-form.tpl index 91a662fa1..c0109f278 100644 --- a/themes/hotel-reservation-theme/_partials/booking-form.tpl +++ b/themes/hotel-reservation-theme/_partials/booking-form.tpl @@ -103,7 +103,7 @@

      {l s='qty'}: {$product['quantity']}

      {/if}
      -
      +

      {displayPrice price=$product['price']}

      diff --git a/themes/hotel-reservation-theme/_partials/room_type_list.tpl b/themes/hotel-reservation-theme/_partials/room_type_list.tpl index e6d8288c4..3f997a131 100644 --- a/themes/hotel-reservation-theme/_partials/room_type_list.tpl +++ b/themes/hotel-reservation-theme/_partials/room_type_list.tpl @@ -53,13 +53,31 @@ {block name='room_type_list_room_description'}
      {$room_v['description_short']|truncate:190:"":true} {l s='View More'}....
      {/block} + {block name='room_type_list_room_featured_features'} + {if !empty($room_v['featured_features'])} +
      + +
      + {/if} + {/block}
      {block name='room_type_list_room_features'}
      - {if !empty($room_v['feature'])} + {if !empty($room_v['featured_amenities'])}

      - {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} {elseif $feat_v.logo_type == 'image' && $feat_v.logo} diff --git a/themes/hotel-reservation-theme/css/category.css b/themes/hotel-reservation-theme/css/category.css index 93ac147ef..b34d43a77 100644 --- a/themes/hotel-reservation-theme/css/category.css +++ b/themes/hotel-reservation-theme/css/category.css @@ -108,9 +108,6 @@ p.capa_txt { margin-bottom: 15px; } -.visible-md .capa_txt { - padding-left: 15px; -} .rm_review_cont { @@ -161,6 +158,18 @@ p.capa_txt { margin-bottom: 5px; } +.room_featured_feature +{ + display: inline-block; + margin: 0 15px 5px 0; +} + +.room_featured_feature img +{ + max-height: 20px; + max-width: 20px; +} + .rm_price_val { clear: both; diff --git a/themes/hotel-reservation-theme/css/product.css b/themes/hotel-reservation-theme/css/product.css index 1d6f56ecb..4f0f7f4c5 100644 --- a/themes/hotel-reservation-theme/css/product.css +++ b/themes/hotel-reservation-theme/css/product.css @@ -1442,6 +1442,17 @@ 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; +} +/* end */ + /* service popup design */ .services-info-tooltip-cont { min-width: 240px; @@ -1471,6 +1482,15 @@ Quick View Styles flex-wrap: wrap; justify-content: space-between; } +.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; } diff --git a/themes/hotel-reservation-theme/product.tpl b/themes/hotel-reservation-theme/product.tpl index 4a1b2ff4a..47feeb317 100644 --- a/themes/hotel-reservation-theme/product.tpl +++ b/themes/hotel-reservation-theme/product.tpl @@ -261,18 +261,45 @@

      {/if} {/block} + {block name='product_info_tab_featured_amenities'} + {if isset($featured_amenities) && $featured_amenities} + + {/if} + {/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 != ""}
      - {$current_feature_name|escape:'html':'UTF-8'} + {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'}
      @@ -280,6 +307,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`"} @@ -287,7 +316,7 @@ {if $feature@last}
      - {$current_feature_name|escape:'html':'UTF-8'} + {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'}
      @@ -303,11 +332,11 @@ {if isset($room_dynamic_amenities) && $room_dynamic_amenities}
      - {l s='%s Amenities' sprintf=$property_type} + {l s='%s Amenities' sprintf=$room_type_info['selling_object_name']}
      {foreach from=$room_dynamic_amenities item=amenity} -
      +
      {if $amenity.logo_type == 'icon' && $amenity.logo} {elseif $amenity.logo_type == 'image' && $amenity.logo} @@ -331,7 +360,7 @@
      {foreach from=$hotel_dynamic_amenities item=amenity} -
      +
      {if $amenity.logo_type == 'icon' && $amenity.logo} {elseif $amenity.logo_type == 'image' && $amenity.logo} From dfa3694a0267db2c4716c002437995b76e385a88 Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Fri, 16 Oct 2026 12:57:56 +0530 Subject: [PATCH 79/90] Fixed : text changes --- .../default/template/controllers/cart_rules/conditions.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/cart_rules/conditions.tpl b/admin-dev/themes/default/template/controllers/cart_rules/conditions.tpl index dd2e4f3bc..940a17f8e 100644 --- a/admin-dev/themes/default/template/controllers/cart_rules/conditions.tpl +++ b/admin-dev/themes/default/template/controllers/cart_rules/conditions.tpl @@ -231,7 +231,7 @@ {* Since the data can also be used from post incase of errors, which will cause issues with the id index *}
      -

      {l s='Unselected hotels'}

      +

      {l s='Unselected Properties'}

      -

      {l s='Selected hotels'}

      +

      {l s='Selected Properties'}

      - + - + {foreach from=$ttExemptRooms item=ttRoom} - - {assign var="is_full_date" value=($show_full_date && ($ttRoom['date_from']|date_format:'%D' == $ttRoom['date_to']|date_format:'%D'))} + {/foreach} @@ -107,20 +107,22 @@
      {l s='Room No.'} {l s='Room Type'}{l s='Property Name'} {l s='Duration'}{l s='Tourism Tax'} {l s='Total Price (Tax incl.)'}
      + {$ttRoom.room_num|escape:'html':'UTF-8'} {$ttRoom.room_type_name|escape:'html':'UTF-8'}{$ttRoom.hotel_name|escape:'html':'UTF-8'}{dateFormat date=$ttRoom.date_from full=$is_full_date} - {dateFormat date=$ttRoom.date_to full=$is_full_date}{convertPriceWithCurrency price=$ttRoom.tourism_tax_total currency=$currency->id} {convertPriceWithCurrency price=$ttRoom.total_room_price_ti currency=$currency->id}
      - + + {foreach from=$ttExemptProducts item=ttProduct} - + {/foreach} @@ -145,6 +147,121 @@ +{assign var='ttApplyRooms' value=[]} +{if isset($use_tourism_tax) && $use_tourism_tax && isset($order_detail_data) && $order_detail_data} + {foreach from=$order_detail_data item=ttApplyRoom} + {if isset($ttApplyRoom.tourism_tax_status) && $ttApplyRoom.tourism_tax_status != $tourism_tax_status_applied && $ttApplyRoom.tourism_tax_status != $tourism_tax_status_not_applicable && $ttApplyRoom.id_status != $ROOM_STATUS_CANCELLED && !$ttApplyRoom.is_refunded} + {append var='ttApplyRooms' value=$ttApplyRoom} + {/if} + {/foreach} +{/if} +{assign var='ttApplyProducts' value=[]} +{if isset($use_tourism_tax) && $use_tourism_tax} + {if isset($hotel_service_products) && $hotel_service_products} + {foreach from=$hotel_service_products item=ttApplyProduct} + {if isset($ttApplyProduct.tourism_tax_status) && $ttApplyProduct.tourism_tax_status != $tourism_tax_status_applied && $ttApplyProduct.tourism_tax_status != $tourism_tax_status_not_applicable && !$ttApplyProduct.is_refunded && !$ttApplyProduct.is_cancelled} + {append var='ttApplyProducts' value=$ttApplyProduct} + {/if} + {/foreach} + {/if} + {if isset($standalone_service_products) && $standalone_service_products} + {foreach from=$standalone_service_products item=ttApplyProduct} + {if isset($ttApplyProduct.tourism_tax_status) && $ttApplyProduct.tourism_tax_status != $tourism_tax_status_applied && $ttApplyProduct.tourism_tax_status != $tourism_tax_status_not_applicable && !$ttApplyProduct.is_refunded && !$ttApplyProduct.is_cancelled} + {append var='ttApplyProducts' value=$ttApplyProduct} + {/if} + {/foreach} + {/if} +{/if} + +
      {l s='Name'} {l s='Quantity'}{l s='Tourism Tax'} {l s='Total Price (Tax incl.)'}
      + {$ttProduct.name|escape:'html':'UTF-8'}{if $ttProduct.option_name} : {$ttProduct.option_name|escape:'html':'UTF-8'}{/if} {if $ttProduct.allow_multiple_quantity}{$ttProduct.quantity|escape:'html':'UTF-8'}{else}--{/if}{convertPriceWithCurrency price=$ttProduct.tourism_tax_total currency=$currency->id} {convertPriceWithCurrency price=$ttProduct.total_price_tax_incl currency=$currency->id}
      + + + + + + + + + + + {foreach from=$ttApplyRooms item=ttApplyRoom} + + + + + {assign var="is_full_date" value=($show_full_date && ($ttApplyRoom['date_from']|date_format:'%D' == $ttApplyRoom['date_to']|date_format:'%D'))} + + + + {/foreach} + +
      {l s='Room No.'}{l s='Room Type'}{l s='Duration'}{l s='Total Price (Tax incl.)'}
      + + {$ttApplyRoom.room_num|escape:'html':'UTF-8'}{$ttApplyRoom.room_type_name|escape:'html':'UTF-8'}{dateFormat date=$ttApplyRoom.date_from full=$is_full_date} - {dateFormat date=$ttApplyRoom.date_to full=$is_full_date}{convertPriceWithCurrency price=$ttApplyRoom.total_room_price_ti currency=$currency->id}
      + + {/if} + {if $ttApplyProducts|count} +
      + + + + + + + + + + + {foreach from=$ttApplyProducts item=ttApplyProduct} + + + + + + + {/foreach} + +
      {l s='Name'}{l s='Quantity'}{l s='Total Price (Tax incl.)'}
      + + {$ttApplyProduct.name|escape:'html':'UTF-8'}{if $ttApplyProduct.option_name} : {$ttApplyProduct.option_name|escape:'html':'UTF-8'}{/if}{if $ttApplyProduct.allow_multiple_quantity}{$ttApplyProduct.quantity|escape:'html':'UTF-8'}{else}--{/if}{convertPriceWithCurrency price=$ttApplyProduct.total_price_tax_incl currency=$currency->id}
      +
      + {/if} + {if $ttApplyRooms|count > 0 && $ttApplyProducts|count > 0} + + {/if} + + + + + + diff --git a/classes/order/OrderTaxDetail.php b/classes/order/OrderTaxDetail.php index 9d3f96bf1..3459d488d 100644 --- a/classes/order/OrderTaxDetail.php +++ b/classes/order/OrderTaxDetail.php @@ -1310,21 +1310,25 @@ class OrderTaxDetailCore extends ObjectModel } /** - * Apply tourism tax for every booking and every standalone service line of an order; returns only - * the failing entries. A booking/line with nothing applicable (neither the room nor any attached + * Apply tourism tax for the bookings and standalone service lines of an order — every one of them by + * default, or only the given ids; returns only the failing entries. A booking/line with nothing applicable (neither the room nor any attached * service, or the standalone line itself, has a tourism tax rule) is not a failure — it's silently * skipped, same as if it had simply been left alone. * * @param int $idOrder * @param int $idEmployee PS employee id (0 = resolved from Context) * @param string|null $autoMsgLabel Pre-translated "Tourism Tax Applied" label — null skips the Order Notes entry entirely, for every booking/line in the order + * @param int[]|null $idsHtlBooking Only these bookings are applied (ids that don't belong to the order are ignored); null = every booking + * @param int[]|null $idsServiceLines Only these standalone service lines are applied (ids that don't belong to the order are ignored); null = every line * @return array [{'id_htl_booking' => int, 'result' => int}, ...] plus * [{'id_service_product_order_detail' => int, 'result' => int}, ...] — failures only */ - public static function applyForOrder($idOrder, $idEmployee = 0, $autoMsgLabel = null) + public static function applyForOrder($idOrder, $idEmployee = 0, $autoMsgLabel = null, $idsHtlBooking = null, $idsServiceLines = null) { $idOrder = (int) $idOrder; $failures = array(); + $selectedBookingIds = ($idsHtlBooking !== null) ? array_flip(array_map('intval', $idsHtlBooking)) : null; + $selectedServiceLineIds = ($idsServiceLines !== null) ? array_flip(array_map('intval', $idsServiceLines)) : null; $objBookingDetail = new HotelBookingDetail(); $bookings = $objBookingDetail->getBookingDataByOrderId($idOrder); if ($bookings) { @@ -1336,6 +1340,9 @@ class OrderTaxDetailCore extends ObjectModel if (isset($refundedIds[$booking['id']]) || $booking['id_status'] == HotelBookingDetail::STATUS_CANCELLED) { continue; } + if ($selectedBookingIds !== null && !isset($selectedBookingIds[(int) $booking['id']])) { + continue; + } $result = self::applyBooking($booking['id'], $idEmployee, $autoMsgLabel); if ($result !== self::APPLY_OK && $result !== self::APPLY_ERROR_NOT_APPLICABLE) { $failures[] = array('id_htl_booking' => (int) $booking['id'], 'result' => $result); @@ -1343,6 +1350,9 @@ class OrderTaxDetailCore extends ObjectModel } } foreach (ServiceProductOrderDetail::getActiveStandaloneIdsByOrder($idOrder) as $idServiceLine) { + if ($selectedServiceLineIds !== null && !isset($selectedServiceLineIds[$idServiceLine])) { + continue; + } $result = self::applyServiceLine($idServiceLine, $idEmployee, $autoMsgLabel); if ($result !== self::APPLY_OK && $result !== self::APPLY_ERROR_NOT_APPLICABLE) { $failures[] = array('id_service_product_order_detail' => $idServiceLine, 'result' => $result); diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 973e56995..b9c788ebd 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -9254,15 +9254,22 @@ class AdminOrdersControllerCore extends AdminController } /** - * Apply tourism tax to a booking (id_htl_booking), a standalone service line - * (id_service_product_order_detail), or every booking of a whole order (id_order) — - * see OrderTaxDetail::applyBooking()/applyServiceLine(). + * Apply tourism tax to the rooms (id_htl_booking[]) and/or standalone service lines + * (id_service_product_order_detail[]) selected in the apply modal of an order (id_order) — + * see OrderTaxDetail::applyForOrder(). */ public function ajaxProcessApplyTourismTax() { - $idHtlBooking = (int) Tools::getValue('id_htl_booking', 0); - $idServiceProductOrderDetail = (int) Tools::getValue('id_service_product_order_detail', 0); + if ($this->tabAccess['edit'] !== 1) { + die(Tools::jsonEncode(array( + 'hasError' => true, + 'errors' => array(Tools::displayError('You do not have permission to edit this order.')), + ))); + } + $idOrder = (int) Tools::getValue('id_order', 0); + $idsHtlBooking = array_filter(array_map('intval', (array) Tools::getValue('id_htl_booking', array()))); + $idsServiceProductOrderDetail = array_filter(array_map('intval', (array) Tools::getValue('id_service_product_order_detail', array()))); $idEmployee = (int) Context::getContext()->employee->id; $autoMsgLabel = $this->l('Tourism Tax Applied'); $errors = array(); @@ -9271,20 +9278,15 @@ class AdminOrdersControllerCore extends AdminController OrderTaxDetail::APPLY_ERROR_NOT_APPLICABLE => $this->l('Tourism tax is not applicable for this booking.'), ); - if ($idHtlBooking) { - $result = OrderTaxDetail::applyBooking($idHtlBooking, $idEmployee, $autoMsgLabel); - if (isset($messagesByResult[$result])) { - $errors[] = $messagesByResult[$result]; - } - } elseif ($idServiceProductOrderDetail) { - $result = OrderTaxDetail::applyServiceLine($idServiceProductOrderDetail, $idEmployee, $autoMsgLabel); - if (isset($messagesByResult[$result])) { - $errors[] = $messagesByResult[$result]; - } - } elseif ($idOrder) { - $errors = self::tourismTaxErrorsFromResults(OrderTaxDetail::applyForOrder($idOrder, $idEmployee, $autoMsgLabel), $messagesByResult); - } else { + if (!Validate::isLoadedObject(new Order($idOrder))) { $errors[] = $this->l('Invalid request parameters.'); + } elseif (!$idsHtlBooking && !$idsServiceProductOrderDetail) { + $errors[] = Tools::displayError('No booking/products has been selected.'); + } else { + $errors = self::tourismTaxErrorsFromResults( + OrderTaxDetail::applyForOrder($idOrder, $idEmployee, $autoMsgLabel, $idsHtlBooking, $idsServiceProductOrderDetail), + $messagesByResult + ); } die(Tools::jsonEncode(array( From cf2f8e8751d331d1a051df310b515c1f087c8b8d Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Fri, 16 Oct 2026 13:27:10 +0530 Subject: [PATCH 81/90] Fixed: removed brandname and short description from general setting --- controllers/front/OurPropertiesController.php | 1 - .../classes/HotelHelper.php | 18 +---- .../AdminHotelGeneralSettingsController.php | 75 +++---------------- .../hotelreservationsystem.php | 10 +-- .../views/templates/hook/copyRight.tpl | 2 +- .../our-properties.tpl | 6 +- 6 files changed, 17 insertions(+), 95 deletions(-) diff --git a/controllers/front/OurPropertiesController.php b/controllers/front/OurPropertiesController.php index 3df472859..255714524 100644 --- a/controllers/front/OurPropertiesController.php +++ b/controllers/front/OurPropertiesController.php @@ -129,7 +129,6 @@ class OurPropertiesControllerCore extends FrontController 'hotelsInfo' => $hotelsInfo, 'hotelLocationArray' => $hotelLocationArray, 'displayHotelMap' => $displayHotelMap, - 'WK_HTL_SHORT_DESC' => Configuration::get('WK_HTL_SHORT_DESC', $this->context->language->id), 'currentIndex' => $this->context->link->getPageLink('our-properties') ) ); diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php index 324f7c4d8..f1aba02d2 100644 --- a/modules/hotelreservationsystem/classes/HotelHelper.php +++ b/modules/hotelreservationsystem/classes/HotelHelper.php @@ -1126,14 +1126,6 @@ class HotelHelper // lang fields $languages = Language::getLanguages(false); - $htlShortDescLang = array( - 'en' => 'We offer elegant rooms, gourmet dining, and attentive service for a memorable stay.', - 'nl' => 'Wij bieden elegante kamers, gastronomisch dineren en attente service voor een onvergetelijk verblijf.', - 'fr' => 'Nous proposons des chambres élégantes, une cuisine gastronomique et un service attentionné pour un séjour mémorable.', - 'de' => 'Wir bieten elegante Zimmer, Gourmet-Restaurants und aufmerksamen Service für einen unvergesslichen Aufenthalt.', - 'ru' => 'Мы предлагаем элегантные номера, изысканную кухню и внимательное обслуживание для незабываемого отдыха.', - 'es' => 'Ofrecemos habitaciones elegantes, comidas gourmet y un servicio atento para una estadía inolvidable.', - ); $defaultDimensionUnitLang = array( 'en' => 'ft', 'nl' => 'ft', @@ -1142,23 +1134,15 @@ class HotelHelper 'ru' => 'фут', 'es' => 'ft', ); - $WK_HTL_CHAIN_NAME = array(); - $WK_HTL_SHORT_DESC = array(); $defaultDimensionUnit = array(); foreach ($languages as $lang) { - if (isset($htlShortDescLang[$lang['iso_code']])) { - $WK_HTL_SHORT_DESC[$lang['id_lang']] = $htlShortDescLang[$lang['iso_code']]; - $WK_HTL_CHAIN_NAME[$lang['id_lang']] = $homeBannerTitleLang[$lang['iso_code']]; + if (isset($defaultDimensionUnitLang[$lang['iso_code']])) { $defaultDimensionUnit[$lang['id_lang']] = $defaultDimensionUnitLang[$lang['iso_code']]; } else { $defaultDimensionUnit[$lang['id_lang']] = $defaultDimensionUnitLang['en']; - $WK_HTL_CHAIN_NAME[$lang['id_lang']] = $homeBannerTitleLang['en']; - $WK_HTL_SHORT_DESC[$lang['id_lang']] = $htlShortDescLang['en']; } } - Configuration::updateValue('WK_HTL_CHAIN_NAME', $WK_HTL_CHAIN_NAME); - Configuration::updateValue('WK_HTL_SHORT_DESC', $WK_HTL_SHORT_DESC); Configuration::updateValue('WK_DIMENSION_UNIT', $defaultDimensionUnit); // Search Fields diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php index 25b8279bc..1797295e6 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelGeneralSettingsController.php @@ -124,39 +124,15 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController 'generalsetting' => array( 'title' => $this->l('Website Configuration'), 'fields' => array( - 'WK_HTL_CHAIN_NAME' => array( - 'title' => $this->l('Property Brand Name'), - 'type' => 'textLang', - 'lang' => true, - 'required' => true, - 'validation' => 'isGenericName', - 'hint' => $this->l('Enter Property name in case of single property or enter your properties chain name in case of multiple properties.'), - ), - 'WK_HTL_SHORT_DESC' => array( - 'title' => $this->l('Property Short Description'), - 'type' => 'textareaLang', - 'lang' => true, - 'required' => true, - 'rows' => '4', - 'cols' => '2', - 'validation' => 'isGenericName', - 'hint' => $this->l('This will display property short description in footer. Note: number of letters must be less than 220.'), - ), 'WK_PRIMARY_HOTEL' => array( 'title' => $this->l('Primary property'), 'hint' => $this->l('Primary property is used to default address for your business. The property address will be considered as your registered business address.'), 'type' => 'select', 'identifier' => 'id', 'list' => $hotelsInfo, - ), - 'WK_HTL_ESTABLISHMENT_YEAR' => array( - 'title' => $this->l('Website Launch Year'), - 'hint' => $this->l('The year when your hotel site was launched.'), - 'type' => 'text', - 'class' => 'fixed-width-xxl', ), 'WK_DISPLAY_PROPERTIES_LINK_IN_HEADER' => array( - 'title' => $this->l('Display Our Properties link in Header'), + 'title' => $this->l('Display Properties link in Header'), 'cast' => 'intval', 'type' => 'bool', 'default' => '0', @@ -170,7 +146,7 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController 'value' => 0, ), ), - 'hint' => $this->l('Display Our Properties link in header in the front office'), + 'hint' => $this->l('Display Properties link in header in the front office'), ), 'WK_DISPLAY_CONTACT_PAGE_HOTEL_LIST' => array( 'title' => $this->l('Display Contact Page Hotel List'), @@ -232,6 +208,12 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController 'required' => true, 'type' => 'text' ), + 'WK_HTL_ESTABLISHMENT_YEAR' => array( + 'title' => $this->l('Website Launch Year'), + 'hint' => $this->l('The year when your hotel site was launched.'), + 'type' => 'text', + 'class' => 'fixed-width-xxl', + ), 'PS_SHOP_PHONE' => array( 'title' => $this->l('Phone'), 'validation' => 'isGenericName', @@ -423,7 +405,7 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController 'hint' => $this->l('If yes, only active hotels will be displayed on map.'), ), 'WK_DISPLAY_PROPERTIES_PAGE_GOOGLE_MAP' => array( - 'title' => $this->l('Display Our Properties page Google map'), + 'title' => $this->l('Display Properties page Google map'), 'cast' => 'intval', 'type' => 'bool', 'default' => '0', @@ -437,7 +419,7 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController 'value' => 0, ), ), - 'hint' => $this->l('Enable to display map with hotels locations on the our properties page.'), + 'hint' => $this->l('Enable to display map with hotels locations on the properties page.'), ), 'WK_DISPLAY_CONTACT_PAGE_GOOLGE_MAP' => array( 'title' => $this->l('Display Contact Us page Google map'), @@ -540,29 +522,6 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController $this->errors[] = $this->l('Property name search threshold field is invalid.'); } - if (!trim(Tools::getValue('WK_HTL_CHAIN_NAME_'.$defaultLangId))) { - $this->errors[] = $this->l('Property chain name is required at least in ').$objDefaultLanguage['name']; - } else { - foreach ($languages as $lang) { - if (trim(Tools::getValue('WK_HTL_CHAIN_NAME_'.$lang['id_lang']))) { - if (!Validate::isGenericName(Tools::getValue('WK_HTL_CHAIN_NAME_'.$lang['id_lang']))) { - $this->errors[] = $this->l('Invalid property chain name in ').$lang['name']; - } - } - } - } - if (!trim(Tools::getValue('WK_HTL_SHORT_DESC_'.$defaultLangId))) { - $this->errors[] = $this->l('Property short description is required at least in '). - $objDefaultLanguage['name']; - } else { - foreach ($languages as $lang) { - if (trim(Tools::getValue('WK_HTL_SHORT_DESC_'.$lang['id_lang']))) { - if (!Validate::isGenericName(Tools::getValue('WK_HTL_SHORT_DESC_'.$lang['id_lang']))) { - $this->errors[] = $this->l('Invalid property short description in ').$lang['name']; - } - } - } - } if (!Validate::isUnsignedInt(Tools::getValue('WK_ADVANCED_PAYMENT_GLOBAL_MIN_AMOUNT'))) { $this->errors[] = $this->l('Invalid minimum partial payment percentage.'); } elseif (Tools::getValue('WK_ADVANCED_PAYMENT_GLOBAL_MIN_AMOUNT') <= 0) { @@ -604,20 +563,6 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController $_POST['WK_HOTEL_NAME_ENABLE'] = 1; } } - foreach ($languages as $lang) { - // if lang fileds are at least in default language and not available in other languages then - // set empty fields value to default language value - if (!trim(Tools::getValue('WK_HTL_CHAIN_NAME_'.$lang['id_lang']))) { - $_POST['WK_HTL_CHAIN_NAME_'.$lang['id_lang']] = trim( - Tools::getValue('WK_HTL_CHAIN_NAME_'.$defaultLangId) - ); - } - if (!trim(Tools::getValue('WK_HTL_SHORT_DESC_'.$lang['id_lang']))) { - $_POST['WK_HTL_SHORT_DESC_'.$lang['id_lang']] = trim( - Tools::getValue('WK_HTL_SHORT_DESC_'.$defaultLangId) - ); - } - } parent::postProcess(); if (empty($this->errors)) { Tools::redirectAdmin(self::$currentIndex.'&conf=6&token='.$this->token); diff --git a/modules/hotelreservationsystem/hotelreservationsystem.php b/modules/hotelreservationsystem/hotelreservationsystem.php index ad105af85..c9a8521e3 100644 --- a/modules/hotelreservationsystem/hotelreservationsystem.php +++ b/modules/hotelreservationsystem/hotelreservationsystem.php @@ -48,7 +48,6 @@ class HotelReservationSystem extends Module $resources = array( 'hotels' => array('description' => 'Hotel Branch Information','class' => 'HotelBranchInformation'), 'hotel_room_types' => array('description' => 'Hotel room types','class' => 'HotelRoomType'), - 'property_types' => array('description' => 'Hotel property types', 'class' => 'HotelPropertyType'), 'hotel_amenities' => array('description' => 'The hotel amenities', 'class' => 'HotelAmenities'), 'hotel_refund_rules' => array('description' => 'The hotel refund rules','class' => 'HotelOrderRefundRules'), 'hotel_rooms' => array('description' => 'The hotel rooms','class' => 'HotelRoomInformation'), @@ -358,7 +357,7 @@ class HotelReservationSystem extends Module $this->context->smarty->assign( array( 'WK_HTL_ESTABLISHMENT_YEAR' => Configuration::get('WK_HTL_ESTABLISHMENT_YEAR'), - 'WK_HTL_CHAIN_NAME' => Configuration::get('WK_HTL_CHAIN_NAME', $this->context->language->id), + 'WK_HTL_CHAIN_NAME' => Configuration::get('PS_SHOP_NAME'), ) ); return $this->display(__FILE__, 'copyRight.tpl'); @@ -452,12 +451,6 @@ class HotelReservationSystem extends Module //If Admin update new language when we do entry in module all lang tables. HotelHelper::updateLangTables($newIdLang, $langTables); - // update configuration keys - $configKeys = array( - 'WK_HTL_CHAIN_NAME', - 'WK_HTL_SHORT_DESC', - ); - HotelHelper::updateConfigurationLangKeys($newIdLang, $configKeys); } } @@ -600,6 +593,7 @@ class HotelReservationSystem extends Module 'WK_ROOM_LEFT_WARNING_NUMBER', 'WK_HTL_ESTABLISHMENT_YEAR', 'WK_HTL_CHAIN_NAME', + 'WK_HTL_SHORT_DESC', 'WK_HTL_TAG_LINE', 'WK_TITLE_HEADER_BLOCK', 'WK_CONTENT_HEADER_BLOCK', diff --git a/modules/hotelreservationsystem/views/templates/hook/copyRight.tpl b/modules/hotelreservationsystem/views/templates/hook/copyRight.tpl index eb3541799..d8380154f 100644 --- a/modules/hotelreservationsystem/views/templates/hook/copyRight.tpl +++ b/modules/hotelreservationsystem/views/templates/hook/copyRight.tpl @@ -1,5 +1,5 @@
      \ No newline at end of file diff --git a/themes/hotel-reservation-theme/our-properties.tpl b/themes/hotel-reservation-theme/our-properties.tpl index 720a9d8a8..214db265f 100644 --- a/themes/hotel-reservation-theme/our-properties.tpl +++ b/themes/hotel-reservation-theme/our-properties.tpl @@ -21,13 +21,13 @@ *} {block name='our_properties'} -{capture name=path}{l s='Our Properties'}{/capture} +{capture name=path}{l s='Properties'}{/capture} {if isset($hotelsInfo) && $hotelsInfo} {block name='our_properties_list_title'}
      -

      {l s='Our Properties'}

      +

      {l s='Properties'}

      -

      {$WK_HTL_SHORT_DESC|escape:'html':'UTF-8'}

      +

      {l s='Enjoy a welcoming atmosphere, essential comforts, and a pleasant stay.'}

      {/block} From 44cefb75dcbb9d18288b52cce9c26d1dc561b24e Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Fri, 16 Oct 2026 14:51:47 +0530 Subject: [PATCH 82/90] Fixed: Footer copyright text design --- .../views/css/qhrs_header_media.css | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/hotelreservationsystem/views/css/qhrs_header_media.css b/modules/hotelreservationsystem/views/css/qhrs_header_media.css index 5645b2563..9669e2622 100644 --- a/modules/hotelreservationsystem/views/css/qhrs_header_media.css +++ b/modules/hotelreservationsystem/views/css/qhrs_header_media.css @@ -214,4 +214,18 @@ .js-header-media-next { right: 15px; -} \ No newline at end of file +} +/* ===== copyRight.tpl (footer copyright) ===== */ +.copyRightWrapper { + background-color: #242424; + padding: 30px; + width: 100%; +} +.copyRightWrapper .copyRight { + color: #868686; + font-size: 16px; + font-weight: 400; + margin: 0; + text-align: center; + line-height: 23px; +} From 500e3f8d9dab9fed36ef4559fb1530b3946ee0b3 Mon Sep 17 00:00:00 2001 From: amit sharma Date: Fri, 16 Oct 2026 17:07:23 +0530 Subject: [PATCH 83/90] Fixed:review changes --- classes/Feature.php | 5 + classes/Product.php | 4 + controllers/admin/AdminFeaturesController.php | 90 +++++++-------- .../classes/HotelAmenities.php | 2 +- .../classes/HotelBookingDetail.php | 13 ++- .../classes/HotelCartBookingData.php | 9 +- .../classes/HotelHelper.php | 103 ++++++++++++++++++ .../admin/AdminHotelAmenitiesController.php | 24 ++-- .../AdminHotelGeneralSettingsController.php | 12 ++ .../hotelreservationsystem.php | 1 + .../hotel_amenities/helpers/view/view.tpl | 2 +- .../_partials/room_type_list.tpl | 6 +- .../hotel-reservation-theme/css/category.css | 9 +- .../hotel-reservation-theme/css/product.css | 5 +- themes/hotel-reservation-theme/product.tpl | 66 +++++------ .../shopping-cart-detail.tpl | 2 +- 16 files changed, 251 insertions(+), 102 deletions(-) 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} From cdbbb3204b7e9051016b57604592e64db7a6606c Mon Sep 17 00:00:00 2001 From: amit sharma Date: Fri, 16 Oct 2026 17:31:45 +0530 Subject: [PATCH 84/90] Fixed: installation issue --- classes/Feature.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Feature.php b/classes/Feature.php index 00d31c01c..9faaa6281 100644 --- a/classes/Feature.php +++ b/classes/Feature.php @@ -123,7 +123,7 @@ 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; } From d294c45077b244235ee6dceb1d8df94c1f32f2c7 Mon Sep 17 00:00:00 2001 From: amit sharma Date: Fri, 16 Oct 2026 17:56:49 +0530 Subject: [PATCH 85/90] Fixed: document text and logo issue --- classes/pdf/PDFGenerator.php | 2 +- controllers/admin/AdminThemesController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/pdf/PDFGenerator.php b/classes/pdf/PDFGenerator.php index 4cd27a6bb..691ad828b 100644 --- a/classes/pdf/PDFGenerator.php +++ b/classes/pdf/PDFGenerator.php @@ -214,7 +214,7 @@ class PDFGeneratorCore extends TCPDF { $this->SetHeaderMargin(5); $this->SetFooterMargin(21); - $this->setMargins(10, 40, 10); + $this->setMargins(10, 45, 10); $this->AddPage(); $this->writeHTML($this->content, true, false, true, false, ''); } diff --git a/controllers/admin/AdminThemesController.php b/controllers/admin/AdminThemesController.php index aefb0df4d..b28b032df 100644 --- a/controllers/admin/AdminThemesController.php +++ b/controllers/admin/AdminThemesController.php @@ -138,7 +138,7 @@ class AdminThemesControllerCore extends AdminController 'icon' => 'icon-html5', 'tabs' => array( 'logo' => $this->l('Logo'), - 'logo2' => $this->l('Invoice & Email Logos'), + 'logo2' => $this->l('Documents Logos'), 'icons' => $this->l('Icons'), 'mobile' => $this->l('Mobile'), ), From 99495f7a6cbc8ec795cf2457e705f05216697458 Mon Sep 17 00:00:00 2001 From: shazar rahman Date: Fri, 16 Oct 2026 18:35:09 +0530 Subject: [PATCH 86/90] Updated: Make room disable dates independent of room status Co-authored-by: Name --- .../controllers/products/configuration.tpl | 34 +-- controllers/admin/AdminImportController.php | 61 +++--- controllers/admin/AdminProductsController.php | 195 ++++++++---------- controllers/admin/AdminStatsController.php | 20 +- docs/csv_import/rooms_import.csv | 4 +- .../classes/HotelBookingDetail.php | 10 +- .../classes/HotelRoomDisableDates.php | 7 +- .../classes/HotelRoomInformation.php | 40 ++-- .../classes/HotelRoomType.php | 30 ++- .../hotelreservationsystem.php | 2 +- .../helpers/view/_partials/booking-rooms.tpl | 2 +- modules/qlohotelreports/qlohotelreports.php | 12 +- .../views/templates/hook/group-occupancy.tpl | 2 + .../views/templates/hook/group-property.tpl | 2 + .../statsbestcategories.php | 2 +- .../statsbestproducts/statsbestproducts.php | 2 +- 16 files changed, 197 insertions(+), 228 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/products/configuration.tpl b/admin-dev/themes/default/template/controllers/products/configuration.tpl index 2be7cecf2..02d04e3b6 100644 --- a/admin-dev/themes/default/template/controllers/products/configuration.tpl +++ b/admin-dev/themes/default/template/controllers/products/configuration.tpl @@ -62,7 +62,7 @@
      @@ -111,9 +111,9 @@ - {if $room_info['id_status'] != $rm_status['STATUS_TEMPORARY_INACTIVE']['id'] }{l s='Add Dates'}{else}{l s='View Dates'}{/if} + {if isset($room_info['disable_dates_json']) && json_decode($room_info['disable_dates_json'])}{l s='View Dates'}{else}{l s='Add Dates'}{/if} - + @@ -381,7 +381,7 @@ -