diff --git a/admin/themes/default/template/controllers/cart_rules/actions.tpl b/admin/themes/default/template/controllers/cart_rules/actions.tpl index d7da999e3..40ac64b72 100644 --- a/admin/themes/default/template/controllers/cart_rules/actions.tpl +++ b/admin/themes/default/template/controllers/cart_rules/actions.tpl @@ -85,26 +85,26 @@

- +
diff --git a/admin/themes/default/template/controllers/cart_rules/conditions.tpl b/admin/themes/default/template/controllers/cart_rules/conditions.tpl index 8f225fbbf..59ec231b8 100644 --- a/admin/themes/default/template/controllers/cart_rules/conditions.tpl +++ b/admin/themes/default/template/controllers/cart_rules/conditions.tpl @@ -255,7 +255,7 @@

diff --git a/admin/themes/default/template/controllers/cart_rules/product_rule.tpl b/admin/themes/default/template/controllers/cart_rules/product_rule.tpl index 10afca5a0..3e0214739 100644 --- a/admin/themes/default/template/controllers/cart_rules/product_rule.tpl +++ b/admin/themes/default/template/controllers/cart_rules/product_rule.tpl @@ -3,7 +3,7 @@ {* Everything is on a single line in order to avoid a empty space between the [ ] and the word *} - [{if $product_rule_type == 'products'}{l s='Room types:'}{elseif $product_rule_type == 'categories'}{l s='Categories:'}{elseif $product_rule_type == 'manufacturers'}{l s='Manufacturers:'}{elseif $product_rule_type == 'suppliers'}{l s='Suppliers'}{elseif $product_rule_type == 'attributes'}{l s='Attributes'}{/if}] + [{if $product_rule_type == 'products'}{l s='Stay types:'}{elseif $product_rule_type == 'categories'}{l s='Categories:'}{elseif $product_rule_type == 'manufacturers'}{l s='Manufacturers:'}{elseif $product_rule_type == 'suppliers'}{l s='Suppliers'}{elseif $product_rule_type == 'attributes'}{l s='Attributes'}{/if}] diff --git a/admin/themes/default/template/controllers/cart_rules/product_rule_group.tpl b/admin/themes/default/template/controllers/cart_rules/product_rule_group.tpl index fded1812c..6977cff00 100644 --- a/admin/themes/default/template/controllers/cart_rules/product_rule_group.tpl +++ b/admin/themes/default/template/controllers/cart_rules/product_rule_group.tpl @@ -14,7 +14,7 @@
- +
@@ -26,7 +26,7 @@
-

{l s='Assign features to this room type'}

+

{l s='Assign features to this stay type'}

- {l s='You can specify a value for each relevant feature regarding this room type. Empty fields will not be displayed.'}
+ {l s='You can specify a value for each relevant feature regarding this stay type. Empty fields will not be displayed.'}
{l s='You can either create a specific value, or select among the existing pre-defined values you\'ve previously added.'}
@@ -50,7 +50,7 @@ {$available_feature.name} - + {/foreach} + + AdminRoomTypeSellingObjects + diff --git a/install/langs/en/data/tab.xml b/install/langs/en/data/tab.xml index ab5391a0f..403df2844 100644 --- a/install/langs/en/data/tab.xml +++ b/install/langs/en/data/tab.xml @@ -22,6 +22,7 @@ + diff --git a/js/admin.js b/js/admin.js index 48507c79a..55ec83c73 100644 --- a/js/admin.js +++ b/js/admin.js @@ -576,6 +576,18 @@ function redirectSelectChange() showRedirectProductSelectOptions(true); } +function showBookingMehtodOption(show) +{ + if (show) { + $('.booking_method_product_options').fadeIn(); + $('#booking_method_select').show(); + $('#booking_method').prop('disabled', false); + } else { + $('.booking_method_product_options').fadeOut(); + $('#booking_method').prop('disabled', true); + } +} + function addRelatedProduct(id_product_to_add, product_name) { if (!id_product_to_add || id_product == id_product_to_add) diff --git a/mails/en/booking_extra_demands.tpl b/mails/en/booking_extra_demands.tpl index b43ac4bed..cc89a656e 100644 --- a/mails/en/booking_extra_demands.tpl +++ b/mails/en/booking_extra_demands.tpl @@ -2,10 +2,10 @@ - + - + @@ -26,7 +26,7 @@ {$data_v['name']}
{$rm_v['data_form']|date_format:"%d-%m-%Y"} {l s='to'} {$rm_v['data_to']|date_format:"%d-%m-%Y"}
- {l s='Room'} - {$roomCount} + {l s='Stay'} - {$roomCount}
{/if} @@ -50,7 +50,7 @@ {if !isset($room_demand_exists)} - + {/if} @@ -59,10 +59,10 @@
{l s='Room Extra Demands Detail'}{l s='Stay Extra Demands Detail'}
{l s='Room Type'}{l s='Stay Type'} {l s='Name'} {l s='Total'}
{l s='(Tax excl.)'}
{l s='No room extra demands added.'}{l s='No stay extra demands added.'}
- + - + @@ -84,7 +84,7 @@ {$data_v['name']}
{$rm_v['data_form']|date_format:"%d-%m-%Y"} {l s='to'} {$rm_v['data_to']|date_format:"%d-%m-%Y"}
- {l s='Room'} - {$roomCount} + {l s='Stay'} - {$roomCount}
{/if} @@ -117,7 +117,7 @@ {if !isset($room_additinal_services_exists)} - + {/if} diff --git a/mails/en/booking_extra_demands.txt b/mails/en/booking_extra_demands.txt index 3139f8ce3..b81fc7bc4 100644 --- a/mails/en/booking_extra_demands.txt +++ b/mails/en/booking_extra_demands.txt @@ -1,6 +1,6 @@ {if isset($list)} {l s='Extra Demands Details'} - {l s='Room Type'} + {l s='Stay Type'} {l s='Extra demand name'} {l s='Total'} {l s='(Tax excl.)'} @@ -16,7 +16,7 @@ {$data_v['name']}
{$rm_v['data_form']|date_format:"%d-%m-%Y"} {l s='to'} {$rm_v['data_to']|date_format:"%d-%m-%Y"}
- {l s='Room'} - {$roomCount} + {l s='Stay'} - {$roomCount}
{/if} diff --git a/mails/en/booking_extra_demands_text.tpl b/mails/en/booking_extra_demands_text.tpl index 38d5b7320..e8ee4b5dc 100644 --- a/mails/en/booking_extra_demands_text.tpl +++ b/mails/en/booking_extra_demands_text.tpl @@ -1,8 +1,8 @@ {if isset($list) && $list} -{l s='Room Extra Demands Detail'} +{l s='Stay Extra Demands Detail'} -{l s='Room Type'} +{l s='Stay Type'} {l s='Name'} {l s='Total'} {l s='(Tax excl.)'} @@ -23,7 +23,7 @@ {$data_v['name']} {$rm_v['data_form']|date_format:"%d-%m-%Y"} {l s='to'} {$rm_v['data_to']|date_format:"%d-%m-%Y"} -{l s='Room'} - {$roomCount} +{l s='Stay'} - {$roomCount} {/if} @@ -39,13 +39,13 @@ {/foreach} {if !isset($room_demand_exists)} -{l s='No room extra demands added.'} +{l s='No stay extra demands added.'} {/if} -{l s='Rooms Services Detail'} +{l s='Stays Services Detail'} -{l s='Room Type'} +{l s='Stay Type'} {l s='Name'} {l s='Qty'} {l s='Total'} @@ -66,7 +66,7 @@ {if $smarty.foreach.serviceRow.first} {$data_v['name']} {$rm_v['data_form']|date_format:"%d-%m-%Y"} {l s='to'} {$rm_v['data_to']|date_format:"%d-%m-%Y"} -{l s='Room'} - {$roomCount} +{l s='Stay'} - {$roomCount} {/if} {$service['name']} @@ -87,6 +87,6 @@ {/foreach} {if !isset($room_additinal_services_exists)} -{l s='No room services added.'} +{l s='No stay services added.'} {/if} {/if} diff --git a/mails/en/bookings_refund_request_detail_admin.tpl b/mails/en/bookings_refund_request_detail_admin.tpl index 657124172..bdd382c89 100644 --- a/mails/en/bookings_refund_request_detail_admin.tpl +++ b/mails/en/bookings_refund_request_detail_admin.tpl @@ -2,11 +2,11 @@
{l s='Rooms Services Detail'}{l s='Stays Services Detail'}
{l s='Room Type'}{l s='Stay Type'} {l s='Name'} {l s='Qty'} {l s='Total'}
{l s='No room services added.'}{l s='No stay services added.'}
- + - - + + diff --git a/mails/en/bookings_refund_request_detail_admin_text.tpl b/mails/en/bookings_refund_request_detail_admin_text.tpl index 236cfacad..e5d75108f 100644 --- a/mails/en/bookings_refund_request_detail_admin_text.tpl +++ b/mails/en/bookings_refund_request_detail_admin_text.tpl @@ -1,8 +1,8 @@ {if isset($list) && $list} -{l s="Room Num"} +{l s="Stay Num"} -{l s="Room Type"} +{l s="Stay Type"} {l s="Hotel"} diff --git a/mails/en/bookings_refund_request_detail_customer.tpl b/mails/en/bookings_refund_request_detail_customer.tpl index 07be275d5..52d33a0f8 100644 --- a/mails/en/bookings_refund_request_detail_customer.tpl +++ b/mails/en/bookings_refund_request_detail_customer.tpl @@ -2,12 +2,12 @@
{l s='Rooms Bookings Detail'}{l s='Stays Bookings Detail'}
{l s="Room Num"}{l s="Room Type"}{l s="Stay Num"}{l s="Stay Type"} {l s="Hotel"} {l s="Duration"}
- + - + - + diff --git a/mails/en/bookings_refund_request_detail_customer_text.tpl b/mails/en/bookings_refund_request_detail_customer_text.tpl index 51d0d3ea7..536982d28 100644 --- a/mails/en/bookings_refund_request_detail_customer_text.tpl +++ b/mails/en/bookings_refund_request_detail_customer_text.tpl @@ -1,13 +1,13 @@ {if isset($list) && $list} -{l s='Rooms Bookings Detail'} +{l s='Stays Bookings Detail'} -{l s="Room Type"} +{l s="Stay Type"} {l s="Hotel"} -{l s="Rooms Qty"} +{l s="Stays Qty"} {l s="Duration"} diff --git a/mails/en/hotel_booking_cart_data.tpl b/mails/en/hotel_booking_cart_data.tpl index 7f1d3eb67..f4e533aab 100644 --- a/mails/en/hotel_booking_cart_data.tpl +++ b/mails/en/hotel_booking_cart_data.tpl @@ -2,14 +2,14 @@
{l s='Rooms Bookings Detail'}{l s='Stays Bookings Detail'}
{l s="Room Type"}{l s="Stay Type"} {l s="Hotel"}{l s="Rooms Qty"}{l s="Stays Qty"} {l s="Duration"}
- + - - - + + + - + diff --git a/mails/en/order_canceled.txt b/mails/en/order_canceled.txt index ac4074023..2cb8c69a7 100644 --- a/mails/en/order_canceled.txt +++ b/mails/en/order_canceled.txt @@ -9,7 +9,7 @@ been canceled. Here are your order details: Order reference: {order_name} Order total: {total_paid} -Total Rooms: {num_rooms} +Total Stays: {num_rooms} Hotel details: Hotel Name: {hotel_hotel_name} diff --git a/mails/en/order_conf_total_info.tpl b/mails/en/order_conf_total_info.tpl index 7c094a1aa..b25e22d69 100644 --- a/mails/en/order_conf_total_info.tpl +++ b/mails/en/order_conf_total_info.tpl @@ -2,7 +2,7 @@ {if isset($list['has_room_bookings']) && $list['has_room_bookings']} - + {/foreach} diff --git a/modules/dashguestcycle/dashguestcycle.php b/modules/dashguestcycle/dashguestcycle.php index d630c926a..243b6db3e 100644 --- a/modules/dashguestcycle/dashguestcycle.php +++ b/modules/dashguestcycle/dashguestcycle.php @@ -327,7 +327,7 @@ class DashGuestCycle extends Module 'order_id' => array('title' => $this->l('Order ID'), 'class' => 'text-center'), 'name' => array('title' => $this->l('Customer Name'), 'class' => 'text-left'), 'hotel' => array('title' => $this->l('Hotel'), 'class' => 'text-left'), - 'total' => array('title' => $this->l('Total Rooms'), 'class' => 'text-center'), + 'total' => array('title' => $this->l('Total Stays'), 'class' => 'text-center'), 'guests' => array('title' => $this->l('Guests'), 'class' => 'text-center'), 'order_total' => array('title' => $this->l('Order Total'), 'class' => 'text-right'), 'order_status' => array('title' => $this->l('Order Status'), 'class' => 'text-left'), diff --git a/modules/dashperformance/views/templates/hook/dashboard_zone_two.tpl b/modules/dashperformance/views/templates/hook/dashboard_zone_two.tpl index 5d0ab4dfa..cf2f74964 100644 --- a/modules/dashperformance/views/templates/hook/dashboard_zone_two.tpl +++ b/modules/dashperformance/views/templates/hook/dashboard_zone_two.tpl @@ -73,7 +73,7 @@
-
+

{l s='Revenue Per Available Room' mod='dashperformance'}

diff --git a/modules/dashproducts/dashproducts.php b/modules/dashproducts/dashproducts.php index 3603141b8..d26b71a68 100644 --- a/modules/dashproducts/dashproducts.php +++ b/modules/dashproducts/dashproducts.php @@ -144,7 +144,7 @@ class DashProducts extends Module { $header = array( array('title' => $this->l('Customer Name'), 'class' => 'text-left'), - array('title' => $this->l('Total Rooms'), 'class' => 'text-left'), + array('title' => $this->l('Total Stays'), 'class' => 'text-left'), array('title' => $this->l('Order'), 'class' => 'text-left'), array('title' => $this->l('Hotel'), 'class' => 'text-left'), array('title' => $this->l('Total').' '.$this->l('Tax excl.'), 'class' => 'text-left'), diff --git a/modules/hotelreservationsystem/classes/HotelBranchInformation.php b/modules/hotelreservationsystem/classes/HotelBranchInformation.php index ba300e3da..ba0046321 100644 --- a/modules/hotelreservationsystem/classes/HotelBranchInformation.php +++ b/modules/hotelreservationsystem/classes/HotelBranchInformation.php @@ -579,36 +579,6 @@ class HotelBranchInformation extends ObjectModel return Db::getInstance()->getRow($sql); } - public function getHotelPropertyTypeName($id_hotel = null, $idLang = null) - { - if (!$idLang) { - $idLang = Context::getContext()->language->id; - } - - if (!$id_hotel) { - $id_hotel = (int) $this->id; - } - - if (!$id_hotel) { - return false; - } - - $cache_key = 'HotelBranchInformation::getHotelPropertyTypeName'.(int)$id_hotel; - if(!Cache::isStored($cache_key)){ - $sql = 'SELECT hrtstl.`name` - FROM `'._DB_PREFIX_.'htl_branch_info` hbi - LEFT JOIN `'._DB_PREFIX_.'htl_room_type_selling_type_lang` hrtstl - ON (hbi.`id_property_type` = hrtstl.`id_htl_room_type_selling_type` - AND hrtstl.`id_lang` = '.(int) $idLang.') - WHERE hbi.`id` = '.(int) $id_hotel; - - $res = Db::getInstance()->getValue($sql); - }else{ - $res = Cache::retrieve($cache_key); - } - return $res; - } - /** * [getHotelCategoryTree : Select category info by name of the category] * @param [string] $searchData [description] diff --git a/modules/hotelreservationsystem/classes/HotelCartBookingData.php b/modules/hotelreservationsystem/classes/HotelCartBookingData.php index 3d896d0cf..0088d69eb 100644 --- a/modules/hotelreservationsystem/classes/HotelCartBookingData.php +++ b/modules/hotelreservationsystem/classes/HotelCartBookingData.php @@ -459,8 +459,8 @@ class HotelCartBookingData extends ObjectModel $chkQty = 0; $num_days = HotelHelper::getNumberOfDays($date_from, $date_to); $objServiceProductCartDetail = new ServiceProductCartDetail(); - $PS_ROOM_UNIT_SELECTION_TYPE = Product::getRoomTypeBookingMethod($id_product); - if ($PS_ROOM_UNIT_SELECTION_TYPE == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) { + $isOccupancyBooking = Product::isOccupancyBookingMethod($id_product); + if ($isOccupancyBooking) { $roomsRequired = count($occupancy); } else { $objRoomType = new HotelRoomType(); @@ -486,7 +486,7 @@ class HotelCartBookingData extends ObjectModel $obj_htl_cart_booking_data->date_to = $date_to; $obj_htl_cart_booking_data->booking_type = $booking_type; $obj_htl_cart_booking_data->comment = $comment; - if ($PS_ROOM_UNIT_SELECTION_TYPE == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) { + if ($isOccupancyBooking) { $room_occupancy = array_shift($occupancy); $obj_htl_cart_booking_data->adults = $room_occupancy['adults']; $obj_htl_cart_booking_data->children = $room_occupancy['children']; @@ -590,8 +590,8 @@ class HotelCartBookingData extends ObjectModel 'id_cart' => $id_cart, 'id_guest' => $id_guest, ); - $PS_ROOM_UNIT_SELECTION_TYPE = Product::getRoomTypeBookingMethod($id_product); - if ($PS_ROOM_UNIT_SELECTION_TYPE == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) { + $isOccupancyBooking = Product::isOccupancyBookingMethod($id_product); + if ($isOccupancyBooking) { $roomsRequired = count($occupancy); } else { $roomsRequired = $occupancy; @@ -1171,7 +1171,7 @@ class HotelCartBookingData extends ObjectModel $cart_detail_data[$key]['date_from'] = $value['date_from']; $cart_detail_data[$key]['date_to'] = $value['date_to']; $cart_detail_data[$key]['occupancy_required_for_booking'] = - (Product::getRoomTypeBookingMethod($value['id_product']) == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY); + Product::isOccupancyBookingMethod($value['id_product']); $cart_detail_data[$key]['child_ages'] = json_decode($value['child_ages']); $occupancy = array( @@ -1557,7 +1557,9 @@ class HotelCartBookingData extends ObjectModel $cartHotelData[$prodKey]['total_num_rooms'] = 0; $cartHotelData[$prodKey]['id_product'] = $product['id_product']; $cartHotelData[$prodKey]['name'] = $objProduct->name; - $cartHotelData[$prodKey]['room_type_selling_type_name'] = $roomDetail['room_type_selling_type_name']; + $cartHotelData[$prodKey]['room_type_selling_object'] = $roomDetail['room_type_selling_object']; + $cartHotelData[$prodKey]['multiple_room_type_selling_object'] = $roomDetail['multiple_room_type_selling_object']; + $cartHotelData[$prodKey]['isOccupancyType'] = Product::isOccupancyBookingMethod($product['id_product']);; $cartHotelData[$prodKey]['unit_price'] = $unitPrice; $cartHotelData[$prodKey]['unit_price_without_reduction'] = $unitPriceWithoutReduction; $cartHotelData[$prodKey]['total_room_type_amount'] = 0; diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php index 6bdded18c..8d50d7086 100644 --- a/modules/hotelreservationsystem/classes/HotelHelper.php +++ b/modules/hotelreservationsystem/classes/HotelHelper.php @@ -1368,25 +1368,26 @@ class HotelHelper return true; } - public function createHotelDefaultRoomTypeSellingTypes() + public function createHotelDefaultPropertyTypes() { $propertyTypes = array( 'Hotel', 'Motel', - ); - - $sellingTypes = array( - 'Room', + 'Resort', + 'Hostel', + 'Guest House', + 'Lodge', 'Apartment', - 'Villa', - 'Cottage', - 'Bungalow', + 'Vacation Rental', + 'Homestay', + 'Co-Living', + 'Camping', + 'Bed & Breakfast', ); $languages = Language::getLanguages(true); foreach ($propertyTypes as $typeName) { - $objType = new HotelRoomTypeSellingType(); - $objType->type = HotelRoomTypeSellingType::HOTEL_PROPERTY_TYPE; + $objType = new HotelPropertyType(); $objType->active = 1; foreach ($languages as $lang) { $objType->name[$lang['id_lang']] = $typeName; @@ -1394,9 +1395,31 @@ class HotelHelper $objType->save(); } - foreach ($sellingTypes as $typeName) { - $objType = new HotelRoomTypeSellingType(); - $objType->type = HotelRoomTypeSellingType::ROOM_TYPE_OBJECT_SELLING_TYPE; + return true; + } + + public function createHotelDefaultRoomSellingTypes() + { + $sellingObjects = array( + 'Room', + 'Apartment', + 'Villa', + 'Cottage', + 'Bungalow', + 'House', + 'Chalet', + 'Cabin', + 'Studio', + 'Penthouse', + 'Camping Pitch', + 'Overwater Bungalow', + 'Heritage Room', + 'Houseboat', + ); + + $languages = Language::getLanguages(true); + foreach ($sellingObjects as $typeName) { + $objType = new RoomTypeSellingObject(); $objType->active = 1; foreach ($languages as $lang) { $objType->name[$lang['id_lang']] = $typeName; @@ -2029,7 +2052,7 @@ class HotelHelper $product->show_at_front = 1; $product->is_virtual = 1; $product->indexed = 1; - $product->id_room_type_selling_object_type = 3; // assign default selling type as 'Per Room' + $product->id_room_type_selling_object= 1; $product->save(); $product_id = $product->id; @@ -2518,6 +2541,8 @@ class HotelHelper $this->saveDummyHotelFeatures($htl_id); $this->saveDummyProductsAndRelatedInfo($htl_id); $this->saveDummyServiceProductsAndRelatedInfo(); + $this->createHotelDefaultPropertyTypes(); + $this->createHotelDefaultRoomSellingTypes(); return true; } diff --git a/modules/hotelreservationsystem/classes/HotelPropertyType.php b/modules/hotelreservationsystem/classes/HotelPropertyType.php new file mode 100644 index 000000000..9d75dc6d9 --- /dev/null +++ b/modules/hotelreservationsystem/classes/HotelPropertyType.php @@ -0,0 +1,112 @@ + 'htl_property_type', + 'primary' => 'id_htl_property_type', + 'multilang' => true, + 'fields' => array( + 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), + 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false), + 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false), + 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true), + ), + ); + + public function delete() + { + Db::getInstance()->update( + 'htl_branch_info', + array('id_property_type' => 0), + '`id_property_type` = '.(int)$this->id + ); + + return parent::delete(); + } + + /** + * Get the property type name of a hotel in the requested language. + * + * @param int|null $idHotel + * @param int|null $idLang + * + * @return string + */ + public static function getPropertyType($idHotel = null, $idLang = null) + { + $idHotel = (int) $idHotel; + $idLang = $idLang ? (int) $idLang : (int) Context::getContext()->language->id; + $cacheKey = 'HotelPropertyType::getPropertyType'.$idHotel.'_'.$idLang; + + if (!Cache::isStored($cacheKey)) { + $sql = 'SELECT hptl.`name` + FROM `'._DB_PREFIX_.'htl_branch_info` hbi + LEFT JOIN `'._DB_PREFIX_.'htl_property_type_lang` hptl + ON (hbi.`id_property_type` = hptl.`id_htl_property_type` + AND hptl.`id_lang` = '.$idLang.') + WHERE hbi.`id` = '.$idHotel; + + Cache::store($cacheKey, Db::getInstance()->getValue($sql)); + } + + $propertyType = Cache::retrieve($cacheKey); + + return $propertyType ? $propertyType : Translate::getModuleTranslation('hotelreservationsystem', 'Hotel', 'HotelPropertyType'); + } + + /** + * Get the list of property types in the requested language. + * + * @param int|null $idLang + * @param bool $active + * + * @return array + */ + public static function getPropertyTypes($idLang = null, $active = true) + { + $idLang = $idLang ? (int) $idLang : (int) Context::getContext()->language->id; + $active = (bool) $active; + $cacheKey = 'HotelPropertyType::getPropertyTypes'.$idLang.'_'.(int) $active; + + if (!Cache::isStored($cacheKey)) { + $sql = 'SELECT hpt.`id_htl_property_type` AS `id_property_type`, hptl.`name` + FROM `'._DB_PREFIX_.'htl_property_type` hpt + LEFT JOIN `'._DB_PREFIX_.'htl_property_type_lang` hptl + ON (hpt.`id_htl_property_type` = hptl.`id_htl_property_type` + AND hptl.`id_lang` = '.$idLang.')'. + ($active ? ' WHERE hpt.`active` = 1' : ''). + ' ORDER BY hptl.`name` ASC'; + + Cache::store($cacheKey, Db::getInstance()->executeS($sql)); + } + + return Cache::retrieve($cacheKey); + } +} diff --git a/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php b/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php index 06e9ee61d..5d754acad 100644 --- a/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php +++ b/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php @@ -118,20 +118,19 @@ class HotelReservationSystemDb PRIMARY KEY (`id`, `id_lang`) ) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;", - "CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_selling_type` ( - `id_htl_room_type_selling_type` int(10) unsigned NOT NULL AUTO_INCREMENT, - `type` tinyint(2) unsigned NOT NULL, + "CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_property_type` ( + `id_htl_property_type` int(10) unsigned NOT NULL AUTO_INCREMENT, `active` tinyint(1) unsigned NOT NULL DEFAULT '1', `date_add` datetime NOT NULL, `date_upd` datetime NOT NULL, - PRIMARY KEY (`id_htl_room_type_selling_type`) + PRIMARY KEY (`id_htl_property_type`) ) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;", - "CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_selling_type_lang` ( - `id_htl_room_type_selling_type` int(10) unsigned NOT NULL, + "CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_property_type_lang` ( + `id_htl_property_type` int(10) unsigned NOT NULL, `id_lang` int(10) unsigned NOT NULL, `name` varchar(255) NOT NULL, - PRIMARY KEY (`id_htl_room_type_selling_type`, `id_lang`) + PRIMARY KEY (`id_htl_property_type`, `id_lang`) ) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;", "CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_cart_booking_data` ( @@ -630,8 +629,8 @@ class HotelReservationSystemDb `'._DB_PREFIX_.'htl_bed_type`, `'._DB_PREFIX_.'htl_bed_type_lang`, `'._DB_PREFIX_.'htl_room_type_bed_type`, - `'._DB_PREFIX_.'htl_room_type_selling_type`, - `'._DB_PREFIX_.'htl_room_type_selling_type_lang`, + `'._DB_PREFIX_.'htl_property_type`, + `'._DB_PREFIX_.'htl_property_type_lang`, `'._DB_PREFIX_.'htl_access`, `'._DB_PREFIX_.'htl_settings_link`, `'._DB_PREFIX_.'htl_settings_link_lang`' diff --git a/modules/hotelreservationsystem/classes/HotelRoomType.php b/modules/hotelreservationsystem/classes/HotelRoomType.php index 3f345bc03..1f6e5fd6b 100644 --- a/modules/hotelreservationsystem/classes/HotelRoomType.php +++ b/modules/hotelreservationsystem/classes/HotelRoomType.php @@ -234,18 +234,29 @@ class HotelRoomType extends ObjectModel if (!$idLang) { $idLang = Context::getContext()->language->id; } - $sql = 'SELECT hrt.*, hbl.`hotel_name`, hrtstl.`name` AS `room_type_selling_type_name` + + $sql = 'SELECT hrt.*, hbl.`hotel_name`, + hrtstl.`name` AS `room_type_selling_object`, + CONCAT(hrtstl.`name`, "s") AS `multiple_room_type_selling_object` FROM `'._DB_PREFIX_.'htl_room_type` AS hrt INNER JOIN `'._DB_PREFIX_.'htl_branch_info_lang` AS hbl - ON (hbl.`id` = hrt.`id_hotel` AND hbl.`id_lang` = '.(int)$idLang.') + ON (hbl.`id` = hrt.`id_hotel` + AND hbl.`id_lang` = '.(int)$idLang.') LEFT JOIN `'._DB_PREFIX_.'product` AS p - ON (p.`id_product` = hrt.`id_product`) - LEFT JOIN `'._DB_PREFIX_.'htl_room_type_selling_type_lang` AS hrtstl - ON (hrtstl.`id_htl_room_type_selling_type` = p.`id_room_type_selling_object_type` - AND hrtstl.`id_lang` = '.(int)$idLang.') + ON (p.`id_product` = hrt.`id_product`) + LEFT JOIN `'._DB_PREFIX_.'room_type_selling_object_lang` AS hrtstl + ON (hrtstl.`id_room_type_selling_object` = p.`id_room_type_selling_object` + AND hrtstl.`id_lang` = '.(int)$idLang.') WHERE hrt.`id_product` = '.(int)$id_product; - return Db::getInstance()->getRow($sql); + $result = Db::getInstance()->getRow($sql); + + if ($result && !$result['room_type_selling_object']) { + $result['room_type_selling_object'] = Translate::getModuleTranslation('hotelreservationsystem', 'Room', 'HotelRoomType'); + $result['multiple_room_type_selling_object'] = Translate::getModuleTranslation('hotelreservationsystem', 'Rooms', 'HotelRoomType'); + } + + return $result; } /** @@ -303,15 +314,15 @@ class HotelRoomType extends ObjectModel $idLang = Context::getContext()->language->id; } - $sql = 'SELECT pl.`name`, COUNT(hri.`id`) AS `numberOfRooms`, hrt.`id_product`, `adults`, `children`, `max_adults`, `max_children`, `max_guests`, hrtstl.`name` AS `room_type_selling_type_name` + $sql = 'SELECT pl.`name`, COUNT(hri.`id`) AS `numberOfRooms`, hrt.`id_product`, `adults`, `children`, `max_adults`, `max_children`, `max_guests`, hrtstl.`name` AS `room_type_selling_object`, CONCAT(hrtstl.`name`, "s") AS `multiple_room_type_selling_object` '.($position ? ', cp.`position`' : '').' '.($fullDetail ? ', pl.`link_rewrite`, pl.`description_short`' : '').' FROM `'._DB_PREFIX_.'htl_room_type` AS `hrt` INNER JOIN `'._DB_PREFIX_.'htl_room_information` AS `hri` ON (hri.`id_product` = hrt.`id_product`)'; $sql .= ' INNER JOIN `'._DB_PREFIX_.'product_lang` pl ON (hrt.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$idLang.')'; $sql .= ' LEFT JOIN `'._DB_PREFIX_.'product` AS p ON (p.`id_product` = hrt.`id_product`) - LEFT JOIN `'._DB_PREFIX_.'htl_room_type_selling_type_lang` AS hrtstl - ON (hrtstl.`id_htl_room_type_selling_type` = p.`id_room_type_selling_object_type` + LEFT JOIN `'._DB_PREFIX_.'room_type_selling_object_lang` AS hrtstl + ON (hrtstl.`id_room_type_selling_object` = p.`id_room_type_selling_object` AND hrtstl.`id_lang` = '.(int)$idLang.')'; if ($position) { @@ -323,7 +334,17 @@ class HotelRoomType extends ObjectModel GROUP BY hrt.`id_product`'. ($position ? ' ORDER BY cp.`position`' : ''); - return Db::getInstance()->executeS($sql); + $results = Db::getInstance()->executeS($sql); + + foreach ($results as &$row) { + if (!$row['room_type_selling_object']) { + $row['room_type_selling_object'] = Translate::getModuleTranslation('hotelreservationsystem', 'Room', 'HotelRoomType'); + $row['multiple_room_type_selling_object'] = Translate::getModuleTranslation('hotelreservationsystem', 'Rooms', 'HotelRoomType'); + } + } + unset($row); + + return $results; } /** diff --git a/modules/hotelreservationsystem/classes/HotelRoomTypeSellingType.php b/modules/hotelreservationsystem/classes/HotelRoomTypeSellingType.php deleted file mode 100644 index 28ecf8503..000000000 --- a/modules/hotelreservationsystem/classes/HotelRoomTypeSellingType.php +++ /dev/null @@ -1,102 +0,0 @@ - 'htl_room_type_selling_type', - 'primary' => 'id_htl_room_type_selling_type', - 'multilang' => true, - 'fields' => array( - 'type' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'required' => true), - 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), - 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false), - 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false), - 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true), - ), - ); - - public static function getRoomTypeSellingObjectTypes($idLang = null, $active = true) - { - if (!$idLang) { - $idLang = Context::getContext()->language->id; - } - - $cache_key = 'HotelRoomTypeSellingType::getRoomTypeSellingObjectTypes'.$idLang.'_'.$active; - if(!Cache::isStored($cache_key)){ - $sql = 'SELECT hrtst.`id_htl_room_type_selling_type` AS `id_room_type_selling_object_type`, hrtstl.`name` - FROM `'._DB_PREFIX_.'htl_room_type_selling_type` hrtst - LEFT JOIN `'._DB_PREFIX_.'htl_room_type_selling_type_lang` hrtstl - ON (hrtst.`id_htl_room_type_selling_type` = hrtstl.`id_htl_room_type_selling_type` - AND hrtstl.`id_lang` = '.(int) $idLang.') - WHERE hrtst.`type` = '.(int) self::ROOM_TYPE_OBJECT_SELLING_TYPE. - ($active ? ' AND hrtst.`active` = 1' : '').' - ORDER BY hrtstl.`name` ASC'; - - $res = Db::getInstance()->executeS($sql); - }else { - $res = Cache::retrieve($cache_key); - } - - return $res; - - } - - public static function getHotelPropertyTypes($idLang = null, $active = true) - { - if (!$idLang) { - $idLang = Context::getContext()->language->id; - } - - $cache_key = 'HotelRoomTypeSellingType::getHotelPropertyTypes'.$idLang.'_'.$active; - if(!Cache::isStored($cache_key)){ - - $sql = 'SELECT hrtst.`id_htl_room_type_selling_type` AS `id_property_type`, hrtstl.`name` - FROM `'._DB_PREFIX_.'htl_room_type_selling_type` hrtst - LEFT JOIN `'._DB_PREFIX_.'htl_room_type_selling_type_lang` hrtstl - ON (hrtst.`id_htl_room_type_selling_type` = hrtstl.`id_htl_room_type_selling_type` - AND hrtstl.`id_lang` = '.(int) $idLang.') - WHERE hrtst.`type` = '.(int) self::HOTEL_PROPERTY_TYPE. - ($active ? ' AND hrtst.`active` = 1' : '').' - ORDER BY hrtstl.`name` ASC'; - - $res = Db::getInstance()->executeS($sql); - - }else{ - $res = Cache::retrieve($cache_key); - } - - return $res; - - } - -} diff --git a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php index 1a3ddceec..dc457008f 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminAddHotelController.php @@ -45,16 +45,24 @@ class AdminAddHotelController extends ModuleAdminController $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = aa.`id_state`)'; $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (cl.`id_country` = aa.`id_country` AND cl.`id_lang` = '.(int) $this->context->language->id.')'; - - $this->_select = ' hbl.`hotel_name`, aa.`city`, s.`name` as `state_name`, cl.`name` as country_name'; + $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'htl_property_type_lang` hrtsl + ON (hrtsl.`id_htl_property_type` = a.`id_property_type` AND hrtsl.`id_lang` = '.(int) $this->context->language->id.')'; + $this->_select = ' hrtsl.`name` as `property_type` , hbl.`hotel_name`, aa.`city`, s.`name` as `state_name`, cl.`name` as `country_name`'; $this->fields_list = array( 'id' => array( 'title' => $this->l('ID'), 'align' => 'center', ), + 'property_type' => array( + 'title' => $this->l('Property type'), + 'align' => 'center', + 'optional' => false, + 'filter_key' => 'hrtsl!name', + 'order_key' => 'hrtsl!name', + ), 'hotel_name' => array( - 'title' => $this->l('Hotel Name'), + 'title' => $this->l('Name'), 'align' => 'center', ), 'city' => array( @@ -222,7 +230,7 @@ class AdminAddHotelController extends ModuleAdminController $smartyVars['PS_MAX_CHECKOUT_OFFSET'] = (int) Configuration::get('PS_MAX_CHECKOUT_OFFSET'); $smartyVars['PS_MIN_BOOKING_OFFSET'] = (int) Configuration::get('PS_MIN_BOOKING_OFFSET'); $smartyVars['WK_ORDER_REFUND_ALLOWED'] = Configuration::get('WK_ORDER_REFUND_ALLOWED'); - $hotelPropertyTypes = HotelRoomTypeSellingType::getHotelPropertyTypes($this->context->language->id); + $hotelPropertyTypes = HotelPropertyType::getPropertyTypes($this->context->language->id); $smartyVars['hotel_property_types_info'] = $hotelPropertyTypes; $selectedHotelPropertyType = Tools::getValue('id_property_type'); if (!$selectedHotelPropertyType && isset($hotelBranchInfo)) { @@ -296,10 +304,6 @@ class AdminAddHotelController extends ModuleAdminController } } - if ($idHotelPropertyType == '' && $idHotelPropertyType == null && !Validate::isUnsignedId($idHotelPropertyType)) { - $this->errors[] = $this->l('Invalid property type.'); - } - foreach ($languages as $lang) { if ($shortDescription = html_entity_decode(Tools::getValue('short_description_'.$lang['id_lang']))) { if (!Validate::isCleanHtml($shortDescription)) { diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelPropertyTypesController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelPropertyTypesController.php new file mode 100644 index 000000000..b63cbb5e8 --- /dev/null +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelPropertyTypesController.php @@ -0,0 +1,127 @@ +bootstrap = true; + $this->table = 'htl_property_type'; + $this->className = 'HotelPropertyType'; + $this->identifier = 'id_htl_property_type'; + $this->lang = true; + $this->context = Context::getContext(); + $this->toolbar_title = $this->l('Property Types'); + + parent::__construct(); + + $this->fields_list = array( + 'id_htl_property_type' => array( + 'title' => $this->l('ID'), + 'align' => 'center', + 'class' => 'fixed-width-xs', + ), + 'name' => array( + 'title' => $this->l('Name'), + 'align' => 'left', + ), + 'active' => array( + 'title' => $this->l('Status'), + 'align' => 'center', + 'active' => 'status', + 'type' => 'bool', + 'orderby' => false, + ), + ); + + $this->addRowAction('edit'); + $this->addRowAction('delete'); + $this->bulk_actions = array( + 'delete' => array( + 'text' => $this->l('Delete selected'), + 'confirm' => $this->l('Delete selected items?'), + 'icon' => 'icon-trash', + ), + ); + } + + public function initPageHeaderToolbar() + { + if (!$this->display || $this->display == 'list') { + $this->page_header_toolbar_btn['new_property_type'] = array( + 'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token, + 'desc' => $this->l('Add New Property', null, null, false), + 'icon' => 'process-icon-new', + ); + } + + parent::initPageHeaderToolbar(); + } + + public function renderForm() + { + if (!$this->loadObject(true)) { + return; + } + + $this->fields_form = array( + 'legend' => array( + 'title' => $this->l('Property Type'), + 'icon' => 'icon-building', + ), + 'input' => array( + array( + 'type' => 'text', + 'label' => $this->l('Name'), + 'name' => 'name', + 'lang' => true, + 'required' => true, + 'hint' => $this->l('Displayed name for this property type.'), + ), + array( + 'type' => 'switch', + 'label' => $this->l('Status'), + 'name' => 'active', + 'is_bool' => true, + 'values' => array( + array( + 'id' => 'active_on', + 'value' => 1, + 'label' => $this->l('Enabled'), + ), + array( + 'id' => 'active_off', + 'value' => 0, + 'label' => $this->l('Disabled'), + ), + ), + ), + ), + 'submit' => array( + 'title' => $this->l('Save'), + ), + ); + + return parent::renderForm(); + } +} diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php index fd1b887da..d684fcf5f 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php @@ -375,7 +375,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController } $booking_data['rm_data'][$roomKey]['occupancy_required_for_booking'] = - (int) (Product::getRoomTypeBookingMethod($roomData['id_product']) == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY); + (int) Product::isOccupancyBookingMethod($roomData['id_product']); } $this->context->smarty->assign(array( @@ -576,13 +576,13 @@ class AdminHotelRoomsBookingController extends ModuleAdminController if ($bookingData = $objBookingDetail->getBookingData($bookingParams)) { if ($bookingData['stats']['num_avail']) { $eventColor = '#7EC77B'; - $title = sprintf($this->l('Available Rooms : %s'), $bookingData['stats']['num_avail']); + $title = sprintf($this->l('Available Stays : %s'), $bookingData['stats']['num_avail']); } elseif ($bookingData['stats']['num_part_avai']) { $eventColor = '#FFC224'; - $title = sprintf($this->l('Partially Available Rooms : %s'), $bookingData['stats']['num_part_avai']); + $title = sprintf($this->l('Partially Available Stays : %s'), $bookingData['stats']['num_part_avai']); } else { $eventColor = '#FF3838'; - $title = sprintf($this->l('Available Rooms : %s'), $bookingData['stats']['num_avail']); + $title = sprintf($this->l('Available Stays : %s'), $bookingData['stats']['num_avail']); } $bookingData['date_from_format'] = Tools::displayDate($searchDateFrom); $bookingData['date_to_format'] = Tools::displayDate($searchDateTo); @@ -688,7 +688,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController $date_from = Tools::getValue('date_from'); $date_to = Tools::getValue('date_to'); $occupancy = Tools::getValue('occupancy'); - if (Product::getRoomTypeBookingMethod($id_product) == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) { + if (Product::isOccupancyBookingMethod($id_product)) { if (!Validate::isOccupancy($occupancy)) { $occupancy = array(); } diff --git a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php index 28268cf10..c25c6af0a 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php @@ -93,7 +93,7 @@ class AdminOrderRefundRequestsController extends ModuleAdminController if ($refundReqBookings) { $this->fields_list['num_rooms'] = array( - 'title' => $this->l('Total Rooms'), + 'title' => $this->l('Total Stays'), 'align' => 'center', 'havingFilter' => true, ); @@ -304,7 +304,7 @@ class AdminOrderRefundRequestsController extends ModuleAdminController $objCustomer = new Customer($objOrderReturn->id_customer); $objOrder = new Order($objOrderReturn->id_order); $orderCurrency = new Currency($objOrder->id_currency); - + $objRoomType = new HotelRoomType(); $objRefundRules = new HotelOrderRefundRules(); if ($refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($objOrderReturn->id_order, $objOrderReturn->id)){ foreach ($refundReqBookings as &$booking) { @@ -313,6 +313,9 @@ class AdminOrderRefundRequestsController extends ModuleAdminController $objOrderReturn->id, $booking['id'] ); + + $roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($booking['id_product']); + $booking['room_type_info'] = $roomTypeInfo; $booking = array_merge($booking, array_shift($bookingCharges)); } } diff --git a/modules/hotelreservationsystem/define.php b/modules/hotelreservationsystem/define.php index aa436407f..c5e7b3df7 100644 --- a/modules/hotelreservationsystem/define.php +++ b/modules/hotelreservationsystem/define.php @@ -49,7 +49,7 @@ require_once 'classes/HotelRoomDisableDates.php'; require_once 'classes/HotelBranchRefundRules.php'; require_once 'classes/HotelBedType.php'; require_once 'classes/HotelRoomTypeBedType.php'; -require_once 'classes/HotelRoomTypeSellingType.php'; +require_once 'classes/HotelPropertyType.php'; // linked products require_once 'classes/RoomTypeServiceProduct.php'; diff --git a/modules/hotelreservationsystem/hotelreservationsystem.php b/modules/hotelreservationsystem/hotelreservationsystem.php index c361346b1..bf808b6a2 100644 --- a/modules/hotelreservationsystem/hotelreservationsystem.php +++ b/modules/hotelreservationsystem/hotelreservationsystem.php @@ -555,7 +555,7 @@ class HotelReservationSystem extends Module $this->installTab('AdminAddHotel', 'Manage Hotel', 'AdminHotelReservationSystemManagement'); $this->installTab('AdminHotelRoomsBooking', 'Book Now', 'AdminHotelReservationSystemManagement'); $this->installTab('AdminHotelFeatures', 'Manage Hotel Features', 'AdminHotelReservationSystemManagement'); - $this->installTab('AdminHotelRoomTypeSellingTypes', 'Property & Room Types', 'AdminHotelReservationSystemManagement'); + $this->installTab('AdminHotelPropertyTypes', 'Manage Property Types', 'AdminHotelReservationSystemManagement'); $this->installTab('AdminOrderRefundRules', 'Manage Order Refund Rules', 'AdminHotelReservationSystemManagement'); $this->installTab('AdminOrderRefundRequests', 'Manage Order Refund Requests', 'AdminHotelReservationSystemManagement'); @@ -611,7 +611,6 @@ class HotelReservationSystem extends Module || !$objHtlHelper->insertDefaultHotelEntries() || !$objHtlHelper->createHotelRoomDefaultFeatures() || !$objHtlHelper->createHotelDefaultBedTypes() - || !$objHtlHelper->createHotelDefaultRoomTypeSellingTypes() || !$objHtlHelper->insertHotelCommonFeatures() ) { return false; 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 2081956a3..5b865a0be 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 @@ -123,23 +123,25 @@
-
- -
- + {if isset($hotel_property_types_info) && $hotel_property_types_info} +
+ +
+ +
-
+ {/if}
{l s='Rooms Booking Detail'}{l s='Stays Booking Detail'}
{l s="Room Image"}{l s="Room Description"}{l s="Room Capcity"}{l s="Stay Image"}{l s="Stay Description"}{l s="Stay Capcity"} {l s="Unit Price"}{l s="Rooms Qty"}{l s="Stays Qty"} {l s="Check-in Date"} {l s="Check-out Date"} {l s="Total"}
- {l s="Total Rooms Cost"} + {l s="Total Stays Cost"} {$list['room_price_tax_excl']} diff --git a/mails/en/order_conf_total_info_text.tpl b/mails/en/order_conf_total_info_text.tpl index ca048b8d0..f8917505b 100644 --- a/mails/en/order_conf_total_info_text.tpl +++ b/mails/en/order_conf_total_info_text.tpl @@ -1,5 +1,5 @@ {if isset($list['has_room_bookings']) && $list['has_room_bookings']} -{l s="Total Rooms Cost"} {$list['room_price_tax_excl']} +{l s="Total Stays Cost"} {$list['room_price_tax_excl']} {/if} {if isset($list['has_standalone_products']) && $list['has_standalone_products']} diff --git a/mails/en/order_hotel_detail.tpl b/mails/en/order_hotel_detail.tpl index 710025127..97c314cca 100644 --- a/mails/en/order_hotel_detail.tpl +++ b/mails/en/order_hotel_detail.tpl @@ -7,7 +7,7 @@ {l s='Hotel Name'}: {$list['hotel_name']}
{l s='Hotel Phone'}: {$list['hotel_phone']}
{l s='Hotel Email'}: {$list['hotel_email']}
- {l s='Total Rooms'}: {$list['num_rooms']}
+ {l s='Total Stays'}: {$list['num_rooms']}

{/if} \ No newline at end of file diff --git a/mails/en/order_hotel_detail_text.tpl b/mails/en/order_hotel_detail_text.tpl index e80d3bb4b..b44866e10 100644 --- a/mails/en/order_hotel_detail_text.tpl +++ b/mails/en/order_hotel_detail_text.tpl @@ -4,6 +4,6 @@ {l s='Hotel Name'}: {$list['hotel_name']} {l s='Hotel Phone'}: {$list['hotel_phone']} {l s='Hotel Email'}: {$list['hotel_email']} -{l s='Total Rooms'}: {$list['num_rooms']} +{l s='Total Stays'}: {$list['num_rooms']} {/if} \ No newline at end of file diff --git a/mails/en/order_refund_completed_admin.txt b/mails/en/order_refund_completed_admin.txt index 5ab3942c1..13e4ceedd 100755 --- a/mails/en/order_refund_completed_admin.txt +++ b/mails/en/order_refund_completed_admin.txt @@ -12,8 +12,8 @@ Transaction Id: {id_transaction} Booking details -Room Num -Room Type +Stay Num +Stay Type Hotel Duration {refundBookingHtml} diff --git a/mails/en/order_refund_completed_customer.txt b/mails/en/order_refund_completed_customer.txt index c063d7c0e..ee20a0bf9 100755 --- a/mails/en/order_refund_completed_customer.txt +++ b/mails/en/order_refund_completed_customer.txt @@ -12,9 +12,9 @@ Payment Mode: {payment_mode} Transaction Id: {id_transaction} Booking details -Room Type +Stay Type Hotel -Num. Rooms +Num. Stays Duration {refundBookingHtml} diff --git a/mails/en/order_refund_denied_admin.txt b/mails/en/order_refund_denied_admin.txt index 722b43415..b4bf0dc27 100755 --- a/mails/en/order_refund_denied_admin.txt +++ b/mails/en/order_refund_denied_admin.txt @@ -10,8 +10,8 @@ Refund Status: {status_name} Booking details -Room Num -Room Type +Stay Num +Stay Type Hotel Duration diff --git a/mails/en/order_refund_denied_customer.txt b/mails/en/order_refund_denied_customer.txt index cbd4410fe..b6c9b4318 100755 --- a/mails/en/order_refund_denied_customer.txt +++ b/mails/en/order_refund_denied_customer.txt @@ -11,9 +11,9 @@ Refund Status: {status_name} Booking details -Room Type +Stay Type Hotel -Num. Rooms +Num. Stays Duration {refundBookingHtml} diff --git a/mails/en/order_refund_pending_admin.txt b/mails/en/order_refund_pending_admin.txt index f520f617c..24b12dfe0 100755 --- a/mails/en/order_refund_pending_admin.txt +++ b/mails/en/order_refund_pending_admin.txt @@ -11,8 +11,8 @@ Cancelation Reason: {cancelation_reason} Requested Booking Cancellations -Room Num -Room Type +Stay Num +Stay Type Hotel Duration diff --git a/mails/en/order_refund_pending_customer.txt b/mails/en/order_refund_pending_customer.txt index 012c6e64e..fc93e00c1 100755 --- a/mails/en/order_refund_pending_customer.txt +++ b/mails/en/order_refund_pending_customer.txt @@ -10,9 +10,9 @@ Refund Status: {status_name} Booking details -Room Type +Stay Type Hotel -Num. Rooms +Num. Stays Duration {refundBookingHtml} diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js index cd98e1d01..568aaf46b 100644 --- a/modules/blockcart/ajax-cart.js +++ b/modules/blockcart/ajax-cart.js @@ -136,6 +136,7 @@ var ajaxCart = { var dateFrom = $(this).attr('cat_rm_check_in'); var dateTo = $(this).attr('cat_rm_check_out'); + occupancy_required_for_booking = $(this).closest('.booking_room_fields').data('occupancy-required'); var occupancy = getBookingOccupancyDetails($(this).closest('.booking_room_fields'), true); /* By Webkul * Note : In our case minimalQuantity is taken from Qty. field @@ -378,9 +379,6 @@ var ajaxCart = { if ($('.cart_block_list').hasClass('collapsed')) this.expand(); - var isOccupancyBooking = getOccupancyRequiredForBooking($(callerElement).closest('.booking_room_fields')); - ajaxCart.lastOccupancyRequiredForBooking = isOccupancyBooking; - // create from data in order to manage adding different type of products var req = new FormData(); req.append('controller', 'cart'); @@ -401,7 +399,7 @@ var ajaxCart = { if (typeof dateTo != 'undefined') req.append('dateTo', dateTo); - if (isOccupancyBooking) { + if (occupancy_required_for_booking) { req.append('occupancy', JSON.stringify(occupancy)); } else { req.append('qty', ((occupancy && occupancy != null) ? occupancy : '1')); @@ -1206,28 +1204,22 @@ var ajaxCart = { $('#layer_cart_product_quantity').parent().show(); var product_quantity_text = ''; if(parseInt(product.booking_product)) { - var roomLabel = product.attribute_type || (typeof room_txt !== 'undefined' ? room_txt : 'Room'); - var roomsLabel = product.attribute_types || (typeof rooms_txt !== 'undefined' ? rooms_txt : roomLabel); - applyRoomLabelsToLayer(roomLabel, roomsLabel); let rooms = 0; let adults = 0; let children = 0; - var isOccupancyBooking = (typeof ajaxCart.lastOccupancyRequiredForBooking !== 'undefined') ? ajaxCart.lastOccupancyRequiredForBooking : occupancy_required_for_booking; - var $roomLabel = $('#layer_cart .layer_cart_room_txt .layer_cart_attribute_type'); - if ($roomLabel.length) { - var $labelContainer = $roomLabel.closest('.layer_cart_room_txt'); - var label = isOccupancyBooking ? $labelContainer.data('label-occupancy') : $labelContainer.data('label-quantity'); - if (label) { - $roomLabel.text(label); - } + if (typeof product.layer_cart_attribute_label !== 'undefined') { + $('#layer_cart .layer_cart_attribute_type').text(product.layer_cart_attribute_label); } - if (isOccupancyBooking) { + if(typeof product.layer_cart_room_success_msg !== 'undefined'){ + $('#layer_cart .layer_cart_room_success_msg').text(product.layer_cart_room_success_msg); + } + if (occupancy_required_for_booking) { $.each(product.occupancy, function(index, val) { rooms++; adults += parseInt(val.adults); children += parseInt(val.children); }); - product_quantity_text = getRoomTypeGuestOccupancyFormated(adults, children, rooms); + product_quantity_text = getRoomTypeGuestOccupancyFormated(adults, children, rooms,product.room_info.room_type_selling_object, product.room_info.multiple_room_type_selling_object); } else { product_quantity_text = product.occupancy; } @@ -1469,8 +1461,7 @@ function getBookingOccupancyDetails(bookingform, booking_product) { let occupancy; if (booking_product) { - var isOccupancyBooking = getOccupancyRequiredForBooking(bookingform); - if (isOccupancyBooking) { + if (occupancy_required_for_booking) { $('.booking_guest_occupancy_conatiner .dropdown').removeClass('open'); let selected_occupancy = $(bookingform).find(".occupancy_info_block.selected") if (selected_occupancy.length) { @@ -1513,29 +1504,3 @@ function getBookingOccupancyDetails(bookingform, booking_product) return occupancy; } -function applyRoomLabelsToLayer(roomLabel, roomsLabel) -{ - var $layer = $('#layer_cart'); - $layer.find('[data-room-msg-template]').each(function() { - var template = $(this).attr('data-room-msg-template'); - if (!template) { - return; - } - var text = template.replace(/__ROOMS__/g, roomsLabel).replace(/__ROOM__/g, roomLabel); - $(this).text(text); - }); -} - -function getOccupancyRequiredForBooking(bookingform) { - var value = occupancy_required_for_booking; - var $form = bookingform ? $(bookingform) : $('#booking-form').closest('.booking_room_fields'); - - if ($form.length) { - var dataVal = $form.data('occupancy-required'); - if (dataVal !== undefined) { - value = parseInt(dataVal) === 1; - } - } - - return value; -} diff --git a/modules/blockcart/blockcart.php b/modules/blockcart/blockcart.php index 7cf3c7325..e2e975b2e 100644 --- a/modules/blockcart/blockcart.php +++ b/modules/blockcart/blockcart.php @@ -305,18 +305,20 @@ class Blockcart extends Module 'cart_default' ); $addedProduct['booking_product'] = $objProduct->booking_product; - $roomLabel = $objRoomType->getRoomTypeInfoByIdProduct($objProduct->id, $this->context->language->id); - if ($roomLabel) { - $addedProduct['attribute_type'] = $roomLabel['room_type_selling_type_name']; - $addedProduct['attribute_types'] = $roomLabel['room_type_selling_type_name'].'s'; - } + $room_info = $objRoomType->getRoomTypeInfoByIdProduct($objProduct->id, $this->context->language->id); + $addedProduct['room_info'] = $room_info; if ($objProduct->booking_product) { + $addedProduct['occupancy_required_for_booking'] = (bool) Product::isOccupancyBookingMethod($objProduct->id); + $addedProduct['layer_cart_attribute_label'] = $addedProduct['occupancy_required_for_booking'] + ? sprintf($this->l('%s occupancy'), $room_info['room_type_selling_object']) + : sprintf($this->l('%s quantity added'), $room_info['multiple_room_type_selling_object']); $price = $addedProduct['price'] = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice( $objProduct->id, $addedProduct['date_from'], $addedProduct['date_to'], $addedProduct['occupancy'] ); + $addedProduct['layer_cart_room_success_msg'] = sprintf($this->l('%s successfully added to your cart'), $room_info['room_type_selling_object']); if ($priceDisplayMethod == PS_TAX_EXC) { $addedProduct['price'] = Tools::displayPrice($price['total_price_tax_excl']); } else { @@ -473,6 +475,8 @@ class Blockcart extends Module $res = $this->getContentVars($params); if (is_array($res) && ($id_product = Tools::getValue('id_product')) && Configuration::get('PS_BLOCK_CART_SHOW_CROSSSELLING')) { + $isOccupancyType = Product::isOccupancyBookingMethod($id_product); + $this->context->smarty->assign('occupancy_required_for_booking', $isOccupancyType); $this->smarty->assign('orderProducts', OrderDetail::getCrossSells($id_product, $this->context->language->id, Configuration::get('PS_BLOCK_CART_XSELL_LIMIT'))); $res['crossSelling'] = $this->display(__FILE__, 'crossselling.tpl'); } diff --git a/modules/blockcart/blockcart.tpl b/modules/blockcart/blockcart.tpl index 534e111ac..5e90552ea 100644 --- a/modules/blockcart/blockcart.tpl +++ b/modules/blockcart/blockcart.tpl @@ -33,8 +33,8 @@ {$total_products_in_cart} - - + + {if $cart_qties > 0} {if $priceDisplay == 1} @@ -196,7 +196,7 @@ {block name='blockcart_layer_cart_left_heading'}

- {l s='Room successfully added to your cart' mod='blockcart'} + {l s='Stay successfully added to your cart' mod='blockcart'}

{l s='Product successfully added to your cart' mod='blockcart'} @@ -223,14 +223,12 @@
- - {if isset($occupancy_required_for_booking) && $occupancy_required_for_booking}{l s='Room occupancy' mod='blockcart'}{else}{l s='Rooms quantity added' mod='blockcart'}{/if}  -  - + {if isset($occupancy_required_for_booking) && $occupancy_required_for_booking}{l s='Stay occupancy' mod='blockcart'}{else}{l s='Stays quantity added' mod='blockcart'}{/if}  -  {l s='Quantity' mod='blockcart'}  - 
- {l s='Room type cost' mod='blockcart'}  -  + {l s='Stay type cost' mod='blockcart'}  -  {l s='Total' mod='blockcart'}  - 
@@ -434,7 +432,7 @@ {addJsDefL name=qty_txt}{l s='Qty' mod='blockcart' js=1}{/addJsDefL} {addJsDefL name=duration_txt}{l s='Duration' mod='blockcart' js=1}{/addJsDefL} {addJsDefL name=capacity_txt}{l s='Capacity' mod='blockcart' js=1}{/addJsDefL} - {addJsDefL name=remove_rm_title}{l s='Remove this room from my cart' mod='blockcart' js=1}{/addJsDefL} + {addJsDefL name=remove_rm_title}{l s='Remove this stay from my cart' mod='blockcart' js=1}{/addJsDefL} {addJsDefL name=no_internet_txt}{l s='No internet. Please check your internet connection.' mod='blockcart' js=1}{/addJsDefL} {addJsDef rm_avail_process_lnk = $link->getModuleLink('blockcart', 'checkroomavailabilityajaxprocess')} diff --git a/modules/blockcart/cartrow.tpl b/modules/blockcart/cartrow.tpl index e909aaacf..47d370f90 100644 --- a/modules/blockcart/cartrow.tpl +++ b/modules/blockcart/cartrow.tpl @@ -89,7 +89,7 @@

{$data_v['num_rm']} {convertPrice price=($data_v['amount'] + $data_v['demand_price'])}
- - + + @@ -70,7 +70,7 @@
{l s='Room No.' mod='hotelreservationsystem'}{l s='Room Type' mod='hotelreservationsystem'}{l s='Stay No.' mod='hotelreservationsystem'}{l s='Stay Type' mod='hotelreservationsystem'} {l s='Duration' mod='hotelreservationsystem'} {l s='Amount (Tax excl.)' mod='hotelreservationsystem'}
- + diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl index b8cc6ceee..a236ed232 100644 --- a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/booking-rooms.tpl @@ -16,10 +16,10 @@
@@ -27,7 +27,7 @@
{l s='Rooms Amount (Tax excl.):' mod='hotelreservationsystem'}{l s='Stays Amount (Tax excl.):' mod='hotelreservationsystem'} {if isset($cart_rooms_amount)}{convertPrice price=$cart_rooms_amount}{else}{convertPrice price=0}{/if}
- + @@ -59,13 +59,13 @@ - - + {if $book_v.occupancy_required_for_booking} @@ -148,7 +148,7 @@ -
{l s='%s No.' sprintf=$book_v['room_type_selling_type_name'] mod='hotelreservationsystem'}{l s='%s No.' sprintf=$book_v['room_type_selling_object'] mod='hotelreservationsystem'} {l s='Duration' mod='hotelreservationsystem'} {l s='Message' mod='hotelreservationsystem'} {l s='Allotment Type' mod='hotelreservationsystem'}
{l s='Duration' mod='hotelreservationsystem'}{l s='%s No.' sprintf=$book_v['room_type_selling_type_name'] mod='hotelreservationsystem'}{l s='%s No.' sprintf=$book_v['room_type_selling_object'] mod='hotelreservationsystem'} {l s='Allotment Type' mod='hotelreservationsystem'}{l s='Guests' mod='hotelreservationsystem'}
- + @@ -246,7 +246,7 @@
{l s='%s No.' sprintf=$book_v['room_type_selling_type_name'] mod='hotelreservationsystem'}{l s='%s No.' sprintf=$book_v['room_type_selling_object'] mod='hotelreservationsystem'} {l s='Duration' mod='hotelreservationsystem'} {l s='Order' mod='hotelreservationsystem'} {l s='Message' mod='hotelreservationsystem'}
- + diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/search-stats.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/search-stats.tpl index 11690bc24..f929dd4ff 100644 --- a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/search-stats.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/_partials/search-stats.tpl @@ -1,12 +1,12 @@
-
+
-

{l s='Total Rooms' mod='hotelreservationsystem'}

+

{l s='Total Stays' mod='hotelreservationsystem'}

{if isset($booking_data) && $booking_data}{$booking_data['stats']['total_rooms']|escape:'htmlall':'UTF-8'}{else}00{/if}

@@ -15,7 +15,7 @@
-

{l s='Available Rooms' mod='hotelreservationsystem'}

+

{l s='Available Stays' mod='hotelreservationsystem'}

{if isset($booking_data) && $booking_data}{$booking_data['stats']['num_avail']|escape:'htmlall':'UTF-8'}{else}00{/if}

@@ -35,7 +35,7 @@
-

{l s='Booked Rooms' mod='hotelreservationsystem'}

+

{l s='Booked Stays' mod='hotelreservationsystem'}

{if isset($booking_data) && $booking_data}{$booking_data['stats']['num_booked']|escape:'htmlall':'UTF-8'}{else}00{/if}

@@ -47,7 +47,7 @@
-

{l s='Unavailable Rooms' mod='hotelreservationsystem'}

+

{l s='Unavailable Stays' mod='hotelreservationsystem'}

{if isset($booking_data) && $booking_data}{$booking_data['stats']['num_unavail']|escape:'htmlall':'UTF-8'}{else}00{/if}

@@ -56,7 +56,7 @@
-

{l s='In-Cart Rooms' mod='hotelreservationsystem'}

+

{l s='In-Cart Stays' mod='hotelreservationsystem'}

{if isset($booking_data) && $booking_data}{$booking_data['stats']['num_cart']|escape:'htmlall':'UTF-8'}{else}00{/if}

@@ -67,7 +67,7 @@
- {l s='Available Rooms' mod='hotelreservationsystem'} + {l s='Available Stays' mod='hotelreservationsystem'}
@@ -75,11 +75,11 @@
- {l s='Unavailable Rooms' mod='hotelreservationsystem'} + {l s='Unavailable Stays' mod='hotelreservationsystem'}
- {l s='Booked Rooms' mod='hotelreservationsystem'} + {l s='Booked Stays' mod='hotelreservationsystem'}
\ No newline at end of file diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/view.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/view.tpl index 6dfd81da5..5d8cc6a22 100644 --- a/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/view.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/hotel_rooms_booking/helpers/view/view.tpl @@ -231,7 +231,7 @@
-
{l s='Total Rooms' mod='hotelreservationsystem'}
+
{l s='Total Stays' mod='hotelreservationsystem'}
@@ -239,15 +239,15 @@
-
{l s='Booked Rooms' mod='hotelreservationsystem'}
+
{l s='Booked Stays' mod='hotelreservationsystem'}
-
{l s='Unavailable Rooms' mod='hotelreservationsystem'}
+
{l s='Unavailable Stays' mod='hotelreservationsystem'}
-
{l s='Partially Available Rooms' mod='hotelreservationsystem'}
+
{l s='Partially Available Stays' mod='hotelreservationsystem'}
diff --git a/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl b/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl index 6a2ee54fa..c5069eb3e 100644 --- a/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl @@ -84,7 +84,7 @@ {if isset($refundReqBookings) && $refundReqBookings}
- {l s='Total rooms' mod='hotelreservationsystem'} : + {l s='Total stays' mod='hotelreservationsystem'} :
{$refundReqBookings|count} @@ -142,14 +142,14 @@ {if !$isRefundCompleted}
{/if} - - + + {if !$isRefundCompleted} - + {/if} {if $hasOrderDiscountOrPayment || $isRefundCompleted} @@ -176,7 +176,7 @@ - + '.(!$this->id_hotel ? '' : '').' @@ -415,7 +415,7 @@ class StatsCheckUp extends Module $hotelsHtml .= ' - + '.(!$this->id_hotel ? '' : '').' diff --git a/modules/statsproduct/statsproduct.php b/modules/statsproduct/statsproduct.php index 4307437f9..1b601a5c8 100644 --- a/modules/statsproduct/statsproduct.php +++ b/modules/statsproduct/statsproduct.php @@ -308,7 +308,7 @@ class StatsProduct extends ModuleGraph '.$this->l('Room type name').' diff --git a/pdf/invoice.extra-demands-tab.tpl b/pdf/invoice.extra-demands-tab.tpl index e7edf7fa4..d89bfdcfb 100644 --- a/pdf/invoice.extra-demands-tab.tpl +++ b/pdf/invoice.extra-demands-tab.tpl @@ -27,10 +27,10 @@
{l s='%s No.' sprintf=$book_v['room_type_selling_type_name'] mod='hotelreservationsystem'}{l s='%s No.' sprintf=$book_v['room_type_selling_object'] mod='hotelreservationsystem'} {l s='Status' mod='hotelreservationsystem'} {l s='Duration' mod='hotelreservationsystem'} {l s='Message' mod='hotelreservationsystem'}{l s='Room num' mod='hotelreservationsystem'}{l s='Room type' mod='hotelreservationsystem'}{l s='Stay num' mod='hotelreservationsystem'}{l s='Stay type' mod='hotelreservationsystem'} {l s='Property' mod='hotelreservationsystem'} {l s='Duration' mod='hotelreservationsystem'} {l s='Total cost (tax incl.)' mod='hotelreservationsystem'} {l s='Total paid amount (tax incl.)' mod='hotelreservationsystem'}{l s='Rooms cancelation charges' mod='hotelreservationsystem'}{l s='Stays cancelation charges' mod='hotelreservationsystem'}{l s='Refund amount' mod='hotelreservationsystem'} '.$this->l('Images').' '.$this->l('Orders').''.$this->l('Total rooms').''.$this->l('Total stays').' '.$this->l('Overall status').''.$this->l('Action').'
'.$this->l('Images').' '.$this->l('Orders').''.$this->l('Total rooms').''.$this->l('Total stays').' '.$this->l('Overall status').'
- '.$this->l('Total rooms').' + '.$this->l('Total stays').' '.$this->l('Action').' @@ -400,7 +400,7 @@ class StatsProduct extends ModuleGraph case 42: $this->_titles['main'][0] = $this->l('ID'); $this->_titles['main'][1] = $this->l('Room type name'); - $this->_titles['main'][2] = $this->l('Total Rooms'); + $this->_titles['main'][2] = $this->l('Total Stays'); break; } } diff --git a/modules/wkroomsearchblock/views/templates/hook/categoryPageSearch.tpl b/modules/wkroomsearchblock/views/templates/hook/categoryPageSearch.tpl index e0a1037a5..36f5f6ec9 100644 --- a/modules/wkroomsearchblock/views/templates/hook/categoryPageSearch.tpl +++ b/modules/wkroomsearchblock/views/templates/hook/categoryPageSearch.tpl @@ -24,7 +24,7 @@ {if isset($hotels_info) && count($hotels_info)}
-

{l s='Search Rooms' mod='wkroomsearchblock'}

+

{l s='Search Stays' mod='wkroomsearchblock'}


{block name='search_form'} diff --git a/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl b/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl index 26f90c9e8..6be773d60 100644 --- a/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl +++ b/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl @@ -164,7 +164,7 @@ {/foreach} {else}
-
{l s='Room - 1' mod='wkroomsearchblock'}
+
{l s='Stay - 1' mod='wkroomsearchblock'}
@@ -226,7 +226,7 @@
- {l s='Add Room' mod='wkroomsearchblock'} + {l s='Add Stay' mod='wkroomsearchblock'} @@ -240,7 +240,7 @@ {block name='search_form_submit'}
{/block} diff --git a/pdf/invoice.addresses-tab.tpl b/pdf/invoice.addresses-tab.tpl index df5e70de0..67de4a81f 100644 --- a/pdf/invoice.addresses-tab.tpl +++ b/pdf/invoice.addresses-tab.tpl @@ -33,7 +33,7 @@ -->
{if !empty($hotel_address)} - {l s='Hotel Detail' pdf='true'}

+ {l s='%s Detail' sprintf=$property_type pdf='true'}

{$hotel_address} {/if}
- + - + @@ -45,7 +45,7 @@ {/if}
{l s='Room Additional Facilities Detail' pdf='true'}{l s='Stay Additional Facilities Detail' pdf='true'}
{l s='Room Type' pdf='true'}{l s='Stay Type' pdf='true'} {l s='Name' pdf='true'} {l s='Tax rate(s)' pdf='true'} {l s='Total' pdf='true'}
{l s='(Tax excl.)' pdf='true'}
{$roomDemand['room_type_name']}
{dateFormat date=$roomDemand['date_from']} {l s='to' pdf='true'} {dateFormat date=$roomDemand['date_to']}
- {l s='Room' pdf='true'} - {$roomCount} + {l s='Stay' pdf='true'} - {$roomCount}
@@ -72,10 +72,10 @@ - + - + @@ -92,7 +92,7 @@ {/if}
{l s='Room Extra Services Detail' pdf='true'}{l s='Stay Extra Services Detail' pdf='true'}
{l s='Room Type' pdf='true'}{l s='Stay Type' pdf='true'} {l s='Name' pdf='true'} {l s='Tax rate(s)' pdf='true'} {l s='Qty' pdf='true'} {$htlBookingServices['room_type_name']}
{dateFormat date=$htlBookingServices['date_from']} {l s='to' pdf='true'} {dateFormat date=$htlBookingServices['date_to']}
- {l s='Room' pdf='true'} - {$roomCount} + {l s='Stay' pdf='true'} - {$roomCount}
diff --git a/pdf/invoice.product-tab.tpl b/pdf/invoice.product-tab.tpl index d31799c1f..8fb02e16e 100644 --- a/pdf/invoice.product-tab.tpl +++ b/pdf/invoice.product-tab.tpl @@ -27,20 +27,20 @@ - + {if $display_product_images} - + {/if} - + {* {if isset($layout.before_discount)} {/if} *} - + @@ -71,7 +71,7 @@
{l s='Rooms Details' pdf='true'}{l s='Stays Details' pdf='true'}
{l s='Room Image' pdf='true'}{l s='Stay Image' pdf='true'}{l s='Room Description' pdf='true'}{l s='Stay Description' pdf='true'} {l s='Tax Rate(s)' pdf='true'}{l s='Base price' pdf='true'}
{l s='(Tax excl.)' pdf='true'}
{l s='Unit Price' pdf='true'}
{l s='(Tax excl.)' pdf='true'}
{l s='Rooms' pdf='true'}{l s='Stays' pdf='true'} {l s='Check-in Date' pdf='true'} {l s='Check-out Date' pdf='true'} {l s='Total' pdf='true'}
{l s='(Tax excl.)' pdf='true'}

- {if $rm_v['adults'] <= 9}0{$rm_v['adults']}{else}{$rm_v['adults']}{/if} {if $rm_v['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $rm_v['children']}, {if $rm_v['children'] <= 9}0{$rm_v['children']}{else} {$rm_v['children']}{/if} {if $rm_v['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
{if $rm_v['num_rm'] <= 9}0{/if}{$rm_v['num_rm']} {if $rm_v['num_rm'] > 1}{l s='Rooms'}{else}{l s='Room'}{/if} + {if $rm_v['adults'] <= 9}0{$rm_v['adults']}{else}{$rm_v['adults']}{/if} {if $rm_v['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $rm_v['children']}, {if $rm_v['children'] <= 9}0{$rm_v['children']}{else} {$rm_v['children']}{/if} {if $rm_v['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
{if $rm_v['num_rm'] <= 9}0{/if}{$rm_v['num_rm']} {if $rm_v['num_rm'] > 1}{l s='Stays'}{else}{l s='Stay'}{/if}

diff --git a/pdf/invoice.tax-tab.tpl b/pdf/invoice.tax-tab.tpl index 511d8fe54..87d391bd6 100644 --- a/pdf/invoice.tax-tab.tpl +++ b/pdf/invoice.tax-tab.tpl @@ -68,7 +68,7 @@ {if $label == 'additional_services_tax'} {l s='Services' pdf='true'} {elseif $label == 'room_tax'} - {l s='Rooms' pdf='true'} + {l s='Stays' pdf='true'} {elseif $label == 'extra_demands_tax'} {l s='Facilities' pdf='true'} {elseif $label == 'convenience_fee_tax'} diff --git a/pdf/invoice.total-tab.tpl b/pdf/invoice.total-tab.tpl index b0a42eac7..6ce211442 100644 --- a/pdf/invoice.total-tab.tpl +++ b/pdf/invoice.total-tab.tpl @@ -27,7 +27,7 @@ {if isset($footer.room_price_tax_excl) && $footer.room_price_tax_excl}
- {l s='Total Rooms Cost (tax excl.)' pdf='true'} + {l s='Total Stays Cost (tax excl.)' pdf='true'} {displayPrice currency=$order->id_currency price=$footer.room_price_tax_excl} @@ -67,7 +67,7 @@ {* {if isset($footer.product_taxes) && $footer.product_taxes}
- {l s='Rooms Tax' pdf='true'} + {l s='Stays Tax' pdf='true'} {displayPrice currency=$order->id_currency price=($footer.room_price_tax_incl - $footer.room_price_tax_excl)} diff --git a/pdf/order-slip.product-tab.tpl b/pdf/order-slip.product-tab.tpl index 6ba4979dc..fb0b3b445 100644 --- a/pdf/order-slip.product-tab.tpl +++ b/pdf/order-slip.product-tab.tpl @@ -27,13 +27,13 @@ - + - + - + diff --git a/themes/hotel-reservation-theme/$tpl_dir./shopping-cart.tpl b/themes/hotel-reservation-theme/$tpl_dir./shopping-cart.tpl new file mode 100644 index 000000000..e69de29bb diff --git a/themes/hotel-reservation-theme/_partials/booking-form.tpl b/themes/hotel-reservation-theme/_partials/booking-form.tpl index 23dd74bc6..896a21643 100644 --- a/themes/hotel-reservation-theme/_partials/booking-form.tpl +++ b/themes/hotel-reservation-theme/_partials/booking-form.tpl @@ -19,15 +19,9 @@ * @copyright Since 2010 Webkul * @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 *} -{if isset($room_type_info['room_type_selling_type_name']) && $room_type_info['room_type_selling_type_name']} - {assign var=attribute_types value=$room_type_info['room_type_selling_type_name']|cat:'s'} - {assign var=attribute_type value=$room_type_info['room_type_selling_type_name']} -{else} - {assign var=attribute_types value={l s='Rooms'}} - {assign var=attribute_type value={l s='Room'}} -{/if} +
-
+
{block name='booking_form_content'}
{block name='product_hidden_fields'} @@ -72,7 +66,7 @@ {include file="./occupancy_field.tpl"} {/block} {else} - + {block name='quantity_field'} {include file="./quantity_field.tpl"} {/block} @@ -85,7 +79,7 @@
- +

{convertPrice price=$rooms_price|floatval} + @@ -106,7 +100,7 @@

{if isset($selected_service_product) && $selected_service_product}
-

{l s='Selected services'} {l s='(Per %s)' sprintf=$attribute_type}

+

{l s='Selected services'} {l s='(Per %s)' sprintf=$room_type_info['room_type_selling_object']}

{foreach $selected_service_product as $product}
@@ -127,7 +121,7 @@ {/if} {if isset($selected_demands) && $selected_demands}
-

{l s='Selected facilities'} {l s='(Per room)'}

+

{l s='Selected facilities'} {l s='(Per stay)'}

{foreach $selected_demands as $product}
@@ -149,7 +143,7 @@
-
{l s='Total price per %s' sprintf=$attribute_type}
+
{l s='Total price per %s' sprintf=$room_type_info['room_type_selling_object']}

{displayPrice price=$demands_price_per_room}

@@ -187,7 +181,7 @@ {$total_available_rooms|escape:'html':'UTF-8'} - {if $total_available_rooms > 1} {l s='%s left!' sprintf=$attribute_types} {else} {l s='%s left!' sprintf=$attribute_type} {/if} + {if $total_available_rooms > 1} {l s='%s left!' sprintf=$room_type_info['multiple_room_type_selling_object']} {else} {l s='%s left!' sprintf=$room_type_info['room_type_selling_object']} {/if}
{/if} {/block} @@ -218,7 +212,7 @@ {/block} {else}
- {l s='All %s sold out!' sprintf=$attribute_types} + {l s='All %s sold out!' sprintf=$room_type_info['multiple_room_type_selling_object']}
{/if} {/if} @@ -346,7 +340,7 @@ {/if} {* {if $order_date_restrict}
- {l s='You can\'t book rooms after %s.' sprintf=[{dateFormat date=$max_order_date full=0}]} + {l s='You can\'t book stays after %s.' sprintf=[{dateFormat date=$max_order_date full=0}]}
{/if} *} diff --git a/themes/hotel-reservation-theme/_partials/cart_booking_demands.tpl b/themes/hotel-reservation-theme/_partials/cart_booking_demands.tpl index f74c3b628..4af332b9e 100644 --- a/themes/hotel-reservation-theme/_partials/cart_booking_demands.tpl +++ b/themes/hotel-reservation-theme/_partials/cart_booking_demands.tpl @@ -39,7 +39,7 @@ {if isset($selectedRoomDemands) && $selectedRoomDemands}
-

{l s='Add below facilities to the rooms for better hotel experience'}

+

{l s='Add below facilities to the %s for better hotel experience' sprintf=$room_type_info['room_type_selling_object']}

{assign var=roomCount value=1} {foreach $selectedRoomDemands as $key => $roomDemand} @@ -47,7 +47,7 @@
@@ -101,7 +101,7 @@ {if isset($roomTypeServiceProducts) && $roomTypeServiceProducts}
-

{l s='Add below services to the rooms for better hotel experience'}

+

{l s='Add below services to the %s for better hotel experience' sprintf=$room_type_info['room_type_selling_object']}

{assign var=roomCount value=1} {foreach $cartRooms as $key => $cartRoom} @@ -109,7 +109,7 @@
diff --git a/themes/hotel-reservation-theme/_partials/occupancy_field.tpl b/themes/hotel-reservation-theme/_partials/occupancy_field.tpl index 004f64a96..dd77bde6f 100644 --- a/themes/hotel-reservation-theme/_partials/occupancy_field.tpl +++ b/themes/hotel-reservation-theme/_partials/occupancy_field.tpl @@ -20,20 +20,12 @@ * @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 *} -{if isset($room_type_info['room_type_selling_type_name']) && $room_type_info['room_type_selling_type_name']} - {assign var=attribute_type value=$room_type_info['room_type_selling_type_name']} - {assign var=attribute_types value=$room_type_info['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} -
- + {/foreach} diff --git a/themes/hotel-reservation-theme/order-confirmation.tpl b/themes/hotel-reservation-theme/order-confirmation.tpl index 9ead821bb..89da2e402 100644 --- a/themes/hotel-reservation-theme/order-confirmation.tpl +++ b/themes/hotel-reservation-theme/order-confirmation.tpl @@ -64,7 +64,7 @@ {if $any_back_order} {if $shw_bo_msg}
-

*{l s='Some of your rooms are on back order. Please read the following message for rooms with status on backorder'}

+

*{l s='Some of your stays are on back order. Please read the following message for stays with status on backorder'}

-  {$back_ord_msg}

@@ -76,7 +76,7 @@
{if isset($cart_htl_data)}
-
{l s='Room Details'}
+
{l s='Stay Details'}
{foreach from=$cart_htl_data key=data_k item=data_v} {foreach from=$data_v['date_diff'] key=rm_k item=rm_v} @@ -100,13 +100,6 @@
{assign var="is_full_date" value=($show_full_date && ($rm_v['data_form']|date_format:'%D' == $rm_v['data_to']|date_format:'%D'))} - {if isset($data_v['room_type_selling_type_name']) && $data_v['room_type_selling_type_name']} - {assign var=attribute_type value=$data_v['room_type_selling_type_name']} - {assign var=attribute_types value=$data_v['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='Check-in'}
@@ -124,7 +117,7 @@
-
{if $rm_v.num_rm > 1}{$attribute_types|escape:'html':'UTF-8'}{else}{$attribute_type|escape:'html':'UTF-8'}{/if}
+
{if $rm_v.num_rm > 1}{$data_v['multiple_room_type_selling_object']|escape:'html':'UTF-8'}{else}{$data_v['room_type_selling_object']|escape:'html':'UTF-8'}{/if}
{$rm_v.num_rm|string_format:'%02d'}
@@ -173,7 +166,7 @@
-

{l s='Room cost'} :

+

{l s='%s cost' sprintf=$data_v['multiple_room_type_selling_object']} :

diff --git a/themes/hotel-reservation-theme/order-detail.tpl b/themes/hotel-reservation-theme/order-detail.tpl index c6f5c2351..2e2489853 100644 --- a/themes/hotel-reservation-theme/order-detail.tpl +++ b/themes/hotel-reservation-theme/order-detail.tpl @@ -78,7 +78,7 @@ {if isset($obj_hotel_branch_information) && $obj_hotel_branch_information}

- {l s='%s Details' sprintf=$property_name} + {l s='%s Details' sprintf=[$property_name|default:'Hotel']}
@@ -102,7 +102,7 @@
-
{l s='%s Name' sprintf=$property_name}
+
{l s='%s Name' sprintf=[$property_name|default:'Hotel']}
{$obj_hotel_branch_information->hotel_name}
{l s='Phone Number'}
@@ -176,7 +176,7 @@ {if isset($obj_hotel_branch_information)} @@ -1064,7 +1057,7 @@
{if isset($hasRoomRefunds) && $hasRoomRefunds} - + {/if} {if isset($hasProductRefunds) && $hasProductRefunds} diff --git a/themes/hotel-reservation-theme/order-opc.tpl b/themes/hotel-reservation-theme/order-opc.tpl index 81115a208..8ccbfd473 100644 --- a/themes/hotel-reservation-theme/order-opc.tpl +++ b/themes/hotel-reservation-theme/order-opc.tpl @@ -62,7 +62,7 @@
{block name='order_opc_rooms_summary_heading'}
- {l s='Rooms & Price Summary'} + {l s='Stays & Price Summary'}
{/block} @@ -340,7 +340,7 @@ {include file="$tpl_dir./errors.tpl"} {/block} -

{l s='You have not added any rooms or products to your cart yet.'}

+

{l s='You have not added any stays or products to your cart yet.'}

{/if} {block name='order_opc_js_vars'} {strip} diff --git a/themes/hotel-reservation-theme/order-return.tpl b/themes/hotel-reservation-theme/order-return.tpl index 6b14106e1..382a94dee 100644 --- a/themes/hotel-reservation-theme/order-return.tpl +++ b/themes/hotel-reservation-theme/order-return.tpl @@ -54,16 +54,16 @@ {block name='order_return_detail'} {if $refundReqBookings} {if isset($refundReqProducts) && $refundReqProducts} -

{l s='Rooms refund requests'}

+

{l s='Stays refund requests'}

{/if}
{l s='Room Bookings Detail' pdf='true'}{l s='Stay Bookings Detail' pdf='true'}
{l s='Room Type / Reference' pdf='true'}{l s='Stay Type / Reference' pdf='true'} {l s='Hotel' pdf='true'} {l s='Duration' pdf='true'}{l s='Num rooms' pdf='true'}{l s='Num stays' pdf='true'} {l s='Total Price' pdf='true'}
{if $tax_excluded_display}{l s='(Tax Excl.)' pdf='true'}{else}{l s='(Tax Incl.)' pdf='true'}{/if}
{$data_v['num_rm']} {convertPrice price=($data_v['amount'] + $data_v['demand_price'])}
{l s='Order'}{l s='Total rooms'}{l s='Total stays'}{l s='Total products'}
- - + + - + {if $isRefundCompleted} @@ -72,7 +72,7 @@ {foreach from=$refundReqBookings item=$booking name=refundRequest} - + {assign var="is_full_date" value=($show_full_date && ($booking['date_from']|date_format:'%D' == $booking['date_to']|date_format:'%D'))} diff --git a/themes/hotel-reservation-theme/product.tpl b/themes/hotel-reservation-theme/product.tpl index d7d9f8dc6..2afc79a4e 100644 --- a/themes/hotel-reservation-theme/product.tpl +++ b/themes/hotel-reservation-theme/product.tpl @@ -49,7 +49,7 @@ {/if} --> {if isset($adminActionDisplay) && $adminActionDisplay}
-

{l s='This room type is not visible to your customers.'} +

{l s='This stay type is not visible to your customers.'} {l s='Publish'} @@ -205,18 +205,13 @@ {/block} {/if}

- {if isset($room_type_info['room_type_selling_type_name']) && $room_type_info['room_type_selling_type_name']} - {assign var=attribute_type value=$room_type_info['room_type_selling_type_name']} - {else} - {assign var=attribute_type value={l s='Room'}} - {/if}
{block name='product_tabs'}
{l s='Rooms'}{l s='Room type'}{l s='Stays'}{l s='Stay type'} {l s='Property Name'} {l s='Duration'}{l s='Total rooms price (tax incl.)'}{l s='Total stays price (tax incl.)'} {l s='Extra services price (tax incl.)'}{l s='Refund amount'}
{l s='Room'} - {$smarty.foreach.refundRequest.iteration|string_format:'%02d'}{l s='Stay'} - {$smarty.foreach.refundRequest.iteration|string_format:'%02d'} {$booking['room_type_name']|escape:'htmlall':'UTF-8'} {$booking['hotel_name']|escape:'htmlall':'UTF-8'}