From 0da72aefc9d4cbaec53c27558a6bb2741b90a99d Mon Sep 17 00:00:00 2001 From: Amit sharma Date: Fri, 20 Mar 2026 18:59:04 +0530 Subject: [PATCH] Fixed: support per-room booking methods, update selling object type across order pages, and add default property & room type values --- .../orders/_current_cart_details_data.tpl | 14 +- .../controllers/products/configuration.tpl | 37 ++-- .../controllers/products/informations.tpl | 39 +++- classes/Product.php | 26 +++ classes/module/ModuleGraph.php | 3 + controllers/admin/AdminCartsController.php | 5 - controllers/admin/AdminOrdersController.php | 10 +- .../admin/AdminPPreferencesController.php | 8 - controllers/admin/AdminProductsController.php | 31 +++- controllers/front/CartController.php | 3 +- controllers/front/CategoryController.php | 8 + .../front/OrderConfirmationController.php | 1 + controllers/front/OrderDetailController.php | 5 + controllers/front/ProductController.php | 23 ++- install/data/db_structure.sql | 2 + js/admin/ppreferences.js | 6 +- modules/blockcart/ajax-cart.js | 49 ++++- modules/blockcart/blockcart.php | 6 + modules/blockcart/blockcart.tpl | 10 +- .../classes/HotelBookingDetail.php | 1 + .../classes/HotelBranchInformation.php | 32 ++++ .../classes/HotelCartBookingData.php | 15 +- .../classes/HotelHelper.php | 41 +++++ .../classes/HotelReservationSystemDb.php | 19 ++ .../classes/HotelRoomType.php | 13 +- .../classes/HotelRoomTypeSellingType.php | 102 +++++++++++ .../admin/AdminAddHotelController.php | 13 ++ ...minHotelRoomTypeSellingTypesController.php | 168 ++++++++++++++++++ .../AdminHotelRoomsBookingController.php | 21 ++- .../AdminOrderRefundRequestsController.php | 2 +- modules/hotelreservationsystem/define.php | 1 + .../hotelreservationsystem.php | 2 + .../views/js/admin/hotel_rooms_booking.js | 23 ++- .../admin/add_hotel/helpers/form/form.tpl | 37 ++-- .../helpers/view/_partials/booking-rooms.tpl | 36 ++-- .../helpers/view/view.tpl | 2 +- .../views/templates/hook/searchForm.tpl | 4 +- .../_partials/booking-form.tpl | 26 +-- .../_partials/occupancy_field.tpl | 18 +- .../_partials/order-room-detail.tpl | 30 ++-- .../_partials/room_type_list.tpl | 8 +- .../cart-total-block.tpl | 2 +- .../js/modules/blockcart/ajax-cart.js | 53 +++++- .../hotel-reservation-theme/js/occupancy.js | 42 ++++- themes/hotel-reservation-theme/js/product.js | 17 +- .../modules/blockcart/blockcart.tpl | 10 +- .../order-confirmation.tpl | 11 +- .../hotel-reservation-theme/order-detail.tpl | 33 ++-- .../hotel-reservation-theme/order-return.tpl | 2 +- themes/hotel-reservation-theme/product.tpl | 16 +- .../shopping-cart-detail.tpl | 11 +- 51 files changed, 895 insertions(+), 202 deletions(-) create mode 100644 modules/hotelreservationsystem/classes/HotelRoomTypeSellingType.php create mode 100644 modules/hotelreservationsystem/controllers/admin/AdminHotelRoomTypeSellingTypesController.php diff --git a/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl b/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl index e3405fa99..9566bbfe1 100644 --- a/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl +++ b/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl @@ -37,9 +37,7 @@ {l s='Room Image'} {l s='Room Type'} {l s='Duration'} - {if $occupancy_required_for_booking} - {l s='Occupancy'} - {/if} + {l s='Occupancy / Quantity'} {l s='Unit Price (tax excl)'} {l s='Extra Services / Fees (tax excl)'} {* {l s='Total Rooms Price (tax excl)'} *} @@ -58,7 +56,11 @@ {assign var="is_full_date" value=($show_full_date && ($data['date_from']|date_format:'%D' == $data['date_to']|date_format:'%D'))} {dateFormat date=$data.date_from full=$is_full_date} - {dateFormat date=$data.date_to full=$is_full_date} - {if $occupancy_required_for_booking} + {assign var=room_occ_required value=false} + {if isset($data.occupancy_required_for_booking)} + {assign var=room_occ_required value=$data.occupancy_required_for_booking} + {/if} + {if $room_occ_required} + {else} + + 1 + {/if} {assign var=shown_room_type_price value=$data.feature_price_tax_excl} diff --git a/admin/themes/default/template/controllers/products/configuration.tpl b/admin/themes/default/template/controllers/products/configuration.tpl index 7f0bc0f60..5e78cb1dc 100644 --- a/admin/themes/default/template/controllers/products/configuration.tpl +++ b/admin/themes/default/template/controllers/products/configuration.tpl @@ -21,9 +21,16 @@ *} {if isset($product->id)} + {if isset($htl_room_type['room_type_selling_type_name']) && $htl_room_type['room_type_selling_type_name']} + {assign var=attribute_type value=$htl_room_type['room_type_selling_type_name']} + {assign var=attribute_types value=$htl_room_type['room_type_selling_type_name']|cat:'s'} + {else} + {assign var=attribute_type value={l s='Room'}} + {assign var=attribute_types value={l s='Rooms'}} + {/if}
-

{l s='Rooms'}

+

{$attribute_types}

@@ -35,7 +42,7 @@ @@ -55,14 +62,14 @@ @@ -201,14 +208,14 @@
  • -  {l s='Create Rooms'} +  {l s='Create %s' sprintf=$attribute_types}
  • @@ -253,7 +260,7 @@
      -
    • {l s='Please save this room first to add dates.'}
    • +
    • {l s='Please save this %s first to add dates.' sprintf=$attribute_types}
    @@ -325,7 +332,7 @@ - +