From d79ef4963cd3dedd55578e1745e292b99688f478 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 4 Jun 2025 12:08:01 +0530 Subject: [PATCH 01/42] Fixed: filter related issues in the Back office --- .../controllers/products/informations.tpl | 2 +- classes/controller/AdminController.php | 5 ++- .../admin/AdminNormalProductsController.php | 31 +++++++++++++++--- controllers/admin/AdminProductsController.php | 32 +++++++++++++++---- .../AdminHotelRoomModuleSettingController.php | 1 + 5 files changed, 56 insertions(+), 15 deletions(-) diff --git a/admin/themes/default/template/controllers/products/informations.tpl b/admin/themes/default/template/controllers/products/informations.tpl index d67bdffb0..fdfa02ee0 100644 --- a/admin/themes/default/template/controllers/products/informations.tpl +++ b/admin/themes/default/template/controllers/products/informations.tpl @@ -455,7 +455,7 @@

{l s='Please note that position numbering starts from 0. A position of 0 means room type will be displayed at the topmost position.'}

{l s='You can manage positions of the room types of this hotel from'} - {l s='here.'} + {l s='here.'}
diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 80e71feba..2dcb41a51 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -878,9 +878,8 @@ class AdminControllerCore extends Controller } } - if (empty($filters)) { - $filters = $this->context->cookie->getFamily($prefix.$this->list_id.'Filter_'); - } + // To merge the older filters with the new ones, and replace if new data is added to filter. + $filters = array_merge($this->context->cookie->getFamily($prefix.$this->list_id.'Filter_'), $filters); foreach ($filters as $key => $value) { $key_org = $key; diff --git a/controllers/admin/AdminNormalProductsController.php b/controllers/admin/AdminNormalProductsController.php index d204c88ff..12d070ce4 100644 --- a/controllers/admin/AdminNormalProductsController.php +++ b/controllers/admin/AdminNormalProductsController.php @@ -139,6 +139,7 @@ class AdminNormalProductsControllerCore extends AdminController } } + $catFitlerKey = $this->table.'Filter_a!id_category_default'; if (Tools::getValue('reset_filter_category')) { $this->context->cookie->id_category_products_filter = false; } @@ -149,6 +150,9 @@ class AdminNormalProductsControllerCore extends AdminController Tools::redirectAdmin($this->context->link->getAdminLink('AdminNormalProducts')); } } + if (!Tools::getValue($catFitlerKey)) { + $this->context->cookie->id_category_products_filter = false; + } /* Join categories table */ if ($id_category = (int)Tools::getValue('productFilter_cl!name')) { $this->_category = new Category((int)$id_category); @@ -160,6 +164,21 @@ class AdminNormalProductsControllerCore extends AdminController } elseif ($id_category = $this->context->cookie->id_category_products_filter) { $this->id_current_category = $id_category; } + + $idFilterCategory = false; + if (!Tools::isSubmit($catFitlerKey)) { + $prefix = $this->getCookieFilterPrefix(); + $idFilterCategory = $this->context->cookie->{$prefix.$catFitlerKey}; + } + + if ($idFilterCategory) { + $this->id_current_category = $idFilterCategory; + $this->context->cookie->id_category_products_filter = $idFilterCategory; + } else { + $this->id_current_category = false; + $this->context->cookie->id_category_products_filter = false; + } + if ($this->id_current_category) { $this->_category = new Category((int)$this->id_current_category); } else { @@ -550,8 +569,9 @@ class AdminNormalProductsControllerCore extends AdminController public function getList($id_lang, $orderBy = null, $orderWay = null, $start = 0, $limit = null, $id_lang_shop = null) { - $orderByPriceFinal = (empty($orderBy) ? ($this->context->cookie->__get($this->table.'Orderby') ? $this->context->cookie->__get($this->table.'Orderby') : 'id_'.$this->table) : $orderBy); - $orderWayPriceFinal = (empty($orderWay) ? ($this->context->cookie->__get($this->table.'Orderway') ? $this->context->cookie->__get($this->table.'Orderby') : 'ASC') : $orderWay); + $prefix = $this->getCookieFilterPrefix(); + $orderByPriceFinal = (empty($orderBy) ? ($this->context->cookie->__get($prefix.$this->table.'Orderby') ? $this->context->cookie->__get($prefix.$this->table.'Orderby') : 'id_'.$this->table) : $orderBy); + $orderWayPriceFinal = (empty($orderWay) ? ($this->context->cookie->__get($prefix.$this->table.'Orderway') ? $this->context->cookie->__get($prefix.$this->table.'Orderby') : 'ASC') : $orderWay); if ($orderByPriceFinal == 'price_final') { $orderBy = 'id_'.$this->table; $orderWay = 'ASC'; @@ -2560,9 +2580,10 @@ class AdminNormalProductsControllerCore extends AdminController // If products from all categories are displayed, we don't want to use sorting by position if (!$id_category) { $this->_defaultOrderBy = $this->identifier; - if ($this->context->cookie->{$this->table.'Orderby'} == 'position') { - unset($this->context->cookie->{$this->table.'Orderby'}); - unset($this->context->cookie->{$this->table.'Orderway'}); + $prefix = $this->getCookieFilterPrefix(); + if ($this->context->cookie->{$prefix.$this->table.'Orderby'} == 'position') { + unset($this->context->cookie->{$prefix.$this->table.'Orderby'}); + unset($this->context->cookie->{$prefix.$this->table.'Orderway'}); } } if (!$id_category) { diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index c65497b23..36610d0b0 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -161,14 +161,32 @@ class AdminProductsControllerCore extends AdminController $_POST['productFilter_a!id_category_default'] = $id_category; } + $catFitlerKey = $this->table.'Filter_a!id_category_default'; + if (!Tools::getValue($catFitlerKey)) { + $this->context->cookie->id_category_room_types_filter = false; + } if (($id_category = (int)Tools::getValue('id_category')) - || ($id_category = (int) Tools::getValue('productFilter_a!id_category_default')) + || ($id_category = (int) Tools::getValue($catFitlerKey)) ) { $this->id_current_category = $id_category; $this->context->cookie->id_category_room_types_filter = $id_category; } elseif ($id_category = $this->context->cookie->id_category_room_types_filter) { $this->id_current_category = $id_category; + } else { + $idFilterCategory = false; + if (!Tools::isSubmit($catFitlerKey)) { + $prefix = $this->getCookieFilterPrefix(); + $idFilterCategory = $this->context->cookie->{$prefix.$catFitlerKey}; + } + + if ($idFilterCategory) { + $this->id_current_category = $idFilterCategory; + $this->context->cookie->id_category_room_types_filter = $idFilterCategory; + } else { + $this->context->cookie->id_category_room_types_filter = false; + } } + if ($this->id_current_category) { $this->_category = new Category((int)$this->id_current_category); $this->position_group_identifier = (int) $this->id_current_category; @@ -631,8 +649,9 @@ class AdminProductsControllerCore extends AdminController public function getList($id_lang, $orderBy = null, $orderWay = null, $start = 0, $limit = null, $id_lang_shop = null) { - $orderByPriceFinal = (empty($orderBy) ? ($this->context->cookie->__get($this->table.'Orderby') ? $this->context->cookie->__get($this->table.'Orderby') : 'id_'.$this->table) : $orderBy); - $orderWayPriceFinal = (empty($orderWay) ? ($this->context->cookie->__get($this->table.'Orderway') ? $this->context->cookie->__get($this->table.'Orderby') : 'ASC') : $orderWay); + $prefix = $this->getCookieFilterPrefix(); + $orderByPriceFinal = (empty($orderBy) ? ($this->context->cookie->__get($prefix.$this->table.'Orderby') ? $this->context->cookie->__get($prefix.$this->table.'Orderby') : 'id_'.$this->table) : $orderBy); + $orderWayPriceFinal = (empty($orderWay) ? ($this->context->cookie->__get($prefix.$this->table.'Orderway') ? $this->context->cookie->__get($prefix.$this->table.'Orderby') : 'ASC') : $orderWay); if ($orderByPriceFinal == 'price_final') { $orderBy = 'id_'.$this->table; $orderWay = 'ASC'; @@ -2524,9 +2543,10 @@ class AdminProductsControllerCore extends AdminController // If products from all categories are displayed, we don't want to use sorting by position if (!(int) $this->id_current_category) { $this->_defaultOrderBy = $this->identifier; - if ($this->context->cookie->{$this->table.'Orderby'} == 'position') { - unset($this->context->cookie->{$this->table.'Orderby'}); - unset($this->context->cookie->{$this->table.'Orderway'}); + $prefix = $this->getCookieFilterPrefix(); + if ($this->context->cookie->{$prefix.$this->table.'Orderby'} == 'position') { + unset($this->context->cookie->{$prefix.$this->table.'Orderby'}); + unset($this->context->cookie->{$prefix.$this->table.'Orderway'}); } } } diff --git a/modules/wkhotelroom/controllers/admin/AdminHotelRoomModuleSettingController.php b/modules/wkhotelroom/controllers/admin/AdminHotelRoomModuleSettingController.php index 4e37f08d8..0fe71a798 100644 --- a/modules/wkhotelroom/controllers/admin/AdminHotelRoomModuleSettingController.php +++ b/modules/wkhotelroom/controllers/admin/AdminHotelRoomModuleSettingController.php @@ -106,6 +106,7 @@ class AdminHotelRoomModuleSettingController extends ModuleAdminController ), 'date_add' => array( 'title' => $this->l('Date Add'), + 'filter_key' => 'a!date_add', 'align' => 'center', 'type' => 'datetime', ), From caca5b698b758d1332c3ec61bb45b257eb550b95 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Mon, 9 Jun 2025 19:28:59 +0530 Subject: [PATCH 02/42] Fixed: syntax errors and some filter related issues --- .../admin/AdminNormalProductsController.php | 8 ++++---- controllers/admin/AdminProductsController.php | 14 +++++++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/controllers/admin/AdminNormalProductsController.php b/controllers/admin/AdminNormalProductsController.php index 01e1ebe81..2a355748c 100644 --- a/controllers/admin/AdminNormalProductsController.php +++ b/controllers/admin/AdminNormalProductsController.php @@ -146,7 +146,7 @@ class AdminNormalProductsControllerCore extends AdminController } } - $catFitlerKey = $this->table.'Filter_a!id_category_default'; + $catFilterKey = $this->table.'Filter_a!id_category_default'; if (Tools::getValue('reset_filter_category')) { $this->context->cookie->id_category_products_filter = false; } @@ -157,7 +157,7 @@ class AdminNormalProductsControllerCore extends AdminController Tools::redirectAdmin($this->context->link->getAdminLink('AdminNormalProducts')); } } - if (!Tools::getValue($catFitlerKey)) { + if (!Tools::getValue($catFilterKey)) { $this->context->cookie->id_category_products_filter = false; } /* Join categories table */ @@ -173,9 +173,9 @@ class AdminNormalProductsControllerCore extends AdminController } $idFilterCategory = false; - if (!Tools::isSubmit($catFitlerKey)) { + if (!Tools::isSubmit($catFilterKey)) { $prefix = $this->getCookieFilterPrefix(); - $idFilterCategory = $this->context->cookie->{$prefix.$catFitlerKey}; + $idFilterCategory = $this->context->cookie->{$prefix.$catFilterKey}; } if ($idFilterCategory) { diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 7cac1f9fe..c1850165d 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -169,22 +169,26 @@ class AdminProductsControllerCore extends AdminController $_POST['productFilter_a!id_category_default'] = $id_category; } - $catFitlerKey = $this->table.'Filter_a!id_category_default'; - if (!Tools::getValue($catFitlerKey)) { + $catFilterKey = $this->table.'Filter_a!id_category_default'; + if (!Tools::getValue($catFilterKey)) { $this->context->cookie->id_category_room_types_filter = false; } if (($id_category = (int)Tools::getValue('id_category')) - || ($id_category = (int) Tools::getValue($catFitlerKey)) + || ($id_category = (int)Tools::getValue($catFilterKey)) ) { $this->id_current_category = $id_category; $this->context->cookie->id_category_room_types_filter = $id_category; + if (Tools::isSubmit('submitResetproduct')) { + $this->id_current_category = false; + $this->context->cookie->id_category_room_types_filter = false; + } } elseif ($id_category = $this->context->cookie->id_category_room_types_filter) { $this->id_current_category = $id_category; } else { $idFilterCategory = false; - if (!Tools::isSubmit($catFitlerKey)) { + if (!Tools::isSubmit($catFilterKey)) { $prefix = $this->getCookieFilterPrefix(); - $idFilterCategory = $this->context->cookie->{$prefix.$catFitlerKey}; + $idFilterCategory = $this->context->cookie->{$prefix.$catFilterKey}; } if ($idFilterCategory) { From db1ad8805fd4c045241f7337d977f70d9a855c30 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Mon, 9 Jun 2025 20:01:59 +0530 Subject: [PATCH 03/42] Fixed: Admin is unable to update the position of the categories --- classes/Category.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/classes/Category.php b/classes/Category.php index 7524d1688..148c8dc8e 100644 --- a/classes/Category.php +++ b/classes/Category.php @@ -1427,7 +1427,7 @@ class CategoryCore extends ObjectModel '.Shop::addSqlAssociation('category', 'cp').' WHERE cp.`id_parent` = '.(int)$this->id_parent.' ORDER BY category_shop.`position` ASC') - ) { + ) { return false; } @@ -1443,10 +1443,11 @@ class CategoryCore extends ObjectModel } // < and > statements rather than BETWEEN operator // since BETWEEN is treated differently according to databases + $increment = ($way ? '- 1' : '+ 1'); $result = (Db::getInstance()->execute(' UPDATE `'._DB_PREFIX_.'category` c '.Shop::addSqlAssociation('category', 'c').' - SET c.`position`= c.`position` '.($way ? '- 1' : '+ 1').', - category_shop.`position`= category_shop.`position` '.($way ? '- 1' : '+ 1').', + SET c.`position`= IF(cast(c.`position` as signed) '.$increment.' > 0, c.`position` '.$increment.', 0), ' . + 'category_shop.`position` = IF(cast(category_shop.`position` as signed) '.$increment.' > 0, category_shop.`position` '.$increment.', 0), c.`date_upd` = "'.date('Y-m-d H:i:s').'" WHERE category_shop.`position` '.($way From d77a3bc37639f1adc86a4d336b66eb1ef05f320e Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Thu, 12 Jun 2025 18:50:56 +0530 Subject: [PATCH 04/42] =?UTF-8?q?Fixed:It=20shows=20order=20status=20?= =?UTF-8?q?=E2=80=9CBooked=E2=80=9D=20when=20all=20rooms=20are=20deleted?= =?UTF-8?q?=20except=20refunded=20rooms?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/admin/AdminOrdersController.php | 48 +++++++++++++-------- 1 file changed, 30 insertions(+), 18 deletions(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index dad09b3b0..02e981a67 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -5566,26 +5566,38 @@ class AdminOrdersControllerCore extends AdminController */ public function updateOrderStatusOnOrderChange($objOrder) { - // check if new order amount is greater that old order amount and order payment is accepted - // then update order status to partial payment accepted - $currentOrderState = $objOrder->getCurrentOrderState(); - $psOsPartialPaymentAccepted = Configuration::get('PS_OS_PARTIAL_PAYMENT_ACCEPTED'); - if ($currentOrderState->paid == 1 && $currentOrderState->id != $psOsPartialPaymentAccepted) { - // calculate due amount - $dueAmount = $objOrder->total_paid_tax_incl - $objOrder->total_paid_real; - if ($dueAmount > 0) { - // now change order status to partial payment - $objOrderHistory = new OrderHistory(); - $objOrderHistory->id_order = $objOrder->id; - $objOrderHistory->id_employee = (int) $this->context->employee->id; + // If order is completely refunded or cancelled then change the order state + if ($idOrderRefundState = $objOrder->getOrderCompleteRefundStatus()) { + $objOrderHistory = new OrderHistory(); + $objOrderHistory->id_order = (int)$objOrder->id; + $useExistingPayment = false; + if (!$objOrder->hasInvoice()) { + $useExistingPayment = true; + } + $objOrderHistory->changeIdOrderState($idOrderState, $objOrder, $useExistingPayment); + $objOrderHistory->add(); + } else { + // check if new order amount is greater that old order amount and order payment is accepted + // then update order status to partial payment accepted + $currentOrderState = $objOrder->getCurrentOrderState(); + $psOsPartialPaymentAccepted = Configuration::get('PS_OS_PARTIAL_PAYMENT_ACCEPTED'); + if ($currentOrderState->paid == 1 && $currentOrderState->id != $psOsPartialPaymentAccepted) { + // calculate due amount + $dueAmount = $objOrder->total_paid_tax_incl - $objOrder->total_paid_real; + if ($dueAmount > 0) { + // now change order status to partial payment + $objOrderHistory = new OrderHistory(); + $objOrderHistory->id_order = $objOrder->id; + $objOrderHistory->id_employee = (int) $this->context->employee->id; - $useExistingPayment = false; - if (!$objOrder->hasInvoice()) { - $useExistingPayment = true; + $useExistingPayment = false; + if (!$objOrder->hasInvoice()) { + $useExistingPayment = true; + } + + $objOrderHistory->changeIdOrderState($psOsPartialPaymentAccepted, $objOrder, $useExistingPayment); + $objOrderHistory->add(); } - - $objOrderHistory->changeIdOrderState($psOsPartialPaymentAccepted, $objOrder, $useExistingPayment); - $objOrderHistory->add(); } } } From 9b48cf260ea3736d55cd417526cdb6a3c46e6a67 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 12 Jun 2025 18:59:56 +0530 Subject: [PATCH 05/42] Updated the toolbar title for the order page render list --- controllers/admin/AdminOrdersController.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 934edf868..45fa00156 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -537,6 +537,18 @@ class AdminOrdersControllerCore extends AdminController return $res; } + public function initToolbarTitle() + { + parent::initToolbarTitle(); + switch ($this->display) { + case '': + case 'list': + array_pop($this->toolbar_title); + $this->toolbar_title[] = $this->l('Orders'); + break; + } + } + public function ajaxProcessInitBookingDocumentsModal() { $response['hasError'] = 1; From 66cf555eaea96801753db659f5d0b764abe14d31 Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Fri, 13 Jun 2025 20:35:43 +0530 Subject: [PATCH 06/42] Fixed: refund status calculation --- classes/order/Order.php | 17 ++++++++++++++--- controllers/admin/AdminOrdersController.php | 5 ++--- controllers/front/OrderDetailController.php | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/classes/order/Order.php b/classes/order/Order.php index 7dd8378f6..abcd65007 100644 --- a/classes/order/Order.php +++ b/classes/order/Order.php @@ -2658,25 +2658,36 @@ class OrderCore extends ObjectModel * * @return boolean: true if order has been completely refunded as per requested parameters or false */ - public function hasCompletelyRefunded($action = 0, $includeCheckIn = 0) + public function hasCompletelyRefunded($action = 0, $includeCheckIn = 0, $mustHaveRoomsOrProducts = 1) { $res = true; + + // Check if order has bookings or products for refund + if ($mustHaveRoomsOrProducts) { + $hasRoomsOrProducts = 0; + } else { + $hasRoomsOrProducts = 1; + } + // check rooms in booking $objHotelBooking = new HotelBookingdetail(); if ($orderBookings = $objHotelBooking->getOrderCurrentDataByOrderId($this->id)) { $res &= $this->checkList($orderBookings, $action, $includeCheckIn); + $hasRoomsOrProducts = 1; } // check hotel linked products $objServiceProductOrderDetail = new ServiceProductOrderDetail(); if ($hotelProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($this->id, 0, 0, Product::SELLING_PREFERENCE_HOTEL_STANDALONE)) { $res &= $this->checkList($hotelProducts, $action, false); + $hasRoomsOrProducts = 1; } if ($standaloneProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($this->id, 0, 0, Product::SELLING_PREFERENCE_STANDALONE)) { $res &= $this->checkList($standaloneProducts, $action, false); + $hasRoomsOrProducts = 1; } - return $res; + return ($hasRoomsOrProducts && $res); } public function checkList($list, $action = 0, $includeCheckIn = 0) { @@ -2800,7 +2811,7 @@ class OrderCore extends ObjectModel ) { $result['errors'][] = Tools::displayError('Order status can not be set to Refunded until all bookings in the order are completely refunded.'); } elseif ($objNewOrderState->id == Configuration::get('PS_OS_CANCELED') - && !$this->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_FLAG) + && !$this->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_FLAG, 0, 1) ) { $result['errors'][] = Tools::displayError('Order status can not be set to Cancelled until all bookings in the order are cancelled.'); } elseif ($objCurrentOrderState->id == Configuration::get('PS_OS_ERROR') && !($objNewOrderState->id == Configuration::get('PS_OS_ERROR'))) { diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 21af1d37c..b407fad6c 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -513,7 +513,7 @@ class AdminOrdersControllerCore extends AdminController if ($this->tabAccess['edit'] === 1) { if (((int) $order->isReturnable()) - && !$order->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_OR_REFUND_REQUEST_FLAG) + && !$order->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_OR_REFUND_REQUEST_FLAG, 0, 0) ) { $orderTotalPaid = $order->getTotalPaid(); $orderDiscounts = $order->getCartRules(); @@ -3560,7 +3560,6 @@ class AdminOrdersControllerCore extends AdminController 'returns' => OrderReturn::getOrdersReturn($order->id_customer, $order->id), 'refundReqBookings' => $refundReqBookings, 'refundReqProducts' => $refundReqProducts, - 'completeRefundRequestOrCancel' => $order->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_OR_REFUND_REQUEST_FLAG), 'refundedAmount' => $refundedAmount, 'totalDemandsPriceTI' => $totalDemandsPriceTI, 'totalDemandsPriceTE' => $totalDemandsPriceTE, @@ -5597,7 +5596,7 @@ class AdminOrdersControllerCore extends AdminController public function updateOrderStatusOnOrderChange($objOrder) { // If order is completely refunded or cancelled then change the order state - if ($idOrderRefundState = $objOrder->getOrderCompleteRefundStatus()) { + if ($idOrderState = $objOrder->getOrderCompleteRefundStatus()) { $objOrderHistory = new OrderHistory(); $objOrderHistory->id_order = (int)$objOrder->id; $useExistingPayment = false; diff --git a/controllers/front/OrderDetailController.php b/controllers/front/OrderDetailController.php index 3b67fd8b6..ef4b3e49f 100644 --- a/controllers/front/OrderDetailController.php +++ b/controllers/front/OrderDetailController.php @@ -464,7 +464,7 @@ class OrderDetailControllerCore extends FrontController 'returns' => OrderReturn::getOrdersReturn($order->id_customer, $order->id), 'refundReqBookings' => $refundReqBookings, 'refundReqProducts' => $refundReqProducts, - 'completeRefundRequestOrCancel' => $order->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_OR_REFUND_REQUEST_FLAG), + 'completeRefundRequestOrCancel' => $order->hasCompletelyRefunded(Order::ORDER_COMPLETE_CANCELLATION_OR_REFUND_REQUEST_FLAG, 0, 0), 'refundedAmount' => $refundedAmount, 'shop_name' => strval(Configuration::get('PS_SHOP_NAME')), 'order' => $order, From 889d6b130173db8449cc0c2f8f55c22864c50a08 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Sat, 14 Jun 2025 11:19:33 +0530 Subject: [PATCH 07/42] Added: new configuration for the dimension unit in for the bed types, revert the changes for the ps dimension unit --- controllers/front/ProductController.php | 2 +- localization/ae.xml | 2 +- localization/be.xml | 2 +- localization/bg.xml | 2 +- localization/by.xml | 2 +- localization/cy.xml | 2 +- localization/cz.xml | 2 +- localization/de.xml | 2 +- localization/ee.xml | 2 +- localization/es.xml | 2 +- localization/fi.xml | 2 +- localization/fr.xml | 2 +- localization/gb.xml | 2 +- localization/gr.xml | 2 +- localization/hr.xml | 2 +- localization/hu.xml | 2 +- localization/ie.xml | 2 +- localization/it.xml | 2 +- localization/ke.xml | 2 +- localization/lt.xml | 2 +- localization/lu.xml | 2 +- localization/lv.xml | 2 +- localization/mt.xml | 2 +- localization/my.xml | 2 +- localization/ng.xml | 2 +- localization/nl.xml | 2 +- localization/pa.xml | 2 +- localization/pe.xml | 2 +- localization/ph.xml | 2 +- localization/pl.xml | 2 +- localization/pt.xml | 2 +- localization/ro.xml | 2 +- localization/rs.xml | 2 +- localization/se.xml | 2 +- localization/sg.xml | 2 +- localization/si.xml | 2 +- localization/sk.xml | 2 +- localization/tn.xml | 2 +- .../classes/HotelHelper.php | 13 ++- .../admin/AdminHotelBedTypesController.php | 84 ++++++++++++++----- 40 files changed, 112 insertions(+), 61 deletions(-) diff --git a/controllers/front/ProductController.php b/controllers/front/ProductController.php index 2ea5cb9c3..24cc682af 100644 --- a/controllers/front/ProductController.php +++ b/controllers/front/ProductController.php @@ -436,7 +436,7 @@ class ProductControllerCore extends FrontController 'PS_SERVICE_PRODUCT_CATEGORY_FILTER' => Configuration::get('PS_SERVICE_PRODUCT_CATEGORY_FILTER'), 'bed_types_info' => $bedTypes, 'selected_bed_types' => $selectedBedTypes, - 'dimension_unit' => Configuration::get('PS_DIMENSION_UNIT'), + 'dimension_unit' => Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id), ) ); diff --git a/localization/ae.xml b/localization/ae.xml index 5ee90b78b..a396613dc 100644 --- a/localization/ae.xml +++ b/localization/ae.xml @@ -11,7 +11,7 @@ - + diff --git a/localization/be.xml b/localization/be.xml index b12218f6a..7b5a99eb6 100644 --- a/localization/be.xml +++ b/localization/be.xml @@ -223,7 +223,7 @@ - + diff --git a/localization/bg.xml b/localization/bg.xml index acb1e1843..52c894980 100644 --- a/localization/bg.xml +++ b/localization/bg.xml @@ -190,7 +190,7 @@ - + diff --git a/localization/by.xml b/localization/by.xml index b4b5297e7..226d187b1 100644 --- a/localization/by.xml +++ b/localization/by.xml @@ -23,7 +23,7 @@ - + diff --git a/localization/cy.xml b/localization/cy.xml index 42a046ce6..c4bd10aef 100644 --- a/localization/cy.xml +++ b/localization/cy.xml @@ -192,7 +192,7 @@ - + diff --git a/localization/cz.xml b/localization/cz.xml index 2b8cc6f26..c5f0ca17b 100644 --- a/localization/cz.xml +++ b/localization/cz.xml @@ -131,7 +131,7 @@ - + diff --git a/localization/de.xml b/localization/de.xml index fe2d8f1bb..2434f4db6 100644 --- a/localization/de.xml +++ b/localization/de.xml @@ -190,7 +190,7 @@ - + diff --git a/localization/ee.xml b/localization/ee.xml index e4a8a28ef..de7fb9c70 100644 --- a/localization/ee.xml +++ b/localization/ee.xml @@ -190,7 +190,7 @@ - + diff --git a/localization/es.xml b/localization/es.xml index 261c16ec1..55be33e0c 100644 --- a/localization/es.xml +++ b/localization/es.xml @@ -223,7 +223,7 @@ - + diff --git a/localization/fi.xml b/localization/fi.xml index 64a9c3b37..6847f2b0e 100644 --- a/localization/fi.xml +++ b/localization/fi.xml @@ -221,7 +221,7 @@ - + diff --git a/localization/fr.xml b/localization/fr.xml index 742471e70..5189a36b0 100644 --- a/localization/fr.xml +++ b/localization/fr.xml @@ -201,7 +201,7 @@ - + diff --git a/localization/gb.xml b/localization/gb.xml index 5e444ad60..3d6778734 100644 --- a/localization/gb.xml +++ b/localization/gb.xml @@ -130,7 +130,7 @@ - + diff --git a/localization/gr.xml b/localization/gr.xml index 92f950692..f66ba324a 100644 --- a/localization/gr.xml +++ b/localization/gr.xml @@ -254,7 +254,7 @@ - + diff --git a/localization/hr.xml b/localization/hr.xml index 50f627c0b..e1825a93e 100644 --- a/localization/hr.xml +++ b/localization/hr.xml @@ -161,7 +161,7 @@ - + diff --git a/localization/hu.xml b/localization/hu.xml index 3d2823a48..942644d96 100644 --- a/localization/hu.xml +++ b/localization/hu.xml @@ -221,7 +221,7 @@ - + diff --git a/localization/ie.xml b/localization/ie.xml index 823866692..b94f767d4 100644 --- a/localization/ie.xml +++ b/localization/ie.xml @@ -192,7 +192,7 @@ - + diff --git a/localization/it.xml b/localization/it.xml index 4e3937415..004799209 100644 --- a/localization/it.xml +++ b/localization/it.xml @@ -333,7 +333,7 @@ - + diff --git a/localization/ke.xml b/localization/ke.xml index d3f056d63..488d06b86 100644 --- a/localization/ke.xml +++ b/localization/ke.xml @@ -19,7 +19,7 @@ - + diff --git a/localization/lt.xml b/localization/lt.xml index e52cda3d7..d74acf838 100644 --- a/localization/lt.xml +++ b/localization/lt.xml @@ -221,7 +221,7 @@ - + diff --git a/localization/lu.xml b/localization/lu.xml index ce72f7f1d..e50bb9e7d 100644 --- a/localization/lu.xml +++ b/localization/lu.xml @@ -253,7 +253,7 @@ - + diff --git a/localization/lv.xml b/localization/lv.xml index 3ae0933a4..ad0266fbe 100644 --- a/localization/lv.xml +++ b/localization/lv.xml @@ -190,7 +190,7 @@ - + diff --git a/localization/mt.xml b/localization/mt.xml index 16cb3d350..e51e375b9 100644 --- a/localization/mt.xml +++ b/localization/mt.xml @@ -160,7 +160,7 @@ - + diff --git a/localization/my.xml b/localization/my.xml index 348cb1df8..38a00cdbe 100644 --- a/localization/my.xml +++ b/localization/my.xml @@ -41,7 +41,7 @@ - + diff --git a/localization/ng.xml b/localization/ng.xml index 75267ea9c..d6a676d87 100644 --- a/localization/ng.xml +++ b/localization/ng.xml @@ -19,7 +19,7 @@ - + diff --git a/localization/nl.xml b/localization/nl.xml index 5584ffe60..dff561347 100644 --- a/localization/nl.xml +++ b/localization/nl.xml @@ -190,7 +190,7 @@ - + diff --git a/localization/pa.xml b/localization/pa.xml index b06bab2a2..7cf1e0e9e 100644 --- a/localization/pa.xml +++ b/localization/pa.xml @@ -19,7 +19,7 @@ - + diff --git a/localization/pe.xml b/localization/pe.xml index de6cf3925..68eb0fe4b 100644 --- a/localization/pe.xml +++ b/localization/pe.xml @@ -17,7 +17,7 @@ - + diff --git a/localization/ph.xml b/localization/ph.xml index c2db1c01a..b3d56d67f 100644 --- a/localization/ph.xml +++ b/localization/ph.xml @@ -19,7 +19,7 @@ - + diff --git a/localization/pl.xml b/localization/pl.xml index 310c07893..bfc285e25 100644 --- a/localization/pl.xml +++ b/localization/pl.xml @@ -190,7 +190,7 @@ - + diff --git a/localization/pt.xml b/localization/pt.xml index 614b5a19f..cd18d9adf 100644 --- a/localization/pt.xml +++ b/localization/pt.xml @@ -221,7 +221,7 @@ - + diff --git a/localization/ro.xml b/localization/ro.xml index ca172694e..6c7c66604 100644 --- a/localization/ro.xml +++ b/localization/ro.xml @@ -265,7 +265,7 @@ - + diff --git a/localization/rs.xml b/localization/rs.xml index 5bfd40d14..4904780da 100644 --- a/localization/rs.xml +++ b/localization/rs.xml @@ -10,7 +10,7 @@ - + diff --git a/localization/se.xml b/localization/se.xml index b71c05405..0243428c7 100644 --- a/localization/se.xml +++ b/localization/se.xml @@ -161,7 +161,7 @@ - + diff --git a/localization/sg.xml b/localization/sg.xml index 1f115ca61..7bf58571d 100644 --- a/localization/sg.xml +++ b/localization/sg.xml @@ -18,7 +18,7 @@ - + diff --git a/localization/si.xml b/localization/si.xml index 9e3f595d1..4ab65c6c6 100644 --- a/localization/si.xml +++ b/localization/si.xml @@ -190,7 +190,7 @@ - + diff --git a/localization/sk.xml b/localization/sk.xml index 94cd6c0d4..adf6d311e 100644 --- a/localization/sk.xml +++ b/localization/sk.xml @@ -190,7 +190,7 @@ - + diff --git a/localization/tn.xml b/localization/tn.xml index 2fdd770d2..772c22009 100644 --- a/localization/tn.xml +++ b/localization/tn.xml @@ -16,7 +16,7 @@ - + diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php index 0bb2d3f4e..edc7d39fe 100644 --- a/modules/hotelreservationsystem/classes/HotelHelper.php +++ b/modules/hotelreservationsystem/classes/HotelHelper.php @@ -1094,16 +1094,26 @@ class HotelHelper 'ru' => 'Мы предлагаем элегантные номера, изысканную кухню и внимательное обслуживание для незабываемого отдыха.', 'es' => 'Ofrecemos habitaciones elegantes, comidas gourmet y un servicio atento para una estadía inolvidable.', ); - + $defaultDimensionUnitLang = array( + 'en' => 'ft', + 'nl' => 'ft', + 'fr' => 'pi', + 'de' => 'ft', + 'ru' => 'фут', + 'es' => 'ft', + ); $WK_HTL_CHAIN_NAME = array(); $WK_HTL_TAG_LINE = array(); $WK_HTL_SHORT_DESC = array(); + $defaultDimensionUnit = array(); foreach ($languages as $lang) { if (isset($htlTagLineLang[$lang['iso_code']])) { $WK_HTL_TAG_LINE[$lang['id_lang']] = $htlTagLineLang[$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']]; + $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_TAG_LINE[$lang['id_lang']] = $htlTagLineLang['en']; $WK_HTL_SHORT_DESC[$lang['id_lang']] = $htlShortDescLang['en']; @@ -1113,6 +1123,7 @@ class HotelHelper Configuration::updateValue('WK_HTL_CHAIN_NAME', $WK_HTL_CHAIN_NAME); Configuration::updateValue('WK_HTL_TAG_LINE', $WK_HTL_TAG_LINE); Configuration::updateValue('WK_HTL_SHORT_DESC', $WK_HTL_SHORT_DESC); + Configuration::updateValue('WK_DIMENSION_UNIT', $defaultDimensionUnit); // Search Fields Configuration::updateValue('PS_FRONT_SEARCH_TYPE', HotelBookingDetail::SEARCH_TYPE_OWS); diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelBedTypesController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelBedTypesController.php index 2088899a7..fe90ca442 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelBedTypesController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelBedTypesController.php @@ -35,24 +35,22 @@ class AdminHotelBedTypesController extends ModuleAdminController parent::__construct(); $this->_new_list_header_design = true; - $this->fields_list = array( - 'id_bed_type' => array( - 'title' => $this->l('ID'), - 'align' => 'center', - ), - 'name' => array( - 'title' => $this->l('Name'), - 'align' => 'center', - ), - 'width' => array( - 'title' => $this->l('Width'), - 'align' => 'center', - 'suffix' => Configuration::get('PS_DIMENSION_UNIT') - ), - 'length' => array( - 'title' => $this->l('Lenght'), - 'align' => 'center', - 'suffix' => Configuration::get('PS_DIMENSION_UNIT') + // field options for global fields + $this->fields_options = array( + 'global' => array( + 'title' => $this->l('Dimension Unit Setting'), + 'icon' => 'icon-cogs', + 'fields' => array( + 'WK_DIMENSION_UNIT' => array( + 'title' => $this->l('Dimension Unit'), + 'type' => 'textLang', + 'lang' => true, + 'required' => true, + 'validation' => 'isGenericName', + 'hint' => $this->l('Enter a dimension unit for the bed types.') + ), + ), + 'submit' => array('title' => $this->l('Save')) ), ); @@ -67,6 +65,17 @@ class AdminHotelBedTypesController extends ModuleAdminController ); } + public function initContent() + { + parent::initContent(); + // to customize the view as per our requirements + if ($this->display != 'add' && $this->display != 'edit') { + $this->content = $this->renderOptions(); + $this->content .= $this->renderList(); + $this->context->smarty->assign('content', $this->content); + } + } + public function initPageHeaderToolbar() { if (!$this->display || $this->display == 'list') { @@ -80,6 +89,37 @@ class AdminHotelBedTypesController extends ModuleAdminController parent::initPageHeaderToolbar(); } + public function initToolbar() + { + $this->toolbar_btn = array(); + } + + public function renderList() + { + // added here instead of the constructor since the dimension unit will be update in post processs. + $this->fields_list = array( + 'id_bed_type' => array( + 'title' => $this->l('ID'), + 'align' => 'center', + ), + 'name' => array( + 'title' => $this->l('Name'), + 'align' => 'center', + ), + 'width' => array( + 'title' => $this->l('Width'), + 'align' => 'center', + 'suffix' => Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id) + ), + 'length' => array( + 'title' => $this->l('Lenght'), + 'align' => 'center', + 'suffix' => Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id) + ), + ); + return parent::renderList(); + } + public function renderForm() { if (!$this->loadObject(true)) { @@ -107,8 +147,8 @@ class AdminHotelBedTypesController extends ModuleAdminController 'name' => 'width', 'required' => true, 'col' => 4, - 'hint' => $this->l('Enter the width of the Bed type in ').Configuration::get('PS_DIMENSION_UNIT'), - 'suffix' => Configuration::get('PS_DIMENSION_UNIT'), + 'hint' => $this->l('Enter the width of the Bed type in ').Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id), + 'suffix' => Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id), ), array( 'type' => 'text', @@ -116,8 +156,8 @@ class AdminHotelBedTypesController extends ModuleAdminController 'name' => 'length', 'col' => 4, 'required' => true, - 'hint' => $this->l('Enter the length of the Bed type in ').Configuration::get('PS_DIMENSION_UNIT'), - 'suffix' => Configuration::get('PS_DIMENSION_UNIT'), + 'hint' => $this->l('Enter the length of the Bed type in ').Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id), + 'suffix' => Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id), ), ), 'submit' => array( From 856c5045f3239be2be8ff71972c28fe8a598457a Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Sat, 14 Jun 2025 11:30:16 +0530 Subject: [PATCH 08/42] Added validation for empty dimension unit --- .../admin/AdminHotelBedTypesController.php | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelBedTypesController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelBedTypesController.php index fe90ca442..1b86ff3af 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelBedTypesController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelBedTypesController.php @@ -96,7 +96,7 @@ class AdminHotelBedTypesController extends ModuleAdminController public function renderList() { - // added here instead of the constructor since the dimension unit will be update in post processs. + // added here instead of the constructor since the dimension unit will be update afer post processs. $this->fields_list = array( 'id_bed_type' => array( 'title' => $this->l('ID'), @@ -177,6 +177,27 @@ class AdminHotelBedTypesController extends ModuleAdminController return parent::renderForm(); } + public function beforeUpdateOptions() + { + $defaultLangId = Configuration::get('PS_LANG_DEFAULT'); + $objDefaultLanguage = Language::getLanguage((int) $defaultLangId); + $languages = Language::getLanguages(false); + if (!trim(Tools::getValue('WK_DIMENSION_UNIT_'.$defaultLangId)) + && Tools::getValue('WK_DIMENSION_UNIT_'.$defaultLangId) + ) { + $this->errors[] = $this->l('Default dimension unit is required at least in ').$objDefaultLanguage['name']; + } else { + foreach ($languages as $lang) { + if (Tools::getValue('WK_DIMENSION_UNIT_'.$lang['id_lang']) + && (!trim(Tools::getValue('WK_DIMENSION_UNIT_'.$lang['id_lang'])) + || !Validate::isGenericName(Tools::getValue('WK_DIMENSION_UNIT_'.$lang['id_lang']))) + ) { + $this->errors[] = $this->l('Invalid dimension unit in ').$lang['name']; + } + } + } + } + public function processSave() { if (!$this->loadObject(true)) { From 0d456462a6910eb653ea8193ac08eb61d7e067ab Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Sat, 14 Jun 2025 12:21:28 +0530 Subject: [PATCH 09/42] Updated: if any stanalone product is present in cart the admin should not b able to create the booking from booking cart --- .../controllers/carts/helpers/view/view.tpl | 2 +- controllers/admin/AdminCartsController.php | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/admin/themes/default/template/controllers/carts/helpers/view/view.tpl b/admin/themes/default/template/controllers/carts/helpers/view/view.tpl index 2fd68d44f..4da11944d 100644 --- a/admin/themes/default/template/controllers/carts/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/carts/helpers/view/view.tpl @@ -67,7 +67,7 @@ {l s='Created on:'} {dateFormat date=$cart_order.date_add} {else}

{l s='No order was created from this cart.'}

- {if $customer->id} + {if $customer->id && !$hotel_products && !$standalone_products} {l s='Create an order from this cart.'} {/if} {/if} diff --git a/controllers/admin/AdminCartsController.php b/controllers/admin/AdminCartsController.php index fa9c3abfa..4a9ef5b73 100644 --- a/controllers/admin/AdminCartsController.php +++ b/controllers/admin/AdminCartsController.php @@ -336,8 +336,38 @@ class AdminCartsControllerCore extends AdminController $helper->value = Tools::displayPrice($total_price, $currency); $kpi = $helper->generate(); //end + + // get standalone products in cart + $objServiceProductCartDetail = new ServiceProductCartDetail(); + $hotelProducts = $objServiceProductCartDetail->getServiceProductsInCart( + $cart->id, + [Product::SELLING_PREFERENCE_HOTEL_STANDALONE, Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE], + $idHotel = null, + 0, + null, + null, + null, + null, + 0, + null, + 0, + null, + 1 + ); + + $standaloneProducts = $objServiceProductCartDetail->getServiceProductsInCart( + $cart->id, + [Product::SELLING_PREFERENCE_STANDALONE] + ); + + if (count($standaloneProducts)) { + $this->context->smarty->assign('standalone_products', $standaloneProducts); + } + $this->tpl_view_vars = array( 'cart_htl_data' => $cartHtlData,//by webkul hotel rooms in order data + 'standalone_products' => $standaloneProducts, + 'hotel_products' => $hotelProducts, 'kpi' => $kpi, 'products' => $products, 'discounts' => $cart->getCartRules(), From 6024997d30b8ef35e1375af2110f5898bf8d856d Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Sat, 14 Jun 2025 13:16:25 +0530 Subject: [PATCH 10/42] added fax and hotelregistraionnumber with icons --- controllers/front/ContactController.php | 4 ++++ .../hotel-reservation-theme/contact-form.tpl | 22 ++++++++++++++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/controllers/front/ContactController.php b/controllers/front/ContactController.php index 691959cec..06e8b0759 100644 --- a/controllers/front/ContactController.php +++ b/controllers/front/ContactController.php @@ -298,6 +298,8 @@ class ContactControllerCore extends FrontController $gblHtlAddress = $shopAddress; $gblHtlPhone = Configuration::get('PS_SHOP_PHONE'); $gblHtlEmail = Configuration::get('PS_SHOP_EMAIL'); + $gblHtlRegistrationNumber = Configuration::get('PS_SHOP_DETAILS'); + $gblHtlFax = Configuration::get('PS_SHOP_FAX'); $objHotelInfo = new HotelBranchInformation(); if ($hotelsInfo = $objHotelInfo->hotelBranchesInfo(false, 1, 1)) { foreach ($hotelsInfo as &$hotel) { @@ -333,6 +335,8 @@ class ContactControllerCore extends FrontController 'gblHtlEmail' => $gblHtlEmail, 'displayHotelMap' => $displayHotelMap, 'gblHtlAddress' => $gblHtlAddress, + 'gblHtlRegistrationNumber' => $gblHtlRegistrationNumber, + 'gblHtlFax' => $gblHtlFax, 'contacts' => Contact::getContacts($this->context->language->id), 'message' => html_entity_decode(Tools::getValue('message')), 'contactKey' => $contactKey, diff --git a/themes/hotel-reservation-theme/contact-form.tpl b/themes/hotel-reservation-theme/contact-form.tpl index 368421d1b..61ab718b4 100644 --- a/themes/hotel-reservation-theme/contact-form.tpl +++ b/themes/hotel-reservation-theme/contact-form.tpl @@ -42,7 +42,7 @@
{if isset($gblHtlPhone) && $gblHtlPhone }
-

{l s='Main Branch'}

+

{l s='Main Branch'}

{$gblHtlAddress}

@@ -50,7 +50,7 @@ {/if} {if isset($gblHtlPhone) && $gblHtlPhone}
-

{l s='Phone'}

+

{l s='Phone'}

{$gblHtlPhone}

@@ -58,12 +58,28 @@ {/if} {if isset($gblHtlEmail) && $gblHtlEmail}
-

{l s='Mail Us'}

+

{l s='Mail Us'}

{$gblHtlEmail}

{/if} + {if isset($gblHtlRegistrationNumber) && $gblHtlRegistrationNumber} +
+

{l s='Registration number'}

+

+ {$gblHtlRegistrationNumber} +

+
+ {/if} + {if isset($gblHtlFax) && $gblHtlFax} +
+

{l s='Fax'}

+

+ {$gblHtlFax} +

+
+ {/if}
{/block}
From 5d497b58ba2a493f9379671e705f9eabb21b827b Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Sat, 14 Jun 2025 14:10:03 +0530 Subject: [PATCH 11/42] =?UTF-8?q?Fixed:=20Customer=20unable=20to=20book=20?= =?UTF-8?q?room=20from=20frontoffice=20when=20admin=20created=20=E2=80=9Ca?= =?UTF-8?q?uto=20added=E2=80=9D=20service=20for=20that=20room=20during=20c?= =?UTF-8?q?heckout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/admin/AdminCartsController.php | 6 +++++- .../classes/RoomTypeServiceProduct.php | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminCartsController.php b/controllers/admin/AdminCartsController.php index fa9c3abfa..9b8a0036d 100644 --- a/controllers/admin/AdminCartsController.php +++ b/controllers/admin/AdminCartsController.php @@ -1381,7 +1381,7 @@ class AdminCartsControllerCore extends AdminController foreach ($languages as $lang) { $objServiceProduct->link_rewrite[$lang['id_lang']] = Tools::link_rewrite($name); } - $objServiceProduct->available_for_order = true; + $objServiceProduct->available_for_order = false; $objServiceProduct->show_price = true; $objServiceProduct->is_virtual = true; $objServiceProduct->auto_add_to_cart = $autoAdded; @@ -1395,6 +1395,10 @@ class AdminCartsControllerCore extends AdminController // ======= Create Service product END ========= if ($objServiceProduct->save()) { + $objServiceProduct->updateCategories(array( + Configuration::get('PS_SERVICE_CATEGORY') + )); + $objRoomTypeServiceProduct = new RoomTypeServiceProduct(); $objRoomTypeServiceProduct->addRoomProductLink( $objServiceProduct->id, diff --git a/modules/hotelreservationsystem/classes/RoomTypeServiceProduct.php b/modules/hotelreservationsystem/classes/RoomTypeServiceProduct.php index a7aed3b9f..7636092c1 100644 --- a/modules/hotelreservationsystem/classes/RoomTypeServiceProduct.php +++ b/modules/hotelreservationsystem/classes/RoomTypeServiceProduct.php @@ -139,9 +139,16 @@ class RoomTypeServiceProduct extends ObjectModel public static function getAutoAddServices($idProduct, $dateFrom = null, $dateTo = null, $priceAdditionType = null, $useTax = null, $use_reduc = 1) { if (Product::isBookingProduct($idProduct)) { + $context = Context::getContext(); + $front = true; + if (!in_array($context->controller->controller_type, array('front', 'modulefront'))) { + $front = false; + } + $sql = 'SELECT p.`id_product` FROM `'._DB_PREFIX_.'htl_room_type_service_product` rsp INNER JOIN `'._DB_PREFIX_.'product` p ON (rsp.`id_product` = p.`id_product` AND p.`auto_add_to_cart` = 1) - WHERE p.`active` = 1 AND `id_element` = '.(int)$idProduct.' AND `element_type` = '.self::WK_ELEMENT_TYPE_ROOM_TYPE; + WHERE p.`active` = 1 AND `id_element` = '.(int)$idProduct.' AND `element_type` = '.self::WK_ELEMENT_TYPE_ROOM_TYPE. + ($front ? ' AND p.`available_for_order` = 1':''); if (!is_null($priceAdditionType)) { $sql .= ' AND p.`price_addition_type` = '.$priceAdditionType; } From de6249ffbf9742616e8269943f32b32256e11fa6 Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Sat, 14 Jun 2025 14:41:09 +0530 Subject: [PATCH 12/42] Fixed: When booking is deleted while reallocating, refund requests are not deleted --- .../hotelreservationsystem/classes/HotelBookingDetail.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index d15b53785..f3dc7c140 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -2290,7 +2290,10 @@ class HotelBookingDetail extends ObjectModel // delete the booking detail $objOldHotelBooking = new HotelBookingDetail($idHotelBooking); - $objOldHotelBooking->delete(); + if ($objOldHotelBooking->delete()) { + // delete refund request of the room if exists. + OrderReturnDetail::deleteReturnDetailByIdBookingDetail($objOldHotelBooking->id_order, $idHotelBooking); + } // =============================================================== // END Delete Process of the old booking From f1b55f46c3e3db0b3b58a1072970772209711225 Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Sat, 14 Jun 2025 15:05:56 +0530 Subject: [PATCH 13/42] Fixed: Getting error when customer cancel booking when order status is Awaiting payment --- .../classes/HotelBookingDetail.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index d15b53785..1cc139b29 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -3430,18 +3430,21 @@ class HotelBookingDetail extends ObjectModel $objOrderDetail->product_quantity_refunded = $objOrderDetail->product_quantity; } - $objOrderDetail->total_price_tax_excl -= Tools::processPriceRounding( + $objOrderDetail->total_price_tax_excl -= (float) Tools::processPriceRounding( $objOrderDetail->total_price_tax_excl, 1, $objOrder->round_type, $objOrder->round_mode ); - $objOrderDetail->total_price_tax_incl -= Tools::processPriceRounding( + $objOrderDetail->total_price_tax_excl = $objOrderDetail->total_price_tax_excl > 0 ? $objOrderDetail->total_price_tax_excl : 0; + + $objOrderDetail->total_price_tax_incl -= (float) Tools::processPriceRounding( $objOrderDetail->total_price_tax_incl, 1, $objOrder->round_type, $objOrder->round_mode ); + $objOrderDetail->total_price_tax_incl = $objOrderDetail->total_price_tax_incl > 0 ? $objOrderDetail->total_price_tax_incl : 0; $objOrderDetail->save(); } @@ -3474,6 +3477,7 @@ class HotelBookingDetail extends ObjectModel $objOrder->round_type, $objOrder->round_mode ); + $objOrderDetail->total_price_tax_incl = $objOrderDetail->total_price_tax_incl > 0 ? $objOrderDetail->total_price_tax_incl : 0; $objOrderDetail->total_price_tax_excl -= Tools::processPriceRounding( $this->total_price_tax_excl, @@ -3481,6 +3485,7 @@ class HotelBookingDetail extends ObjectModel $objOrder->round_type, $objOrder->round_mode ); + $objOrderDetail->total_price_tax_excl = $objOrderDetail->total_price_tax_excl > 0 ? $objOrderDetail->total_price_tax_excl : 0; if (Validate::isLoadedObject($objOrder = new Order($this->id_order))) { $objOrder->total_paid = Tools::ps_round( From 536d230d3422f0e94f87213c7295d19bb4803370 Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Sat, 14 Jun 2025 15:22:31 +0530 Subject: [PATCH 14/42] documentation link updated --- .../template/controllers/dashboard/helpers/view/view.tpl | 2 +- install/langs/bg/install.php | 6 +++--- install/langs/bn/install.php | 6 +++--- install/langs/br/install.php | 6 +++--- install/langs/ca/install.php | 6 +++--- install/langs/cs/install.php | 6 +++--- install/langs/de/install.php | 4 ++-- install/langs/en/install.php | 6 +++--- install/langs/es/install.php | 6 +++--- install/langs/fa/install.php | 6 +++--- install/langs/fr/install.php | 6 +++--- install/langs/he/install.php | 6 +++--- install/langs/hr/install.php | 6 +++--- install/langs/hu/install.php | 6 +++--- install/langs/id/install.php | 6 +++--- install/langs/it/install.php | 6 +++--- install/langs/lt/install.php | 6 +++--- install/langs/mk/install.php | 6 +++--- install/langs/nl/install.php | 6 +++--- install/langs/no/install.php | 6 +++--- install/langs/pl/install.php | 6 +++--- install/langs/pt/install.php | 6 +++--- install/langs/qc/install.php | 6 +++--- install/langs/ro/install.php | 6 +++--- install/langs/ru/install.php | 6 +++--- install/langs/si/install.php | 6 +++--- install/langs/sr/install.php | 6 +++--- install/langs/sv/install.php | 6 +++--- install/langs/tr/install.php | 6 +++--- install/langs/tw/install.php | 6 +++--- install/langs/vn/install.php | 6 +++--- install/langs/zh/install.php | 6 +++--- install/theme/views/process.phtml | 2 +- 33 files changed, 94 insertions(+), 94 deletions(-) diff --git a/admin/themes/default/template/controllers/dashboard/helpers/view/view.tpl b/admin/themes/default/template/controllers/dashboard/helpers/view/view.tpl index 593acfed7..b8574a4a9 100644 --- a/admin/themes/default/template/controllers/dashboard/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/dashboard/helpers/view/view.tpl @@ -128,7 +128,7 @@
-{/if} {*Disable Dates Model*} From f9073bc76116ff83884e2318b9a62f4117c75605 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 17 Jun 2025 13:08:04 +0530 Subject: [PATCH 39/42] Fixed: the services pop up is not updated if the admin adds new service in the order --- controllers/admin/AdminOrdersController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 8ee4d416b..8abdaba32 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -7708,10 +7708,10 @@ class AdminOrdersControllerCore extends AdminController $autoAdded = Tools::getValue('new_service_auto_added'); // adjust values for auto added services + $objOrderDetail = new OrderDetail($objHotelBookingDetail->id_order_detail); if ($autoAdded) { $productQty = 1; // check if booking room type tax rule is still exist - $objOrderDetail = new OrderDetail($objHotelBookingDetail->id_order_detail); if (Validate::isLoadedObject($objTaxRuleGroup = new TaxRulesGroup($objOrderDetail->id_tax_rules_group))) { $idTaxRuleGroup = $objOrderDetail->id_tax_rules_group; } From 5dc42c1022e681c0c78f722f883c4ed2461c17d9 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 17 Jun 2025 13:21:15 +0530 Subject: [PATCH 40/42] Fixed: wrong variable was used to get the service price tax incl while adding new service in the order in the back-office --- controllers/admin/AdminOrdersController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 8abdaba32..dc94527dc 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -7852,7 +7852,7 @@ class AdminOrdersControllerCore extends AdminController $objHotelBookingDetail->date_to, $objCart->id ) / $numDays; - $unitPriceTaxExcl = Product::getServiceProductPrice( + $unitPriceTaxIncl = Product::getServiceProductPrice( (int)$product['id_product'], 0, $roomHtlCartInfo['id_hotel'], From 47ba6acf765befe37d17682580f5c2f93634c23b Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 17 Jun 2025 15:08:24 +0530 Subject: [PATCH 41/42] Fixed: notices while trying to view invoice having no room or prododucts --- classes/pdf/HTMLTemplateInvoice.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classes/pdf/HTMLTemplateInvoice.php b/classes/pdf/HTMLTemplateInvoice.php index 4c0d096d9..c23fdd280 100644 --- a/classes/pdf/HTMLTemplateInvoice.php +++ b/classes/pdf/HTMLTemplateInvoice.php @@ -646,6 +646,8 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate $footer['additional_service_price_tax_incl'] =0; $footer['total_convenience_fee_te'] = 0; $footer['total_convenience_fee_ti'] = 0; + $footer['service_products_price_tax_excl'] = 0; + $footer['service_products_price_tax_incl'] = 0; if ($idsOrderDetail = array_column($order_details, 'id_order_detail')) { $footer['room_price_tax_excl'] = $this->order->getTotalProductsWithoutTaxes(false, true, null, null, null, $idsOrderDetail) + $this->order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_ROOM_TYPE, 1, Product::PRICE_ADDITION_TYPE_WITH_ROOM, $idsOrderDetail); $footer['room_price_tax_incl'] = $this->order->getTotalProductsWithTaxes(false, true, null, null, null, $idsOrderDetail) + $this->order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_ROOM_TYPE, 1, Product::PRICE_ADDITION_TYPE_WITH_ROOM, $idsOrderDetail); From 23d9418f24fedfe9fb508d73d8135bc93a478305 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 17 Jun 2025 15:12:38 +0530 Subject: [PATCH 42/42] Fixed: undefined error on room delete --- controllers/admin/AdminOrdersController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index dc94527dc..51b689b7f 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -6494,7 +6494,8 @@ class AdminOrdersControllerCore extends AdminController 'invoices_collection' => $invoice_collection, 'current_id_lang' => Context::getContext()->language->id, 'link' => Context::getContext()->link, - 'current_index' => self::$currentIndex + 'current_index' => self::$currentIndex, + 'can_edit' => ($this->tabAccess['edit'] === 1), )); $this->sendChangedNotification($order);