From afcf7821f3dc6ebc75c487f4679426a4c706368a Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 31 Jul 2023 12:24:01 +0530 Subject: [PATCH 01/29] Fix new voucher generation issue on order creation --- classes/PaymentModule.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index 3e89319f2..5e5fb6f52 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -646,17 +646,17 @@ abstract class PaymentModuleCore extends Module // THEN // The voucher is cloned with a new value corresponding to the remainder $reduction_amount_converted = $cart_rule['obj']->reduction_amount; - if ((int) $cart_rule['obj']->reduction_currency !== (int) $cart->id_currency) { + if ((int) $cart_rule['obj']->reduction_currency !== (int) $this->context->cart->id_currency) { $reduction_amount_converted = Tools::convertPriceFull( $cart_rule['obj']->reduction_amount, new Currency($cart_rule['obj']->reduction_currency), - new Currency($cart->id_currency) + new Currency($this->context->cart->id_currency) ); } if ($cart_rule['obj']->reduction_tax) { - $remaining_amount = $reduction_amount_converted - $values['tax_incl']; + $remaining_amount = $values['tax_incl'] - $order->total_products_wt; } else { - $remaining_amount = $reduction_amount_converted - $values['tax_excl']; + $remaining_amount = $values['tax_excl'] - $order->total_products; } if ($remaining_amount > 0 && $cart_rule['obj']->partial_use == 1 && $reduction_amount_converted > 0) { // Create a new voucher from the original From ecd3770301ef7f40ef129b3a22430e1f38abdb60 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 31 Jul 2023 12:44:28 +0530 Subject: [PATCH 02/29] Remove Description column --- themes/hotel-reservation-theme/discount.tpl | 2 -- 1 file changed, 2 deletions(-) diff --git a/themes/hotel-reservation-theme/discount.tpl b/themes/hotel-reservation-theme/discount.tpl index 25440cad7..9346ceb71 100644 --- a/themes/hotel-reservation-theme/discount.tpl +++ b/themes/hotel-reservation-theme/discount.tpl @@ -33,7 +33,6 @@ {l s='Code'} - {l s='Description'} {l s='Quantity'} {l s='Value'} {l s='Minimum'} @@ -45,7 +44,6 @@ {foreach from=$cart_rules item=discountDetail name=myLoop} {$discountDetail.code} - {$discountDetail.name} {$discountDetail.quantity_for_user} {if $discountDetail.reduction_percent > 0} From 6591732257b0c4f1fb09da217e83a8875d3d8050 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 1 Aug 2023 15:51:52 +0530 Subject: [PATCH 03/29] Allow POIs selection on Google Maps --- .../views/css/HotelReservationAdmin.css | 16 ++ .../views/js/HotelReservationAdmin.js | 139 +++++++++++++++--- 2 files changed, 132 insertions(+), 23 deletions(-) diff --git a/modules/hotelreservationsystem/views/css/HotelReservationAdmin.css b/modules/hotelreservationsystem/views/css/HotelReservationAdmin.css index 028ce74c1..99a26799c 100644 --- a/modules/hotelreservationsystem/views/css/HotelReservationAdmin.css +++ b/modules/hotelreservationsystem/views/css/HotelReservationAdmin.css @@ -472,6 +472,22 @@ p.room_cat_data border-color: #4d90fe; } +.gm-style-iw-d h6 { + font-family: unset; + font-size: 14px; + color: #333; + font-weight: 500; + margin: 0; +} + +.gm-style-iw-d p { + font-family: unset; + font-size: 13px; + color: #333; + font-weight: 400; + margin: 0; +} + /* ==== AdminHotelFeaturePricesSettingsController ==== */ .week_days { display: none; diff --git a/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js b/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js index b7e41a498..73e32cb01 100644 --- a/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js +++ b/modules/hotelreservationsystem/views/js/HotelReservationAdmin.js @@ -69,7 +69,8 @@ var GoogleMapsManager = { var that = this; that.setDefaultLatLng(function() { that.map = new google.maps.Map($(that.mapDiv).get(0), { - zoom: that.defaultZoom + zoom: that.defaultZoom, + clickableIcons: true, }); that.map.setCenter(that.defaultLatLng); if (that.defaultLatLng && that.formattedAddress) { @@ -80,11 +81,78 @@ var GoogleMapsManager = { // register marker events that.map.addListener('click', function (e) { var latLng = e.latLng; - that.geocoder.geocode({ location: latLng }, function (results, status) { - if (status == google.maps.GeocoderStatus.OK && results[0]) { - that.addMarker(latLng, results[0]); - } - }); + + var isInfoWindowNeeded = true; + // if it is a Place Of Interest (POI), event contains the property 'placeId' + if (Object.hasOwn(e, 'placeId')) { + isInfoWindowNeeded = false; + + that.geocoder.geocode({ location: latLng }, function (results, status) { + if (status == google.maps.GeocoderStatus.OK && results[0]) { + var request = { + placeId: e.placeId, + fields: ['name'], + }; + + that.placesService.getDetails(request, function(place, status) { + if (status === google.maps.places.PlacesServiceStatus.OK) { + var content = '
' + place.name + '

' + + results[0].formatted_address + '

'; + + var callback = function (latLng) { + that.setFormVars({ + lat: latLng.lat(), + lng: latLng.lng(), + formattedAddress: content, + inputText: $('#pac-input').val(), + }); + } + + that.addMarker( + latLng, + results[0], + null, + isInfoWindowNeeded, + callback(latLng) + ); + } + }); + } + }); + } else { + that.geocoder.geocode({ location: latLng }, function (results, status) { + if (status == google.maps.GeocoderStatus.OK && results[0]) { + var request = { + placeId: results[0].place_id, + fields: ['name'], + }; + + that.placesService.getDetails(request, function(place, status) { + if (status === google.maps.places.PlacesServiceStatus.OK) { + var content = '
' + place.name + '

' + + results[0].formatted_address + '

'; + + var callback = function (latLng) { + that.setFormVars({ + lat: latLng.lat(), + lng: latLng.lng(), + formattedAddress: content, + inputText: $('#pac-input').val(), + }); + } + + that.addMarker( + latLng, + results[0], + null, + isInfoWindowNeeded, + callback(latLng) + ); + } + }); + } + }); + } }); if(cb && typeof cb === 'function') { cb(); @@ -122,7 +190,7 @@ var GoogleMapsManager = { }; that.addMarker(latLng, place); - var content = '
' + place.name + '
' + place.formatted_address; + var content = '
' + place.name + '

' + place.formatted_address + '

'; that.setFormVars({ lat: latLng.lat, lng: latLng.lng, @@ -142,7 +210,7 @@ var GoogleMapsManager = { } }); }, - addMarker: function(latLng, address = null, fa = null, cb = null) { + addMarker: function(latLng, address = null, fa = null, addInfoWindow = true, cb = null) { var that = this; that.clearAllMarkers(); var marker = new google.maps.Marker({ @@ -163,23 +231,36 @@ var GoogleMapsManager = { }); }); - if (address === null && fa) { - // open info window - that.addInfoWindow(marker, fa); + if (addInfoWindow) { + if (address === null && fa) { + // open info window + that.addInfoWindow(marker, fa); + } else { + var request = { + placeId: address.place_id, + fields: ['name'], + }; + + that.placesService.getDetails(request, function(place, status) { + if (status === google.maps.places.PlacesServiceStatus.OK) { + // open info window + var content = '
' + place.name + '

' + address.formatted_address + '

'; + that.addInfoWindow(marker, content); + + if(cb && typeof cb === 'function') { + cb(); + } + } + }); + } } else { - var request = { - placeId: address.place_id, - fields: ['name'], - }; - that.placesService.getDetails(request, function(place, status) { - if (status === google.maps.places.PlacesServiceStatus.OK) { - // open info window - var content = '
' + place.name + '
' + - address.formatted_address + '
'; - that.addInfoWindow(marker, content); - } - }); + if(cb && typeof cb === 'function') { + cb(); + } + + return marker; } + }, clearAllMarkers: function() { for (var i = 0; i < this.markers.length; i++) { @@ -190,13 +271,21 @@ var GoogleMapsManager = { addInfoWindow: function(marker, content) { if (typeof google === 'object') { var that = this; + var infoWindow = new google.maps.InfoWindow({ content: content, + maxWidth: 200, }); + infoWindow.open({ anchor: marker, map: that.map }); + + google.maps.event.addListener(infoWindow, 'closeclick', function () { + that.clearAllMarkers(); + }); + var latLng = marker.getPosition(); that.setFormVars({ lat: latLng.lat(), @@ -214,6 +303,10 @@ var GoogleMapsManager = { }, } +$(document).on('click', 'button.gm-ui-hover-effect', function () { + GoogleMapsManager.clearAllMarkers(); +}); + function initGoogleMaps() { if (typeof enabledDisplayMap != 'undefined' && typeof google === 'object' From 0c291869eb96fc3d78914004aefcc67b563dc41e Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 1 Aug 2023 19:36:10 +0530 Subject: [PATCH 04/29] Fix PHP notice on Catalog Price Rules page --- .../admin/AdminSpecificPriceRuleController.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/controllers/admin/AdminSpecificPriceRuleController.php b/controllers/admin/AdminSpecificPriceRuleController.php index a1185a717..7edda5d93 100644 --- a/controllers/admin/AdminSpecificPriceRuleController.php +++ b/controllers/admin/AdminSpecificPriceRuleController.php @@ -286,16 +286,21 @@ class AdminSpecificPriceRuleControllerCore extends AdminController 'title' => $this->l('Save') ), ); - if (($value = $this->getFieldValue($this->object, 'price')) != -1) { - $price = number_format($value, 6); + + $price = $this->getFieldValue($this->object, 'price'); + if ($price != -1 && floatval($price) != 0) { + $price = number_format($price, 6); } else { $price = ''; } + $reduction = floatval($this->getFieldValue($this->object, 'reduction')); + $reduction = number_format($reduction, 6); + $this->fields_value = array( 'price' => $price, 'from_quantity' => (($value = $this->getFieldValue($this->object, 'from_quantity')) ? $value : 1), - 'reduction' => number_format((($value = $this->getFieldValue($this->object, 'reduction')) ? $value : 0), 6), + 'reduction' => $reduction, 'leave_bprice_on' => $price ? 0 : 1, 'shop_id' => (($value = $this->getFieldValue($this->object, 'id_shop')) ? $value : 1) ); From 1259b64fa542070fe0f2beecb226b805258c8a44 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Wed, 2 Aug 2023 12:58:58 +0530 Subject: [PATCH 05/29] Fix cart issue on Book Now page --- .../controllers/admin/AdminHotelRoomsBookingController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php index 6146e43f4..f2612b7f2 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php @@ -44,8 +44,12 @@ class AdminHotelRoomsBookingController extends ModuleAdminController $this->context->cookie->id_cart = (int) $objCart->id; } else { // use previous cart - if (!validate::isLoadedObject($objCart = new Cart($this->context->cookie->id_cart))) { + $objCart = new Cart($this->context->cookie->id_cart); + if (!Validate::isLoadedObject($objCart) + || (Validate::isLoadedObject($objCart) && $objCart->orderExists()) + ) { $objCart = $this->createNewCart(); + $this->context->cookie->id_cart = (int) $objCart->id; } } $this->context->cart = $objCart; From 41df7e42fd457369321e9874762d972440ab07fb Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 3 Aug 2023 11:26:15 +0530 Subject: [PATCH 06/29] Fix PHP warning due to occupancy query parameter in URL --- classes/controller/FrontController.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php index 2f19b9f61..f9e4338ef 100644 --- a/classes/controller/FrontController.php +++ b/classes/controller/FrontController.php @@ -917,11 +917,19 @@ class FrontControllerCore extends Controller } $excluded_key = array('isolang', 'id_lang', 'controller', 'fc', 'id_product', 'id_category', 'id_manufacturer', 'id_supplier', 'id_cms'); foreach ($_GET as $key => $value) { - if (!in_array($key, $excluded_key) && Validate::isUrl($key) && Validate::isUrl($value)) { - $params[Tools::safeOutput($key)] = Tools::safeOutput($value); + if (!in_array($key, $excluded_key)) { + if (is_string($value)) { + if (Validate::isUrl($key) && Validate::isUrl($value)) { + $params[Tools::safeOutput($key)] = Tools::safeOutput($value); + } + } else { + $tempValue = http_build_query($value); + if (Validate::isUrl($key) && Validate::isUrl($tempValue)) { + $params[Tools::safeOutput($key)] = $value; + } + } } } - $str_params = http_build_query($params, '', '&'); if (!empty($str_params)) { $final_url = preg_replace('/^([^?]*)?.*$/', '$1', $canonical_url).'?'.$str_params; From 9a653a813f9d5caf07065a1585c6684952082470 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 4 Aug 2023 12:03:16 +0530 Subject: [PATCH 07/29] Restrict hotel and room type image uploads to allowed formats --- .../template/controllers/products/helpers/uploader/ajax.tpl | 2 +- .../views/templates/admin/add_hotel/helpers/form/form.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/themes/default/template/controllers/products/helpers/uploader/ajax.tpl b/admin/themes/default/template/controllers/products/helpers/uploader/ajax.tpl index 240e46188..2cf9f62b4 100644 --- a/admin/themes/default/template/controllers/products/helpers/uploader/ajax.tpl +++ b/admin/themes/default/template/controllers/products/helpers/uploader/ajax.tpl @@ -24,7 +24,7 @@ *}
- + diff --git a/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl b/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl index d9b047f82..9ab60f03f 100644 --- a/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl @@ -296,7 +296,7 @@ {l s='Upload images' mod='hotelreservationsystem'} :  
- +

From 3366f35b907559cdbdf830b4d0419924b40e6de5 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 4 Aug 2023 16:46:17 +0530 Subject: [PATCH 08/29] Redirect free order to order confirmation page --- .../front/OrderConfirmationController.php | 15 ++++++++++++--- controllers/front/OrderOpcController.php | 11 ++++++++++- .../hotel-reservation-theme/js/order-opc.js | 19 +++++++++---------- .../order-confirmation.tpl | 3 +++ themes/hotel-reservation-theme/order-opc.tpl | 1 - 5 files changed, 34 insertions(+), 15 deletions(-) diff --git a/controllers/front/OrderConfirmationController.php b/controllers/front/OrderConfirmationController.php index 560e8c444..ba932fc3f 100644 --- a/controllers/front/OrderConfirmationController.php +++ b/controllers/front/OrderConfirmationController.php @@ -67,9 +67,16 @@ class OrderConfirmationControllerCore extends FrontController if (!Validate::isLoadedObject($order) || $order->id_customer != $this->context->customer->id || $this->secure_key != $order->secure_key) { Tools::redirect($redirectLink); } - $module = Module::getInstanceById((int)($this->id_module)); - if ($order->module != $module->name) { - Tools::redirect($redirectLink); + + if ($this->id_module == -1) { + if ($order->module != 'free_order') { + Tools::redirect($redirectLink); + } + } else { + $module = Module::getInstanceById((int)($this->id_module)); + if ($order->module != $module->name) { + Tools::redirect($redirectLink); + } } } @@ -83,6 +90,7 @@ class OrderConfirmationControllerCore extends FrontController $this->context->smarty->assign(array( 'is_guest' => $this->context->customer->is_guest, + 'is_free_order' => 1, 'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(), 'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn() )); @@ -405,6 +413,7 @@ class OrderConfirmationControllerCore extends FrontController $this->context->smarty->assign( array( 'refund_allowed' => (int) $order->isReturnable(), + 'is_free_order' => $this->id_module == -1 && $order->module == 'free_order', 'any_back_order' => $any_back_order, 'shw_bo_msg' => $shw_bo_msg, 'back_ord_msg' => $bo_msg, diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index 17ef02dcb..38e7393fd 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -221,10 +221,19 @@ class OrderOpcControllerCore extends ParentOrderController if (($id_order = $this->_checkFreeOrder()) && $id_order) { $order = new Order((int)$id_order); $email = $this->context->customer->email; + $orderConfirmationUrl = $this->context->link->getPageLink('order-confirmation').'?id_cart='.$order->id_cart.'&id_module=-1'.'&id_order='.$id_order.'&key='.$order->secure_key; if ($this->context->customer->is_guest) { $this->context->customer->logout(); } // If guest we clear the cookie for security reason - $this->ajaxDie('freeorder:'.$order->reference.':'.$email); + + $return = array( + 'success' => true, + 'reference' => $order->reference, + 'email' => $email, + 'order_confirmation_url' => $orderConfirmationUrl, + ); + + $this->ajaxDie(json_encode($return)); } exit; break; diff --git a/themes/hotel-reservation-theme/js/order-opc.js b/themes/hotel-reservation-theme/js/order-opc.js index 0649a68dd..a0ce3df05 100644 --- a/themes/hotel-reservation-theme/js/order-opc.js +++ b/themes/hotel-reservation-theme/js/order-opc.js @@ -912,18 +912,17 @@ function confirmFreeOrder() url: orderOpcUrl + '?rand=' + new Date().getTime(), async: true, cache: false, - dataType : "html", + dataType : 'JSON', data: 'ajax=true&method=makeFreeOrder&token=' + static_token , - success: function(html) + success: function(response) { - $('#confirmOrder').prop('disabled', false); - var array_split = html.split(':'); - if (array_split[0] == 'freeorder') - { - if (isGuest) - document.location.href = guestTrackingUrl+'?id_order='+encodeURIComponent(array_split[1])+'&email='+encodeURIComponent(array_split[2]); - else - document.location.href = historyUrl; + if (response.success) { + $('#confirmOrder').prop('disabled', false); + if (isGuest) { + document.location.href = guestTrackingUrl+'?id_order='+encodeURIComponent(response.reference)+'&email='+encodeURIComponent(response.email); + } else { + document.location.href = response.order_confirmation_url; + } } }, error: function(XMLHttpRequest, textStatus, errorThrown) { diff --git a/themes/hotel-reservation-theme/order-confirmation.tpl b/themes/hotel-reservation-theme/order-confirmation.tpl index 23ac2a1fa..093669112 100644 --- a/themes/hotel-reservation-theme/order-confirmation.tpl +++ b/themes/hotel-reservation-theme/order-confirmation.tpl @@ -42,6 +42,9 @@ {l s='Follow my order'}

{else} + {if isset($is_free_order) && $is_free_order} +

{l s='Your order on %s is complete.' sprintf=$shop_name}


+ {/if}

{l s='Order Status :'} {l s='Confirmed'}

{l s='Order Reference :'} {$order->reference}

{if $any_back_order} diff --git a/themes/hotel-reservation-theme/order-opc.tpl b/themes/hotel-reservation-theme/order-opc.tpl index 8cdc91e23..72c2bec65 100644 --- a/themes/hotel-reservation-theme/order-opc.tpl +++ b/themes/hotel-reservation-theme/order-opc.tpl @@ -460,7 +460,6 @@ {addJsDef imgDir=$img_dir} {addJsDef authenticationUrl=$link->getPageLink("authentication", true)|escape:'quotes':'UTF-8'} {addJsDef orderOpcUrl=$link->getPageLink("order-opc", true)|escape:'quotes':'UTF-8'} - {addJsDef historyUrl=$link->getPageLink("history", true)|escape:'quotes':'UTF-8'} {addJsDef guestTrackingUrl=$link->getPageLink("guest-tracking", true)|escape:'quotes':'UTF-8'} {addJsDef addressUrl=$link->getPageLink("address", true, NULL, "back={$back_order_page}")|escape:'quotes':'UTF-8'} {addJsDef orderProcess='order-opc'} From 0e800b10b745e96c99ed04a65cbd11633cba4f6f Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 4 Aug 2023 18:17:49 +0530 Subject: [PATCH 09/29] Redirect to Page not found for invalid category page URL --- controllers/front/CategoryController.php | 2 +- modules/wkhotelfilterblock/wkhotelfilterblock.php | 4 +++- modules/wkroomsearchblock/wkroomsearchblock.php | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/controllers/front/CategoryController.php b/controllers/front/CategoryController.php index 026ae648a..8fdd7d644 100644 --- a/controllers/front/CategoryController.php +++ b/controllers/front/CategoryController.php @@ -211,7 +211,7 @@ class CategoryControllerCore extends FrontController 'order_date_restrict' => $order_date_restrict )); } else { - Tools::redirect($this->context->link->getPageLink('index')); + Tools::redirect($this->context->link->getPageLink('pagenotfound')); } $feat_img_dir = _PS_IMG_.'rf/'; diff --git a/modules/wkhotelfilterblock/wkhotelfilterblock.php b/modules/wkhotelfilterblock/wkhotelfilterblock.php index e2fa40f38..4de61ef00 100644 --- a/modules/wkhotelfilterblock/wkhotelfilterblock.php +++ b/modules/wkhotelfilterblock/wkhotelfilterblock.php @@ -64,7 +64,9 @@ class wkhotelfilterblock extends Module if ($this->context->controller->php_self == 'category') { $htl_id_category = Tools::getValue('id_category'); - if (Validate::isLoadedObject($objCategory = new Category((int) $htl_id_category))) { + if (Validate::isLoadedObject($objCategory = new Category((int) $htl_id_category)) + && HotelBranchInformation::getHotelIdByIdCategory($htl_id_category) + ) { if ($objCategory->hasParent(Configuration::get('PS_LOCATIONS_CATEGORY'))) { Media::addJsDef(array('noRoomAvailTxt' => $this->l('No room available', false, true))); diff --git a/modules/wkroomsearchblock/wkroomsearchblock.php b/modules/wkroomsearchblock/wkroomsearchblock.php index f40e7f0f1..dc696e4af 100644 --- a/modules/wkroomsearchblock/wkroomsearchblock.php +++ b/modules/wkroomsearchblock/wkroomsearchblock.php @@ -124,7 +124,9 @@ class WkRoomSearchBlock extends Module { if ('category' == Tools::getValue('controller')) { $idCategory = Tools::getValue('id_category'); - if (Validate::isLoadedObject($objCategory = new Category((int) $idCategory))) { + if (Validate::isLoadedObject($objCategory = new Category((int) $idCategory)) + && HotelBranchInformation::getHotelIdByIdCategory($idCategory) + ) { if ($objCategory->hasParent(Configuration::get('PS_LOCATIONS_CATEGORY'))) { $objSearchHelper = new WkRoomSearchHelper(); $objSearchHelper->assignSearchPanelVariables(); From e0cf48db07100a6f9e9ef950c4a2f06091c9af04 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 8 Aug 2023 15:56:50 +0530 Subject: [PATCH 10/29] Fix Phone number edit issue by guest --- controllers/front/OrderOpcController.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index 17ef02dcb..c80313b1c 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -117,10 +117,29 @@ class OrderOpcControllerCore extends ParentOrderController $_POST['lastname'] = $_POST['customer_lastname']; $_POST['firstname'] = $_POST['customer_firstname']; - $this->errors = array_merge($this->errors, $this->context->customer->validateController()); $this->context->customer->newsletter = (int)Tools::isSubmit('newsletter'); $this->context->customer->optin = (int)Tools::isSubmit('optin'); $this->context->customer->is_guest = (Tools::isSubmit('is_new_customer') ? !Tools::getValue('is_new_customer', 1) : 0); + + if ($idAddressDelivery = Tools::getValue('opc_id_address_delivery')) { + $objAddress = new Address($idAddressDelivery); + if (Validate::isLoadedObject($objAddress)) { + $phoneMobile = Tools::getValue('phone_mobile'); + + if (!Validate::isPhoneNumber($phoneMobile)) { + $this->errors[] = Tools::displayError('Please enter a valid Mobile phone number.', false); + } + + if (!count($this->errors)) { + $objAddress->phone_mobile = $phoneMobile; + if (!$objAddress->save()) { + $this->errors[] = Tools::displayError('Something went wrong while saving phone number. Please try again.', false); + } + } + } + } + + $this->errors = array_merge($this->errors, $this->context->customer->validateController()); $return = array( 'hasError' => !empty($this->errors), 'errors' => $this->errors, From c5c346e2c3c5d048d892f1f4bb973bb70d176ed9 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Wed, 9 Aug 2023 13:20:38 +0530 Subject: [PATCH 11/29] Add breadcrumbs on my acount pages --- controllers/front/AddressController.php | 2 ++ controllers/front/DiscountController.php | 2 ++ controllers/front/HistoryController.php | 2 ++ controllers/front/IdentityController.php | 2 ++ controllers/front/OrderFollowController.php | 3 ++- controllers/front/OrderSlipController.php | 2 ++ themes/hotel-reservation-theme/address.tpl | 12 +++++++++++- 7 files changed, 23 insertions(+), 2 deletions(-) diff --git a/controllers/front/AddressController.php b/controllers/front/AddressController.php index 3fd2107ee..29a2ba952 100644 --- a/controllers/front/AddressController.php +++ b/controllers/front/AddressController.php @@ -221,6 +221,8 @@ class AddressControllerCore extends FrontController */ public function initContent() { + $this->show_breadcrump = true; + parent::initContent(); $this->assignCountries(); diff --git a/controllers/front/DiscountController.php b/controllers/front/DiscountController.php index f6853470f..89f93a3cb 100644 --- a/controllers/front/DiscountController.php +++ b/controllers/front/DiscountController.php @@ -37,6 +37,8 @@ class DiscountControllerCore extends FrontController */ public function initContent() { + $this->show_breadcrump = true; + parent::initContent(); $cart_rules = CartRule::getCustomerCartRules($this->context->language->id, $this->context->customer->id, true, false, true); diff --git a/controllers/front/HistoryController.php b/controllers/front/HistoryController.php index 397325c41..e3a8210e4 100644 --- a/controllers/front/HistoryController.php +++ b/controllers/front/HistoryController.php @@ -53,6 +53,8 @@ class HistoryControllerCore extends FrontController */ public function initContent() { + $this->show_breadcrump = true; + parent::initContent(); if ($orders = Order::getCustomerOrders($this->context->customer->id)) { foreach ($orders as &$order) { diff --git a/controllers/front/IdentityController.php b/controllers/front/IdentityController.php index ea8c2af16..5da8ccbd9 100644 --- a/controllers/front/IdentityController.php +++ b/controllers/front/IdentityController.php @@ -126,6 +126,8 @@ class IdentityControllerCore extends FrontController */ public function initContent() { + $this->show_breadcrump = true; + parent::initContent(); if ($this->customer->birthday) { diff --git a/controllers/front/OrderFollowController.php b/controllers/front/OrderFollowController.php index 9247f7749..7bb79d54d 100644 --- a/controllers/front/OrderFollowController.php +++ b/controllers/front/OrderFollowController.php @@ -37,8 +37,9 @@ class OrderFollowControllerCore extends FrontController */ public function initContent() { - parent::initContent(); $this->show_breadcrump = true; + + parent::initContent(); if (isset($this->context->customer->id) && $this->context->customer->id) { $ordersReturns = OrderReturn::getOrdersReturn($this->context->customer->id, Tools::getValue('id_order')); $this->context->smarty->assign('ordersReturns', $ordersReturns); diff --git a/controllers/front/OrderSlipController.php b/controllers/front/OrderSlipController.php index 2b33b6cad..32e283fbe 100644 --- a/controllers/front/OrderSlipController.php +++ b/controllers/front/OrderSlipController.php @@ -48,6 +48,8 @@ class OrderSlipControllerCore extends FrontController */ public function initContent() { + $this->show_breadcrump = true; + parent::initContent(); $this->context->smarty->assign('ordersSlip', OrderSlip::getOrdersSlip((int)$this->context->cookie->id_customer)); diff --git a/themes/hotel-reservation-theme/address.tpl b/themes/hotel-reservation-theme/address.tpl index 3e3e9da78..a4725fb11 100644 --- a/themes/hotel-reservation-theme/address.tpl +++ b/themes/hotel-reservation-theme/address.tpl @@ -22,7 +22,17 @@ * @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='Your address'}{/capture} +{capture name=path} + + {l s='My account'} + + + {$navigationPipe} + + + {l s='My address'} + +{/capture} {if isset($smarty.get.updated) && $smarty.get.updated}

{l s='Your address has been successfully updated.'} From 6052d4c305016c46e225e01b187f0c6f745128d6 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 10 Aug 2023 18:00:29 +0530 Subject: [PATCH 12/29] Fi search for Service Products using search box --- controllers/admin/AdminSearchController.php | 31 +++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminSearchController.php b/controllers/admin/AdminSearchController.php index 2b9e2b5eb..b0a312832 100644 --- a/controllers/admin/AdminSearchController.php +++ b/controllers/admin/AdminSearchController.php @@ -171,9 +171,36 @@ class AdminSearchControllerCore extends AdminController $this->context = Context::getContext(); if ($this->_list['products'] = Product::searchByName($this->context->language->id, $this->query)) { $objRoomType = new HotelRoomType(); + $objRoomTypeServiceProduct = new RoomTypeServiceProduct(); + $accessibleHotels = HotelBranchInformation::getProfileAccessedHotels( + $this->context->employee->id_profile, + 1, + 1 + ); + foreach ($this->_list['products'] as $key => $product) { - $roomInfo = $objRoomType->getRoomTypeInfoByIdProduct($product['id_product']); - if (!in_array($roomInfo['id_hotel'], HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 1))) { + $toUnset = false; + if ($product['booking_product']) { + $roomInfo = $objRoomType->getRoomTypeInfoByIdProduct($product['id_product']); + if (!in_array($roomInfo['id_hotel'], $accessibleHotels)) { + $toUnset = true; + } + } else { + $associations = $objRoomTypeServiceProduct->getAssociatedHotelsAndRoomType($product['id_product']); + // proceed only if access can not be determined from hotels + if (!count(array_intersect($associations['hotels'], $accessibleHotels))) { + $toUnset = true; + foreach ($associations['room_types'] as $idProduct) { + $roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($idProduct); + if (in_array($roomTypeInfo['id_hotel'], $accessibleHotels)) { + $toUnset = false; + break; + } + } + } + } + + if ($toUnset) { unset($this->_list['products'][$key]); } } From eecfa818651812fe7797a2cc59ca3ec2f5cab547 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 24 Aug 2023 18:37:47 +0530 Subject: [PATCH 13/29] Do not show service products in rooms display block search --- admin/ajax_products_list.php | 3 +++ modules/wkhotelroom/views/js/WkHotelRoomBlockAdmin.js | 1 + 2 files changed, 4 insertions(+) diff --git a/admin/ajax_products_list.php b/admin/ajax_products_list.php index 03a5f4999..98f9647cb 100644 --- a/admin/ajax_products_list.php +++ b/admin/ajax_products_list.php @@ -58,6 +58,8 @@ if ($excludeIds && $excludeIds != 'NaN') { $excludeVirtuals = (bool)Tools::getValue('excludeVirtuals', true); $exclude_packs = (bool)Tools::getValue('exclude_packs', true); +$bookingProduct = (int) Tools::getValue('booking_product'); + $context = Context::getContext(); $sql = 'SELECT p.`id_product`, pl.`link_rewrite`, p.`reference`, pl.`name`, image_shop.`id_image` id_image, il.`legend`, p.`cache_default_attribute` @@ -72,6 +74,7 @@ $sql = 'SELECT p.`id_product`, pl.`link_rewrite`, p.`reference`, pl.`name`, imag (!empty($excludePackItself) ? ' AND p.id_product <> '.$excludePackItself.' ' : ' '). ($excludeVirtuals ? 'AND NOT EXISTS (SELECT 1 FROM `'._DB_PREFIX_.'product_download` pd WHERE (pd.id_product = p.id_product))' : ''). ($exclude_packs ? 'AND (p.cache_is_pack IS NULL OR p.cache_is_pack = 0)' : ''). + ($bookingProduct ? 'AND p.`booking_product` = '.(int) $bookingProduct : ''). ' GROUP BY p.id_product'; $items = Db::getInstance()->executeS($sql); diff --git a/modules/wkhotelroom/views/js/WkHotelRoomBlockAdmin.js b/modules/wkhotelroom/views/js/WkHotelRoomBlockAdmin.js index 3bec54859..7aee0d3a2 100644 --- a/modules/wkhotelroom/views/js/WkHotelRoomBlockAdmin.js +++ b/modules/wkhotelroom/views/js/WkHotelRoomBlockAdmin.js @@ -38,6 +38,7 @@ $(document).ready(function() { data: { q: word, _: n, + booking_product: '1', }, success: function(result) { if (result) { From 0d39f0922c1a3a35fe1fd172d7b405c0658d437c Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 7 Sep 2023 09:37:47 +0530 Subject: [PATCH 14/29] Fix PHP notice on COnfiguration Information page at back office --- .../template/controllers/information/helpers/view/view.tpl | 2 +- classes/ConfigurationTest.php | 6 ------ controllers/admin/AdminInformationController.php | 1 - install/controllers/http/system.php | 1 - 4 files changed, 1 insertion(+), 9 deletions(-) diff --git a/admin/themes/default/template/controllers/information/helpers/view/view.tpl b/admin/themes/default/template/controllers/information/helpers/view/view.tpl index d142e68a6..463806b60 100644 --- a/admin/themes/default/template/controllers/information/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/information/helpers/view/view.tpl @@ -84,7 +84,7 @@ {l s='Server information'} - {if count($uname)} + {if Tools::strlen($uname) > 0}

{l s='Server information:'} {$uname|escape:'html':'UTF-8'}

diff --git a/classes/ConfigurationTest.php b/classes/ConfigurationTest.php index 60628b646..98bdaeb44 100644 --- a/classes/ConfigurationTest.php +++ b/classes/ConfigurationTest.php @@ -115,7 +115,6 @@ class ConfigurationTestCore 'register_globals' => false, 'gz' => false, 'mbstring' => false, - 'magicquotes' => false, 'dom' => false, ); } @@ -181,11 +180,6 @@ class ConfigurationTestCore return extension_loaded('simplexml'); } - public static function test_magicquotes() - { - return function_exists('get_magic_quotes_gpc') ? !get_magic_quotes_gpc() : true; - } - public static function test_upload() { return ini_get('file_uploads'); diff --git a/controllers/admin/AdminInformationController.php b/controllers/admin/AdminInformationController.php index e21e398c1..0dba7d135 100644 --- a/controllers/admin/AdminInformationController.php +++ b/controllers/admin/AdminInformationController.php @@ -140,7 +140,6 @@ class AdminInformationControllerCore extends AdminController 'upload_max_filesize' => $this->l('In PHP configuration set upload_max_filesize to minimum 16M.'), 'max_execution_time' => $this->l('In PHP configuration set max_execution_time to minimum 500.'), 'mbstring' => $this->l('PHP Mbstring extension is not enabled.'), - 'magicquotes' => $this->l('PHP magic quotes option is enabled.'), 'dom' => $this->l('PHP DOM extension is not loaded.'), ); diff --git a/install/controllers/http/system.php b/install/controllers/http/system.php index 950f93247..98019b64e 100644 --- a/install/controllers/http/system.php +++ b/install/controllers/http/system.php @@ -137,7 +137,6 @@ class InstallControllerHttpSystem extends InstallControllerHttp 'register_globals' => $this->l('PHP register_globals option is enabled'), 'gz' => $this->l('GZIP compression is not activated'), 'mbstring' => $this->l('Mbstring extension is not enabled'), - 'magicquotes' => $this->l('PHP magic quotes option is enabled'), 'dom' => $this->l('Dom extension is not loaded'), ) ), From acab408a4e9d73b71c7e75db95ef51f504fd1214 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 15 Sep 2023 18:21:47 +0530 Subject: [PATCH 15/29] Remove voucher description from checkout page --- themes/hotel-reservation-theme/css/order-opc.css | 5 ----- themes/hotel-reservation-theme/order-opc.tpl | 1 - 2 files changed, 6 deletions(-) diff --git a/themes/hotel-reservation-theme/css/order-opc.css b/themes/hotel-reservation-theme/css/order-opc.css index 560d3ae92..dd4c0756d 100644 --- a/themes/hotel-reservation-theme/css/order-opc.css +++ b/themes/hotel-reservation-theme/css/order-opc.css @@ -409,11 +409,6 @@ font-size: 14px; color: #0000FF; } -#order-opc .avail_vouchers_block .avail_voucher_des { - font-size: 12px; - color: #777777; - margin-bottom: 2px; -} #order-opc .avail_vouchers_block .seperator { margin-top: 10px; margin-bottom: 10px; diff --git a/themes/hotel-reservation-theme/order-opc.tpl b/themes/hotel-reservation-theme/order-opc.tpl index 8cdc91e23..9a252401e 100644 --- a/themes/hotel-reservation-theme/order-opc.tpl +++ b/themes/hotel-reservation-theme/order-opc.tpl @@ -437,7 +437,6 @@

{$voucher.code|escape:'html':'UTF-8'} - {$voucher.name}

-

{$voucher['description']}

{if not $smarty.foreach.availVoucher.last}
{/if} From 0aeb8be718352ed894cea82b5b1ac3c17110eaf2 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 18 Sep 2023 15:55:29 +0530 Subject: [PATCH 16/29] Fixed: Admin is unable to set empty birthday for a customer --- controllers/admin/AdminCustomersController.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index b7078a0f1..e4eaac7de 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -966,6 +966,21 @@ class AdminCustomersControllerCore extends AdminController return parent::processSave(); } + protected function copyFromPost(&$object, $table) + { + parent::copyFromPost($object, $table); + + $years = Tools::getValue('years'); + $months = Tools::getValue('months'); + $days = Tools::getValue('days'); + + if ($years != '' && $months != '' && $days != '') { + $object->birthday = (int) $years.'-'.(int) $months.'-'.(int) $days; + } elseif ($years == '' && $months == '' && $days == '') { + $object->birthday = null; + } + } + protected function afterDelete($object, $old_id) { $customer = new Customer($old_id); From ef07cfe5e42b06fbc3eb182bf27f681d82778cf6 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 22 Sep 2023 16:30:01 +0530 Subject: [PATCH 17/29] Update discount.tpl --- themes/hotel-reservation-theme/discount.tpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/themes/hotel-reservation-theme/discount.tpl b/themes/hotel-reservation-theme/discount.tpl index 9346ceb71..81149de30 100644 --- a/themes/hotel-reservation-theme/discount.tpl +++ b/themes/hotel-reservation-theme/discount.tpl @@ -33,6 +33,7 @@ {l s='Code'} + {l s='Name'} {l s='Quantity'} {l s='Value'} {l s='Minimum'} @@ -44,6 +45,7 @@ {foreach from=$cart_rules item=discountDetail name=myLoop} {$discountDetail.code} + {$discountDetail.name} {$discountDetail.quantity_for_user} {if $discountDetail.reduction_percent > 0} From 84f31d5af49c4b9eaf024064aee727d895300533 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 22 Sep 2023 16:43:35 +0530 Subject: [PATCH 18/29] Update AdminSpecificPriceRuleController.php --- controllers/admin/AdminSpecificPriceRuleController.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/controllers/admin/AdminSpecificPriceRuleController.php b/controllers/admin/AdminSpecificPriceRuleController.php index 7edda5d93..fd45236ba 100644 --- a/controllers/admin/AdminSpecificPriceRuleController.php +++ b/controllers/admin/AdminSpecificPriceRuleController.php @@ -288,14 +288,18 @@ class AdminSpecificPriceRuleControllerCore extends AdminController ); $price = $this->getFieldValue($this->object, 'price'); - if ($price != -1 && floatval($price) != 0) { + if ($price != -1 && Validate::isPrice($price)) { $price = number_format($price, 6); } else { $price = ''; } - $reduction = floatval($this->getFieldValue($this->object, 'reduction')); - $reduction = number_format($reduction, 6); + $reduction = $this->getFieldValue($this->object, 'reduction'); + if (Validate::isPrice($reduction)) { + $reduction = number_format($reduction, 6); + } else { + $reduction = 0; + } $this->fields_value = array( 'price' => $price, From 5f1840f0ad6d3b6fe8f8b7f09ec527ef583f8987 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 22 Sep 2023 16:48:54 +0530 Subject: [PATCH 19/29] Update AdminHotelRoomsBookingController.php --- .../controllers/admin/AdminHotelRoomsBookingController.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php index f2612b7f2..bfa2d1f71 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php @@ -45,9 +45,8 @@ class AdminHotelRoomsBookingController extends ModuleAdminController } else { // use previous cart $objCart = new Cart($this->context->cookie->id_cart); - if (!Validate::isLoadedObject($objCart) - || (Validate::isLoadedObject($objCart) && $objCart->orderExists()) - ) { + $isCartValid = Validate::isLoadedObject($objCart); + if (!$isCartValid || ($isCartValid && $objCart->orderExists())) { $objCart = $this->createNewCart(); $this->context->cookie->id_cart = (int) $objCart->id; } From 400580838288e217153ff5ca0decd4849248e16b Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 26 Sep 2023 10:19:41 +0530 Subject: [PATCH 20/29] ALlow array in URL param --- classes/controller/FrontController.php | 30 ++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php index f9e4338ef..80e33e72e 100644 --- a/classes/controller/FrontController.php +++ b/classes/controller/FrontController.php @@ -918,18 +918,18 @@ class FrontControllerCore extends Controller $excluded_key = array('isolang', 'id_lang', 'controller', 'fc', 'id_product', 'id_category', 'id_manufacturer', 'id_supplier', 'id_cms'); foreach ($_GET as $key => $value) { if (!in_array($key, $excluded_key)) { - if (is_string($value)) { - if (Validate::isUrl($key) && Validate::isUrl($value)) { - $params[Tools::safeOutput($key)] = Tools::safeOutput($value); + if (is_array($value)) { + if (Validate::isUrl($key)) { + $params[Tools::safeOutput($key)] = $this->sanitizeQueryOutput($value); } } else { - $tempValue = http_build_query($value); - if (Validate::isUrl($key) && Validate::isUrl($tempValue)) { - $params[Tools::safeOutput($key)] = $value; + if (Validate::isUrl($key) && Validate::isUrl($value)) { + $params[Tools::safeOutput($key)] = Tools::safeOutput($value); } } } } + $str_params = http_build_query($params, '', '&'); if (!empty($str_params)) { $final_url = preg_replace('/^([^?]*)?.*$/', '$1', $canonical_url).'?'.$str_params; @@ -951,6 +951,24 @@ class FrontControllerCore extends Controller } } + protected function sanitizeQueryOutput($query) + { + $params = array(); + foreach ($query as $key => $value) { + if (Validate::isUrl($key)) { + if (is_array($value)) { + $params[Tools::safeOutput($key)] = $this->sanitizeQueryOutput($value); + } else { + if (Validate::isUrl($value)) { + $params[Tools::safeOutput($key)] = Tools::safeOutput($value); + } + } + } + } + + return $params; + } + /** * Geolocation management * From 4d04d4773da3e27b56b14adc4e0d3899136ae66e Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 26 Sep 2023 11:27:28 +0530 Subject: [PATCH 21/29] Update accept file formats --- .../template/controllers/products/helpers/uploader/ajax.tpl | 2 +- .../views/templates/admin/add_hotel/helpers/form/form.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/themes/default/template/controllers/products/helpers/uploader/ajax.tpl b/admin/themes/default/template/controllers/products/helpers/uploader/ajax.tpl index 2cf9f62b4..528b90ad2 100644 --- a/admin/themes/default/template/controllers/products/helpers/uploader/ajax.tpl +++ b/admin/themes/default/template/controllers/products/helpers/uploader/ajax.tpl @@ -24,7 +24,7 @@ *}
- + diff --git a/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl b/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl index 9ab60f03f..359885146 100644 --- a/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl @@ -296,7 +296,7 @@ {l s='Upload images' mod='hotelreservationsystem'} :  
- +

From 9d5208b171bcdc19978d9824d811d1a9e62ac9be Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 28 Sep 2023 15:37:56 +0530 Subject: [PATCH 22/29] Remove My/Your --- themes/hotel-reservation-theme/address.tpl | 6 +++--- themes/hotel-reservation-theme/discount.tpl | 6 +++--- themes/hotel-reservation-theme/history.tpl | 6 +++--- themes/hotel-reservation-theme/identity.tpl | 6 +++--- themes/hotel-reservation-theme/my-account.tpl | 12 ++++++------ themes/hotel-reservation-theme/order-follow.tpl | 4 ++-- themes/hotel-reservation-theme/order-slip.tpl | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/themes/hotel-reservation-theme/address.tpl b/themes/hotel-reservation-theme/address.tpl index a4725fb11..e581f5382 100644 --- a/themes/hotel-reservation-theme/address.tpl +++ b/themes/hotel-reservation-theme/address.tpl @@ -30,7 +30,7 @@ {$navigationPipe} - {l s='My address'} + {l s='Address'} {/capture} {if isset($smarty.get.updated) && $smarty.get.updated} @@ -39,7 +39,7 @@

{/if}
-

{l s='Your address'}

+

{l s='Address'}

{if isset($id_address) && (isset($smarty.post.alias) || isset($address->alias))} {l s='Modify address'} @@ -225,7 +225,7 @@

diff --git a/themes/hotel-reservation-theme/discount.tpl b/themes/hotel-reservation-theme/discount.tpl index 25440cad7..18e561050 100644 --- a/themes/hotel-reservation-theme/discount.tpl +++ b/themes/hotel-reservation-theme/discount.tpl @@ -22,10 +22,10 @@ * @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='My account'}{$navigationPipe}{l s='My vouchers'}{/capture} +{capture name=path}{l s='My account'}{$navigationPipe}{l s='Vouchers'}{/capture}

- {l s='My vouchers'} + {l s='Vouchers'}

{if isset($cart_rules) && $nb_cart_rules} @@ -98,7 +98,7 @@
  • - {l s='Back to your account'} + {l s='Back to My account'}
  • diff --git a/themes/hotel-reservation-theme/history.tpl b/themes/hotel-reservation-theme/history.tpl index 8135b8fbc..b6eeee269 100644 --- a/themes/hotel-reservation-theme/history.tpl +++ b/themes/hotel-reservation-theme/history.tpl @@ -27,10 +27,10 @@ {l s='My account'} {$navigationPipe} - {l s='Order history'} + {l s='Bookings'} {/capture} {include file="$tpl_dir./errors.tpl"} -

    {l s='Order history'}

    +

    {l s='Bookings'}

    {l s='Here are the orders you\'ve placed since your account was created.'}

    {if $slowValidation}

    {l s='If you have just placed an order, it may take a few minutes for it to be validated. Please refresh this page if your order is missing.'}

    @@ -127,7 +127,7 @@
  • - {l s='Back to Your Account'} + {l s='Back to My account'}
  • diff --git a/themes/hotel-reservation-theme/identity.tpl b/themes/hotel-reservation-theme/identity.tpl index b84a30800..bba309d88 100644 --- a/themes/hotel-reservation-theme/identity.tpl +++ b/themes/hotel-reservation-theme/identity.tpl @@ -31,12 +31,12 @@ {$navigationPipe} - {l s='Your personal information'} + {l s='Personal information'} {/capture}

    - {l s='Your personal information'} + {l s='Personal information'}

    {include file="$tpl_dir./errors.tpl"} @@ -206,7 +206,7 @@
  • - {l s='Back to your account'} + {l s='Back to My account'}
  • diff --git a/themes/hotel-reservation-theme/my-account.tpl b/themes/hotel-reservation-theme/my-account.tpl index 66570d7aa..4bbc44231 100644 --- a/themes/hotel-reservation-theme/my-account.tpl +++ b/themes/hotel-reservation-theme/my-account.tpl @@ -35,20 +35,20 @@
    {if $voucherAllowed || isset($HOOK_CUSTOMER_ACCOUNT) && $HOOK_CUSTOMER_ACCOUNT !=''}
    diff --git a/themes/hotel-reservation-theme/order-follow.tpl b/themes/hotel-reservation-theme/order-follow.tpl index ce1fa0f6b..4b0871ab0 100644 --- a/themes/hotel-reservation-theme/order-follow.tpl +++ b/themes/hotel-reservation-theme/order-follow.tpl @@ -31,7 +31,7 @@ {$navigationPipe} - {l s='Booking Refund Requests'} + {l s='Booking refund requests'} {/capture} @@ -86,6 +86,6 @@
    \ No newline at end of file diff --git a/themes/hotel-reservation-theme/order-slip.tpl b/themes/hotel-reservation-theme/order-slip.tpl index 846b25e84..1f4cf0c4b 100644 --- a/themes/hotel-reservation-theme/order-slip.tpl +++ b/themes/hotel-reservation-theme/order-slip.tpl @@ -106,7 +106,7 @@
  • - {l s='Back to your account'} + {l s='Back to My account'}
  • From c21ba3a194deb904aed5e2a2ab3579ecfb84373b Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 16 Oct 2023 12:06:35 +0530 Subject: [PATCH 23/29] Update OrderOpcController.php --- controllers/front/OrderOpcController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index c80313b1c..a372bd008 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -117,6 +117,7 @@ class OrderOpcControllerCore extends ParentOrderController $_POST['lastname'] = $_POST['customer_lastname']; $_POST['firstname'] = $_POST['customer_firstname']; + $this->errors = array_merge($this->errors, $this->context->customer->validateController()); $this->context->customer->newsletter = (int)Tools::isSubmit('newsletter'); $this->context->customer->optin = (int)Tools::isSubmit('optin'); $this->context->customer->is_guest = (Tools::isSubmit('is_new_customer') ? !Tools::getValue('is_new_customer', 1) : 0); @@ -126,6 +127,10 @@ class OrderOpcControllerCore extends ParentOrderController if (Validate::isLoadedObject($objAddress)) { $phoneMobile = Tools::getValue('phone_mobile'); + if (Configuration::get('PS_ONE_PHONE_AT_LEAST') && !$phoneMobile) { + $this->errors[] = Tools::displayError('Mobile phone number is a required field.', false); + } + if (!Validate::isPhoneNumber($phoneMobile)) { $this->errors[] = Tools::displayError('Please enter a valid Mobile phone number.', false); } @@ -139,7 +144,6 @@ class OrderOpcControllerCore extends ParentOrderController } } - $this->errors = array_merge($this->errors, $this->context->customer->validateController()); $return = array( 'hasError' => !empty($this->errors), 'errors' => $this->errors, From f7e9ecd1c15850439a950a501406f01af48dd36c Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 9 Nov 2023 16:18:24 +0530 Subject: [PATCH 24/29] Update default value --- controllers/admin/AdminCustomersController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index e4eaac7de..695de6a3b 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -976,8 +976,8 @@ class AdminCustomersControllerCore extends AdminController if ($years != '' && $months != '' && $days != '') { $object->birthday = (int) $years.'-'.(int) $months.'-'.(int) $days; - } elseif ($years == '' && $months == '' && $days == '') { - $object->birthday = null; + } else { + $object->birthday = '0000-00-00'; } } From aff9968b499206effc4ff23854de43c32f1b92e8 Mon Sep 17 00:00:00 2001 From: abhishek-webkul <84142535+abhishek-webkul@users.noreply.github.com> Date: Fri, 17 Nov 2023 19:18:42 +0530 Subject: [PATCH 25/29] Update wkhotelfilterblock.php --- modules/wkhotelfilterblock/wkhotelfilterblock.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/wkhotelfilterblock/wkhotelfilterblock.php b/modules/wkhotelfilterblock/wkhotelfilterblock.php index 4de61ef00..41ad65e6b 100644 --- a/modules/wkhotelfilterblock/wkhotelfilterblock.php +++ b/modules/wkhotelfilterblock/wkhotelfilterblock.php @@ -65,7 +65,7 @@ class wkhotelfilterblock extends Module $htl_id_category = Tools::getValue('id_category'); if (Validate::isLoadedObject($objCategory = new Category((int) $htl_id_category)) - && HotelBranchInformation::getHotelIdByIdCategory($htl_id_category) + && ($id_hotel = HotelBranchInformation::getHotelIdByIdCategory($htl_id_category)) ) { if ($objCategory->hasParent(Configuration::get('PS_LOCATIONS_CATEGORY'))) { Media::addJsDef(array('noRoomAvailTxt' => $this->l('No room available', false, true))); @@ -75,8 +75,6 @@ class wkhotelfilterblock extends Module $id_lang = $this->context->language->id; $all_feat = FeatureCore::getFeatures($id_lang); - $id_hotel = HotelBranchInformation::getHotelIdByIdCategory($htl_id_category); - $max_adult = HotelRoomType::getMaxAdults($id_hotel); $max_child = HotelRoomType::getMaxChild($id_hotel); From a4ae1f1b0b576e9fb7390eb448633666937a3a46 Mon Sep 17 00:00:00 2001 From: abhishek-webkul <84142535+abhishek-webkul@users.noreply.github.com> Date: Fri, 17 Nov 2023 19:24:36 +0530 Subject: [PATCH 26/29] Update ajax.tpl --- .../template/controllers/products/helpers/uploader/ajax.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/themes/default/template/controllers/products/helpers/uploader/ajax.tpl b/admin/themes/default/template/controllers/products/helpers/uploader/ajax.tpl index 528b90ad2..6776306f3 100644 --- a/admin/themes/default/template/controllers/products/helpers/uploader/ajax.tpl +++ b/admin/themes/default/template/controllers/products/helpers/uploader/ajax.tpl @@ -24,7 +24,7 @@ *}
    - + From 8a105b2596d8ff17bd76806a539ee1233e3ca88b Mon Sep 17 00:00:00 2001 From: abhishek-webkul <84142535+abhishek-webkul@users.noreply.github.com> Date: Fri, 17 Nov 2023 19:25:10 +0530 Subject: [PATCH 27/29] Update form.tpl --- .../views/templates/admin/add_hotel/helpers/form/form.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl b/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl index 359885146..ecdc18b29 100644 --- a/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/add_hotel/helpers/form/form.tpl @@ -296,7 +296,7 @@ {l s='Upload images' mod='hotelreservationsystem'} :  
    - +

    @@ -501,4 +501,4 @@ }); -{/block} \ No newline at end of file +{/block} From 0a46c43626fcf074e4f3757ee62cdf2ea35b0a2a Mon Sep 17 00:00:00 2001 From: abhishek-webkul <84142535+abhishek-webkul@users.noreply.github.com> Date: Fri, 17 Nov 2023 19:43:44 +0530 Subject: [PATCH 28/29] Update OrderConfirmationController.php --- controllers/front/OrderConfirmationController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/controllers/front/OrderConfirmationController.php b/controllers/front/OrderConfirmationController.php index ba932fc3f..40955333f 100644 --- a/controllers/front/OrderConfirmationController.php +++ b/controllers/front/OrderConfirmationController.php @@ -90,7 +90,6 @@ class OrderConfirmationControllerCore extends FrontController $this->context->smarty->assign(array( 'is_guest' => $this->context->customer->is_guest, - 'is_free_order' => 1, 'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(), 'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn() )); From 4debd49e846410a1a71dc1d6e9d8bf90b9bc7300 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 29 Dec 2023 16:48:34 +0530 Subject: [PATCH 29/29] Update address details as well --- controllers/front/OrderOpcController.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index a372bd008..c18f55c4e 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -137,6 +137,8 @@ class OrderOpcControllerCore extends ParentOrderController if (!count($this->errors)) { $objAddress->phone_mobile = $phoneMobile; + $objAddress->firstname = $this->context->customer->firstname; + $objAddress->lastname = $this->context->customer->lastname; if (!$objAddress->save()) { $this->errors[] = Tools::displayError('Something went wrong while saving phone number. Please try again.', false); }