Fixed: support per-room booking methods, update selling object type across order pages, and add default property & room type values
This commit is contained in:
@@ -37,9 +37,7 @@
|
||||
<th><span class="title_box">{l s='Room Image'}</th>
|
||||
<th><span class="title_box">{l s='Room Type'}</span></th>
|
||||
<th><span class="title_box">{l s='Duration'}</span></th>
|
||||
{if $occupancy_required_for_booking}
|
||||
<th><span class="fixed-width-lg title_box">{l s='Occupancy'}</span></th>
|
||||
{/if}
|
||||
<th><span class="fixed-width-lg title_box">{l s='Occupancy / Quantity'}</span></th>
|
||||
<th><span class="title_box">{l s='Unit Price (tax excl)'}</span></th>
|
||||
<th><span class="title_box">{l s='Extra Services / Fees (tax excl)'}</span></th>
|
||||
{* <th><span class="title_box">{l s='Total Rooms Price (tax excl)'}</span></th> *}
|
||||
@@ -58,7 +56,11 @@
|
||||
</td>
|
||||
{assign var="is_full_date" value=($show_full_date && ($data['date_from']|date_format:'%D' == $data['date_to']|date_format:'%D'))}
|
||||
<td>{dateFormat date=$data.date_from full=$is_full_date} - {dateFormat date=$data.date_to full=$is_full_date}</td>
|
||||
{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}
|
||||
<td>
|
||||
<div class="dropdown">
|
||||
<button class="booking_guest_occupancy btn btn-default btn-left btn-block input-occupancy" type="button">
|
||||
@@ -116,6 +118,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
{else}
|
||||
<td>
|
||||
<span class="text-muted">1</span>
|
||||
</td>
|
||||
{/if}
|
||||
<td id="cart_detail_data_unit_price_{$data.id|escape:'html':'UTF-8'}">
|
||||
{assign var=shown_room_type_price value=$data.feature_price_tax_excl}
|
||||
|
||||
@@ -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}
|
||||
<div id="product-configuration" class="panel product-tab">
|
||||
<input type="hidden" name="submitted_tabs[]" value="Configuration" />
|
||||
<h3 class="tab"> <i class="icon-AdminAdmin"></i> {l s='Rooms'}</h3>
|
||||
<h3 class="tab"> <i class="icon-AdminAdmin"></i> {$attribute_types}</h3>
|
||||
|
||||
<input type="hidden" id="checkConfSubmit" value="0" name="checkConfSubmit">
|
||||
|
||||
@@ -35,7 +42,7 @@
|
||||
<th class="col-sm-2 center">
|
||||
<label class="control-label required">
|
||||
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Enter room number. For eg. A-101, A-102 etc. Invalid characters <>;=#{}'}">
|
||||
{l s='Room No.'}
|
||||
{l s='%s No.' sprintf=$attribute_type}
|
||||
</span>
|
||||
</label>
|
||||
</th>
|
||||
@@ -55,14 +62,14 @@
|
||||
</th>
|
||||
<th class="col-sm-3 center">
|
||||
<label class="control-label">
|
||||
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Enter extra information about this room. Leave empty if not required.'}">
|
||||
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Enter extra information about this %s. Leave empty if not required.' sprintf=$attribute_types}">
|
||||
{l s='Extra Information'}
|
||||
</span>
|
||||
</label>
|
||||
</th>
|
||||
<th class="col-sm-2 center">
|
||||
<label class="control-label">
|
||||
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Set date ranges when room is set to Temporarily Inactive.'}">
|
||||
<span class="label-tooltip" data-toggle="tooltip" data-original-title="{l s='Set date ranges when %s is set to Temporarily Inactive.' sprintf=$attribute_types}">
|
||||
{l s='Disable Dates'}
|
||||
</span>
|
||||
</label>
|
||||
@@ -201,14 +208,14 @@
|
||||
<li class="divider"></li>
|
||||
<li>
|
||||
<a id="bulk-create-rooms-button" class="bulkCreateRoomModal" data-toggle="modal" data-target="#bulkCreateRoomModal" type="button" data-size="s" data-style="expand-right">
|
||||
<i class="icon-plus"></i> {l s='Create Rooms'}
|
||||
<i class="icon-plus"></i> {l s='Create %s' sprintf=$attribute_types}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<button id="add-more-rooms-button" class="btn btn-default" type="button" data-size="s" data-style="expand-right">
|
||||
<i class="icon icon-plus"></i>
|
||||
{l s='Add More Rooms'}
|
||||
{l s='Add More %s' sprintf=$attribute_types}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -253,7 +260,7 @@
|
||||
<div class="alert alert-warning">
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
<ul class="list-unstyled">
|
||||
<li>{l s='Please save this room first to add dates.'}</li>
|
||||
<li>{l s='Please save this %s first to add dates.' sprintf=$attribute_types}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -325,7 +332,7 @@
|
||||
<button type="button" class="close margin-right-10" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title"><i class="icon-calendar"></i> {l s='Bulk Update Rooms'}</h4>
|
||||
<h4 class="modal-title"><i class="icon-calendar"></i> {l s='Bulk Update %s' sprintf=$attribute_types}</h4>
|
||||
</div>
|
||||
<div class="modal-body padding-top-20">
|
||||
<div class="text-left errors-wrap" style="display: none;"></div>
|
||||
@@ -400,13 +407,13 @@
|
||||
<button type="button" class="close margin-right-10" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title"><i class="icon-calendar"></i> {l s='Bulk Create Rooms'}</h4>
|
||||
<h4 class="modal-title"><i class="icon-calendar"></i> {l s='Bulk Create %s' sprintf=$attribute_types}</h4>
|
||||
</div>
|
||||
<div class="modal-body padding-top-20">
|
||||
<div class="text-left errors-wrap" style="display: none;"></div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span>{l s='Room prefix'}</span>
|
||||
<span>{l s='%s prefix' sprintf=$attribute_type}</span>
|
||||
</label>
|
||||
<div class="col-lg-6">
|
||||
<input type="text" name="bulk_create_room_prefix"/>
|
||||
@@ -414,7 +421,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span>{l s='Starting Room No.'}</span>
|
||||
<span>{l s='Starting %s No.' sprintf=$attribute_type}</span>
|
||||
</label>
|
||||
<div class="col-lg-6">
|
||||
<input type="text" name="bulk_create_room_num"/>
|
||||
@@ -422,7 +429,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label required col-lg-3">
|
||||
<span>{l s='Number of Rooms'}</span>
|
||||
<span>{l s='Number of %s' sprintf=$attribute_types}</span>
|
||||
</label>
|
||||
<div class="col-lg-6">
|
||||
<input type="text" name="bulk_create_room_qty"/>
|
||||
@@ -558,13 +565,13 @@
|
||||
<li class="enable_selected_dates btn btn-default">
|
||||
<span class="enable_selected_dates">
|
||||
<i class="icon-check"></i>
|
||||
{l s='Make Room Available'}
|
||||
{l s='Make %s Available' sprintf=$attribute_type}
|
||||
</span>
|
||||
</li>
|
||||
<li class="disabled_selected_dates btn btn-default">
|
||||
<span class="disabled_selected_dates">
|
||||
<i class="icon-ban"></i>
|
||||
{l s='Disable Room'}
|
||||
{l s='Disable %s' sprintf=$attribute_type}
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -1524,7 +1531,7 @@
|
||||
$('#deactiveDatesModal').attr('data-room-row-index', roomRowIndex);
|
||||
$('#deactiveDatesModal').attr('data-id-room', idRoom);
|
||||
if ($.trim(roomNum) != '') {
|
||||
roomNum = '( '+'{l s='Room No'}'+' '+roomNum+')';
|
||||
roomNum = '( '+'{l s='%s No' sprintf=$attribute_types}'+' '+roomNum+')';
|
||||
}
|
||||
|
||||
$('#deactiveDatesModal .disable_dates_room_num').html(roomNum);
|
||||
|
||||
@@ -125,16 +125,16 @@
|
||||
<div class="form-group" id="hotel_selection">
|
||||
{if isset($htl_room_type)}
|
||||
<label class="control-label col-sm-3 required">
|
||||
{l s='Hotel'}
|
||||
{l s='Property'}
|
||||
</label>
|
||||
<div class="col-sm-5">
|
||||
<input type="text" class="form-control" value="{$htl_full_info['hotel_name']}" readonly>
|
||||
<input type="hidden" name="id_hotel" value="{$htl_room_type['id_hotel']}">
|
||||
<p class="help-block">{l s='Hotel once assigned cannot be reassigned'}</p>
|
||||
<p class="help-block">{l s='Property once assigned cannot be reassigned'}</p>
|
||||
</div>
|
||||
{else}
|
||||
<label class="control-label col-sm-3 required" for="hotel_place">
|
||||
{l s='Select Hotel'}
|
||||
{l s='Select Property'}
|
||||
</label>
|
||||
<div class="col-sm-5">
|
||||
{if isset($htl_info) && $htl_info}
|
||||
@@ -143,9 +143,9 @@
|
||||
<option value="{$htl_dtl['id_hotel']}" >{$htl_dtl['hotel_name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<p class="help-block">{l s='Hotel once assigned cannot be reassigned'}</p>
|
||||
<p class="help-block">{l s='Property once assigned cannot be reassigned'}</p>
|
||||
{else}
|
||||
<div class="control-label col-sm-3 text-danger">{l s='No hotel are available'}</div>
|
||||
<div class="control-label col-sm-3 text-danger">{l s='No property are available'}</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -465,6 +465,35 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="form-group" id="room_type_selection">
|
||||
<label class="control-label col-sm-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select the room selling type for this room type.'}">
|
||||
{l s='Room Type Selling Object Types'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-5">
|
||||
<select name="id_room_type_selling_object_type" id="id_room_type_selling_object_type" class="form-control chosen" >
|
||||
{foreach from=$room_type_selling_object_types_info item=room_type_selling_object_type_info}
|
||||
<option value="{$room_type_selling_object_type_info['id_room_type_selling_object_type']}" {if isset($selected_room_type_object_selling_types) && $room_type_selling_object_type_info['id_room_type_selling_object_type'] == $selected_room_type_object_selling_types}selected{/if}>{$room_type_selling_object_type_info['name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" id="booking_types_selection">
|
||||
<label class="control-label col-sm-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select all booking methods available for this room type.'}">
|
||||
{l s='Booking Method'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-5">
|
||||
<select name="booking_method" id="booking_method" class="form-control">
|
||||
{foreach from=$booking_methods_info item=booking_method_info}
|
||||
<option value="{$booking_method_info['id']}" {if isset($selected_booking_method) && $booking_method_info['id'] == $selected_booking_method}selected{/if}>{$booking_method_info['name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" id="bed_types_selection">
|
||||
<label class="control-label col-sm-3">
|
||||
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select all bed types available for this room type.'}">
|
||||
|
||||
@@ -247,6 +247,8 @@ class ProductCore extends ObjectModel
|
||||
public $is_virtual;
|
||||
public $booking_product;
|
||||
public $id_pack_product_attribute;
|
||||
public $id_room_type_selling_object_type;
|
||||
public $booking_method;
|
||||
public $cache_default_attribute;
|
||||
|
||||
/**
|
||||
@@ -341,6 +343,8 @@ class ProductCore extends ObjectModel
|
||||
'show_price' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
|
||||
'indexed' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
|
||||
'visibility' => array('type' => self::TYPE_STRING, 'shop' => true, 'validate' => 'isProductVisibility', 'values' => array('both', 'catalog', 'search', 'none'), 'default' => 'both'),
|
||||
'id_room_type_selling_object_type' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => false),
|
||||
'booking_method' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => false),
|
||||
'cache_default_attribute' => array('type' => self::TYPE_INT, 'shop' => true),
|
||||
'advanced_stock_management' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
|
||||
'date_add' => array('type' => self::TYPE_DATE, 'shop' => true, 'validate' => 'isDate'),
|
||||
@@ -6873,4 +6877,26 @@ class ProductCore extends ObjectModel
|
||||
|
||||
return $price * (int)$quantity;
|
||||
}
|
||||
|
||||
public static function getRoomTypeBookingMethod($idProduct, $fallbackType = null)
|
||||
{
|
||||
$objProduct = new self($idProduct);
|
||||
$bookingType = null;
|
||||
if(Validate::isLoadedObject($objProduct)) {
|
||||
$bookingType = $objProduct->booking_method;
|
||||
if ($bookingType !== null && $bookingType != HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_DEFAULT) {
|
||||
return $bookingType;
|
||||
}
|
||||
}
|
||||
if ($fallbackType === null) {
|
||||
$context = Context::getContext();
|
||||
if (isset($context->employee->id) && (int)$context->employee->id) {
|
||||
$fallbackType = (int) Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE');
|
||||
} else {
|
||||
$fallbackType = (int) Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE');
|
||||
}
|
||||
}
|
||||
|
||||
return (int) $fallbackType;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,9 @@ abstract class ModuleGraphCore extends Module
|
||||
{
|
||||
protected $_employee;
|
||||
|
||||
/** @var string CSV data */
|
||||
protected $_csv;
|
||||
|
||||
/** @var array of integers graph data */
|
||||
protected $_values = array();
|
||||
|
||||
|
||||
@@ -678,16 +678,11 @@ class AdminCartsControllerCore extends AdminController
|
||||
$cart_detail_data[$key]['room_type_info'] = $objRoomType->getRoomTypeInfoByIdProduct($cart_data['id_product']);
|
||||
}
|
||||
}
|
||||
$occupancyRequiredForBooking = false;
|
||||
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
$occupancyRequiredForBooking = true;
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'cart_detail_data' => $cart_detail_data,
|
||||
'cart' => $objCart,
|
||||
'currency' => new Currency((int)$this->context->cart->id_currency),
|
||||
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
|
||||
'ajax' => true
|
||||
));
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'visible_default' => true
|
||||
),
|
||||
'hotel_name' => array(
|
||||
'title' => $this->l('Hotel'),
|
||||
'title' => $this->l('Property Name'),
|
||||
'type' => 'select',
|
||||
'filter_key' => 'hbd!id_hotel',
|
||||
'list' => $this->hotelsArray,
|
||||
@@ -425,11 +425,6 @@ class AdminOrdersControllerCore extends AdminController
|
||||
}
|
||||
}
|
||||
|
||||
$occupancyRequiredForBooking = false;
|
||||
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
$occupancyRequiredForBooking = true;
|
||||
}
|
||||
|
||||
$objHotelAdvancedPayment = new HotelAdvancedPayment();
|
||||
$this->context->smarty->assign(array(
|
||||
'order_total' => $cart->getOrderTotal(true),
|
||||
@@ -445,7 +440,6 @@ class AdminOrdersControllerCore extends AdminController
|
||||
'currency' => new Currency((int)$cart->id_currency),
|
||||
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
|
||||
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
|
||||
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
|
||||
));
|
||||
|
||||
} else {
|
||||
@@ -483,7 +477,7 @@ class AdminOrdersControllerCore extends AdminController
|
||||
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id)) {
|
||||
$this->toolbar_btn['hotel'] = array(
|
||||
'href' => $this->context->link->getAdminLink('AdminAddHotel').'&id='.$idHotel.'&updatehtl_branch_info',
|
||||
'desc' => $this->l('View Hotel'),
|
||||
'desc' => $this->l('View Property'),
|
||||
'class' => 'icon-building',
|
||||
'target' => true,
|
||||
);
|
||||
|
||||
@@ -437,14 +437,6 @@ class AdminPPreferencesControllerCore extends AdminController
|
||||
Db::getInstance()->execute($sql);
|
||||
}
|
||||
|
||||
if (Tools::getValue('PS_FRONT_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS) {
|
||||
$_POST['PS_FRONT_ROOM_UNIT_SELECTION_TYPE'] = HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY;
|
||||
}
|
||||
|
||||
if (Tools::getValue('PS_BACKOFFICE_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS) {
|
||||
$_POST['PS_BACKOFFICE_ROOM_BOOKING_TYPE'] = HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY;
|
||||
}
|
||||
|
||||
if (Tools::getIsset('PS_CATALOG_MODE')) {
|
||||
Tools::clearSmartyCache();
|
||||
Media::clearCache();
|
||||
|
||||
@@ -290,7 +290,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
}
|
||||
|
||||
$this->fields_list['hotel_name'] = array(
|
||||
'title' => $this->l('Hotel'),
|
||||
'title' => $this->l('Property'),
|
||||
'type' => 'select',
|
||||
'multiple' => true,
|
||||
'operator' => 'or',
|
||||
@@ -4537,12 +4537,23 @@ class AdminProductsControllerCore extends AdminController
|
||||
$objHotelBedType = new HotelBedType();
|
||||
$bedTypes = $objHotelBedType->getAllBedTypes($this->context->language->id);
|
||||
$data->assign('bed_types_info', $bedTypes);
|
||||
$bookingMethods = $this->getRoomTypeBookingMethods();
|
||||
$data->assign('booking_methods_info', $bookingMethods);
|
||||
$objHotelRoomTypeBedType = new HotelRoomTypeBedType();
|
||||
if ($selectedBedTypes = $objHotelRoomTypeBedType->getRoomTypeBedTypes($product->id)) {
|
||||
$selectedBedTypes = array_column($selectedBedTypes, 'id_bed_type');
|
||||
$data->assign('selected_bed_types', $selectedBedTypes);
|
||||
}
|
||||
|
||||
$roomTypeObjectSellingTypes = HotelRoomTypeSellingType::getRoomTypeSellingObjectTypes($this->context->language->id);
|
||||
$data->assign('room_type_selling_object_types_info', $roomTypeObjectSellingTypes);
|
||||
if (!empty($product->id_room_type_selling_object_type)) {
|
||||
$data->assign('selected_room_type_object_selling_types', $product->id_room_type_selling_object_type);
|
||||
}
|
||||
if (!empty($product->booking_method)) {
|
||||
$data->assign('selected_booking_method', $product->booking_method);
|
||||
}
|
||||
|
||||
$this->tpl_form_vars['product'] = $product;
|
||||
$this->tpl_form_vars['custom_form'] = $data->fetch();
|
||||
}
|
||||
@@ -5502,6 +5513,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
) {
|
||||
$objRoomType = new HotelRoomType();
|
||||
$roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($objProduct->id);
|
||||
$attribute_types = $roomTypeInfo['room_type_selling_type_name'] ? $roomTypeInfo['room_type_selling_type_name'] : $this->l('Rooms');
|
||||
$idHotel = $roomTypeInfo['id_hotel'];
|
||||
$rowsToHighlight = array();
|
||||
$roomsInfo = array();
|
||||
@@ -5521,13 +5533,13 @@ class AdminProductsControllerCore extends AdminController
|
||||
if (!empty($roomNumber = trim(Tools::getValue('num')))
|
||||
&& !Validate::isUnsignedInt($roomNumber)
|
||||
) {
|
||||
$this->errors[] = Tools::displayError('Invalid Starting Room No.');
|
||||
$this->errors[] = sprintf(Tools::displayError('Invalid Starting %s No.') , $attribute_types);
|
||||
}
|
||||
|
||||
if (!($roomQuantity = Tools::getValue('qty'))) {
|
||||
$this->errors[] = Tools::displayError('Number of rooms is required.');
|
||||
$this->errors[] = sprintf(Tools::displayError('Number of %s is required.') ,$attribute_types);
|
||||
} else if (!Validate::isUnsignedInt($roomQuantity) || $roomQuantity < 1) {
|
||||
$this->errors[] = Tools::displayError('Invalid value for number of rooms.');
|
||||
$this->errors[] = sprintf(Tools::displayError('Invalid value for number of %s.') ,$attribute_types);
|
||||
}
|
||||
|
||||
if (trim($comment = Tools::getValue('room_comment'))) {
|
||||
@@ -5540,7 +5552,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
$disableDates = Tools::getValue('disable_dates');
|
||||
$roomsInfo['disable_dates_json'] = json_encode($disableDates);
|
||||
if (!$disableDates) {
|
||||
$this->errors[] = Tools::displayError('Please add at least one date range for updating the rooms status to temporary inactive.');
|
||||
$this->errors[] = sprintf(Tools::displayError('Please add at least one date range for updating the %s status to temporary inactive.') , $attribute_types);
|
||||
} else {
|
||||
$hasMissingRowError = false;
|
||||
foreach ($disableDates as $key => $dateRange) {
|
||||
@@ -5646,4 +5658,13 @@ class AdminProductsControllerCore extends AdminController
|
||||
|
||||
return $tpl->fetch();
|
||||
}
|
||||
|
||||
public function getRoomTypeBookingMethods()
|
||||
{
|
||||
return array(
|
||||
array('id' => HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_DEFAULT, 'name' => $this->l('Default')),
|
||||
array('id' => HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY, 'name' => $this->l('Room Occupancy')),
|
||||
array('id' => HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_QUANTITY, 'name' => $this->l('Rooms Quantity (No. of rooms)'))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,7 +310,8 @@ class CartControllerCore extends FrontController
|
||||
|
||||
if ($product->booking_product) {
|
||||
$occupancyRequiredForBooking = false;
|
||||
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
$roomUnitSelectionType = Product::getRoomTypeBookingMethod($this->id_product);
|
||||
if ($roomUnitSelectionType == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
$occupancyRequiredForBooking = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -220,6 +220,14 @@ class CategoryControllerCore extends FrontController
|
||||
|
||||
array_multisort($indi_arr, $direction, $booking_data['rm_data']);
|
||||
}
|
||||
|
||||
foreach ($booking_data['rm_data'] as $roomKey => $roomData) {
|
||||
if (isset($roomData['id_product'])) {
|
||||
$bookingMethod = Product::getRoomTypeBookingMethod($roomData['id_product']);
|
||||
$booking_data['rm_data'][$roomKey]['occupancy_required_for_booking'] =
|
||||
($bookingMethod == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$num_days = HotelHelper::getNumberOfDays($date_from, $date_to);
|
||||
|
||||
@@ -182,6 +182,7 @@ class OrderConfirmationControllerCore extends FrontController
|
||||
$cart_htl_data[$type_key]['cover_img'] = $cover_img;
|
||||
$cart_htl_data[$type_key]['adults'] = $rm_dtl['adults'];
|
||||
$cart_htl_data[$type_key]['children'] = $rm_dtl['children'];
|
||||
$cart_htl_data[$type_key]['room_type_selling_type_name'] = $rm_dtl['room_type_selling_type_name'];
|
||||
|
||||
foreach ($order_bk_data as $data_k => $data_v) {
|
||||
$date_join = strtotime($data_v['date_from']).strtotime($data_v['date_to']);
|
||||
|
||||
@@ -131,6 +131,9 @@ class OrderDetailControllerCore extends FrontController
|
||||
}
|
||||
$cartHotelData[$type_key]['id_product'] = $type_value['product_id'];
|
||||
$cartHotelData[$type_key]['cover_img'] = $type_value['cover_img'];
|
||||
if ($roomTypeInfo = $objRoomType->getRoomTypeInfoByIdProduct($type_value['product_id'])) {
|
||||
$cartHotelData[$type_key]['room_type_selling_type_name'] = $roomTypeInfo['room_type_selling_type_name'];
|
||||
}
|
||||
|
||||
|
||||
$objBookingDemand = new HotelBookingDemands();
|
||||
@@ -447,10 +450,12 @@ class OrderDetailControllerCore extends FrontController
|
||||
if ($idHotel = $addressTax->id_hotel) {
|
||||
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
|
||||
$hotelAddressInfo = HotelBranchInformation::getAddress($idHotel);
|
||||
$propertyName = $objHotelBranchInformation->getHotelPropertyTypeName();
|
||||
$objHotelBranchRefundRules = new HotelBranchRefundRules();
|
||||
$hotelRefundRules = $objHotelBranchRefundRules->getHotelRefundRules($idHotel, 0, 1);
|
||||
$this->context->smarty->assign(array(
|
||||
'obj_hotel_branch_information' => $objHotelBranchInformation,
|
||||
'property_name' => $propertyName,
|
||||
'hotel_address_info' => $hotelAddressInfo,
|
||||
'hotel_refund_rules' => $hotelRefundRules,
|
||||
));
|
||||
|
||||
@@ -341,7 +341,7 @@ class ProductControllerCore extends FrontController
|
||||
$hotel_info_by_id = $obj_hotel_branch->hotelBranchesInfo(false, 2, 1, $hotel_id);
|
||||
$hotel_policies = $hotel_info_by_id['policies'];
|
||||
$hotel_name = $hotel_info_by_id['hotel_name'];
|
||||
|
||||
$property_type = $obj_hotel_branch->getHotelPropertyTypeName($hotel_id);
|
||||
$addressInfo = HotelBranchInformation::getAddress($room_info_by_product_id['id_hotel']);
|
||||
$hotel_location = $addressInfo['city'].
|
||||
($addressInfo['id_state']?', '.$addressInfo['state']:'').', '.$addressInfo['country'];
|
||||
@@ -448,6 +448,7 @@ class ProductControllerCore extends FrontController
|
||||
'hotel_rating' => $hotel_info_by_id['rating'],
|
||||
'hotel_description' => $hotel_info_by_id['description'],
|
||||
'hotel_policies' => $hotel_policies,
|
||||
'property_type' => $property_type,
|
||||
'hotel_features' => $htl_features,
|
||||
'hotel_image_link' => $hotelImageLink,
|
||||
'hotel_has_images' => (bool) HotelImage::getCover($hotel_id),
|
||||
@@ -460,8 +461,11 @@ class ProductControllerCore extends FrontController
|
||||
)
|
||||
);
|
||||
|
||||
$roomBookingSelectedType = Product::getRoomTypeBookingMethod($this->product->id);
|
||||
$isOccupancyType = ($roomBookingSelectedType == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY);
|
||||
$this->context->smarty->assign('occupancy_required_for_booking',$isOccupancyType);
|
||||
$occupancy_value = Tools::getValue('occupancy', array());
|
||||
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_QUANTITY) {
|
||||
if ($roomBookingSelectedType == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_QUANTITY) {
|
||||
$occupancy_value = 1;
|
||||
} else {
|
||||
$useDefaultOccupancy = true;
|
||||
@@ -655,6 +659,7 @@ class ProductControllerCore extends FrontController
|
||||
$hotel = $objHotel->hotelBranchesInfo(false, 2, 1, $idHotel);
|
||||
$hotelLocation = $hotel['city'].', '.(isset($hotel['state_name']) ? ' '.$hotel['state_name'].', ' : '').
|
||||
' '.$hotel['country_name'];
|
||||
$roomBookingSelectedType = Product::getRoomTypeBookingMethod($idProduct);
|
||||
|
||||
$orderDateRestrict = false;
|
||||
$maxOrderDate = HotelOrderRestrictDate::getMaxOrderDate($idHotel);
|
||||
@@ -676,7 +681,7 @@ class ProductControllerCore extends FrontController
|
||||
'id_cart' => $idCart,
|
||||
'id_guest' => $idGuest,
|
||||
);
|
||||
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
if ($roomBookingSelectedType == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
$bookingParams['occupancy'] = $occupancy;
|
||||
$quantity = count($occupancy);
|
||||
} else {
|
||||
@@ -1416,10 +1421,14 @@ class ProductControllerCore extends FrontController
|
||||
$dateFrom = Tools::getValue('room_check_in');
|
||||
$dateTo = Tools::getValue('room_check_out');
|
||||
$occupancy = Tools::getValue('occupancy');
|
||||
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
if (!Validate::isOccupancy($occupancy)) {
|
||||
$occupancy = array();
|
||||
}
|
||||
$roomBookingSelectedType = Product::getRoomTypeBookingMethod($idProduct);
|
||||
$isOccupancyType = $roomBookingSelectedType == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY;
|
||||
// $this->context->smarty->assign(
|
||||
// 'occupancy_required_for_booking',
|
||||
// $isOccupancyType
|
||||
// );
|
||||
if ($isOccupancyType) {
|
||||
$occupancy = Validate::isOccupancy($occupancy) ? $occupancy : array();
|
||||
} else {
|
||||
$occupancy = Tools::getValue('qty', 1);
|
||||
}
|
||||
|
||||
@@ -1570,6 +1570,8 @@ CREATE TABLE `PREFIX_product` (
|
||||
`cache_has_attachments` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`is_virtual` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`booking_product` tinyint(1) NOT NULL DEFAULT '1',
|
||||
`id_room_type_selling_object_type` int(10) unsigned DEFAULT NULL,
|
||||
`booking_method` int(10) NOT NULL DEFAULT '0',
|
||||
`cache_default_attribute` int(10) unsigned DEFAULT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
|
||||
@@ -30,22 +30,20 @@ $(document).ready(function() {
|
||||
{
|
||||
if ($('#PS_FRONT_SEARCH_TYPE').val() == SEARCH_TYPE_OWS) {
|
||||
$('#PS_FRONT_OWS_SEARCH_ALGO_TYPE').closest('.form-group').show('fast');
|
||||
$('#PS_FRONT_ROOM_UNIT_SELECTION_TYPE').closest('.form-group').hide('fast');
|
||||
} else {
|
||||
$('#PS_FRONT_OWS_SEARCH_ALGO_TYPE').closest('.form-group').hide('fast');
|
||||
$('#PS_FRONT_ROOM_UNIT_SELECTION_TYPE').closest('.form-group').show('fast');
|
||||
}
|
||||
$('#PS_FRONT_ROOM_UNIT_SELECTION_TYPE').closest('.form-group').show('fast');
|
||||
}
|
||||
|
||||
function setBackOccupancyView()
|
||||
{
|
||||
if ($('#PS_BACKOFFICE_SEARCH_TYPE').val() == SEARCH_TYPE_OWS) {
|
||||
$('#PS_BACKOFFICE_OWS_SEARCH_ALGO_TYPE').closest('.form-group').show('fast');
|
||||
$('#PS_BACKOFFICE_ROOM_BOOKING_TYPE').closest('.form-group').hide('fast');
|
||||
} else {
|
||||
$('#PS_BACKOFFICE_OWS_SEARCH_ALGO_TYPE').closest('.form-group').hide('fast');
|
||||
$('#PS_BACKOFFICE_ROOM_BOOKING_TYPE').closest('.form-group').show('fast');
|
||||
}
|
||||
$('#PS_BACKOFFICE_ROOM_BOOKING_TYPE').closest('.form-group').show('fast');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -378,6 +378,9 @@ 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');
|
||||
@@ -398,7 +401,7 @@ var ajaxCart = {
|
||||
if (typeof dateTo != 'undefined')
|
||||
req.append('dateTo', dateTo);
|
||||
|
||||
if (occupancy_required_for_booking) {
|
||||
if (isOccupancyBooking) {
|
||||
req.append('occupancy', JSON.stringify(occupancy));
|
||||
} else {
|
||||
req.append('qty', ((occupancy && occupancy != null) ? occupancy : '1'));
|
||||
@@ -1203,10 +1206,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;
|
||||
if (occupancy_required_for_booking) {
|
||||
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 (isOccupancyBooking) {
|
||||
$.each(product.occupancy, function(index, val) {
|
||||
rooms++;
|
||||
adults += parseInt(val.adults);
|
||||
@@ -1454,7 +1469,8 @@ function getBookingOccupancyDetails(bookingform, booking_product)
|
||||
{
|
||||
let occupancy;
|
||||
if (booking_product) {
|
||||
if (occupancy_required_for_booking) {
|
||||
var isOccupancyBooking = getOccupancyRequiredForBooking(bookingform);
|
||||
if (isOccupancyBooking) {
|
||||
$('.booking_guest_occupancy_conatiner .dropdown').removeClass('open');
|
||||
let selected_occupancy = $(bookingform).find(".occupancy_info_block.selected")
|
||||
if (selected_occupancy.length) {
|
||||
@@ -1496,3 +1512,30 @@ 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;
|
||||
}
|
||||
|
||||
@@ -265,6 +265,7 @@ class Blockcart extends Module
|
||||
}
|
||||
|
||||
$objCartBookingData = new HotelCartBookingData();
|
||||
$objRoomType = new HotelRoomType();
|
||||
$totalDemandsPrice = $objCartBookingData->getCartExtraDemands(
|
||||
$this->context->cart->id,
|
||||
0,
|
||||
@@ -304,6 +305,11 @@ 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';
|
||||
}
|
||||
if ($objProduct->booking_product) {
|
||||
$price = $addedProduct['price'] = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
|
||||
$objProduct->id,
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
<span class="cross" title="{l s='Close window' mod='blockcart'}"></span>
|
||||
{block name='blockcart_layer_cart_left_heading'}
|
||||
<h2 class="layer_cart_room_txt">
|
||||
<i class="icon-check"></i>{l s='Room successfully added to your cart' mod='blockcart'}
|
||||
<i class="icon-check"></i><span class="layer_cart_room_success_msg" data-room-msg-template="{l s='%s successfully added to your cart' mod='blockcart' sprintf=['__ROOM__']}">{l s='Room successfully added to your cart' mod='blockcart'}</span>
|
||||
</h2>
|
||||
<h2 class="layer_cart_product_txt">
|
||||
<i class="icon-check"></i>{l s='Product successfully added to your cart' mod='blockcart'}
|
||||
@@ -223,12 +223,14 @@
|
||||
<span id="layer_cart_product_unit_price"></span>
|
||||
</div>
|
||||
<div>
|
||||
<strong class="dark layer_cart_room_txt">{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} - </strong>
|
||||
<strong class="dark layer_cart_room_txt" data-label-occupancy="{l s='%s occupancy' mod='blockcart' sprintf=['__ROOM__']}" data-label-quantity="{l s='%s quantity added' mod='blockcart' sprintf=['__ROOMS__']}">
|
||||
<span class="layer_cart_attribute_type" data-room-msg-template="{if isset($occupancy_required_for_booking) && $occupancy_required_for_booking}{l s='%s occupancy' mod='blockcart' sprintf=['__ROOM__']}{else}{l s='%s quantity added' mod='blockcart' sprintf=['__ROOMS__']}{/if}">{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}</span> -
|
||||
</strong>
|
||||
<strong class="dark layer_cart_product_txt">{l s='Quantity' mod='blockcart'} - </strong>
|
||||
<span id="layer_cart_product_quantity"></span>
|
||||
</div>
|
||||
<div>
|
||||
<strong class="dark layer_cart_room_txt">{l s='Room type cost' mod='blockcart'} - </strong>
|
||||
<strong class="dark layer_cart_room_txt"><span class="layer_cart_room_type_cost_label">{l s='Room type cost' mod='blockcart'}</span> - </strong>
|
||||
<strong class="dark layer_cart_product_txt">{l s='Total' mod='blockcart'} - </strong>
|
||||
<span id="layer_cart_product_price"></span>
|
||||
</div>
|
||||
@@ -255,7 +257,7 @@
|
||||
{block name='blockcart_layer_cart_room_total_price'}
|
||||
<div class="layer_cart_row">
|
||||
<strong class="dark">
|
||||
{l s='Total Rooms Cost in cart' mod='blockcart'}
|
||||
{l s='Total Stay Cost in cart' mod='blockcart'}
|
||||
{if $display_tax_label}
|
||||
{if $priceDisplay == 1}
|
||||
{l s='(tax excl.)' mod='blockcart'}
|
||||
|
||||
@@ -87,6 +87,7 @@ class HotelBookingDetail extends ObjectModel
|
||||
const SEARCH_TYPE_NORMAL = 2;
|
||||
|
||||
//
|
||||
const PS_ROOM_UNIT_SELECTION_TYPE_DEFAULT = 0;
|
||||
const PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY = 1;
|
||||
const PS_ROOM_UNIT_SELECTION_TYPE_QUANTITY = 2;
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ class HotelBranchInformation extends ObjectModel
|
||||
public $id_category;
|
||||
public $hotel_name;
|
||||
public $email;
|
||||
public $id_property_type;
|
||||
public $check_in;
|
||||
public $check_out;
|
||||
public $description;
|
||||
@@ -51,6 +52,7 @@ class HotelBranchInformation extends ObjectModel
|
||||
'fields' => array(
|
||||
'id_category' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'email' => array('type' => self::TYPE_STRING,'validate' => 'isEmail', 'size' => 255, 'required' => true),
|
||||
'id_property_type' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'rating' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
|
||||
'check_in' => array('type' => self::TYPE_STRING, 'required' => true),
|
||||
'check_out' => array('type' => self::TYPE_STRING, 'required' => true),
|
||||
@@ -577,6 +579,36 @@ 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]
|
||||
|
||||
@@ -459,11 +459,7 @@ class HotelCartBookingData extends ObjectModel
|
||||
$chkQty = 0;
|
||||
$num_days = HotelHelper::getNumberOfDays($date_from, $date_to);
|
||||
$objServiceProductCartDetail = new ServiceProductCartDetail();
|
||||
if (defined('_PS_ADMIN_DIR_')) {
|
||||
$PS_ROOM_UNIT_SELECTION_TYPE = Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE');
|
||||
} else {
|
||||
$PS_ROOM_UNIT_SELECTION_TYPE = Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE');
|
||||
}
|
||||
$PS_ROOM_UNIT_SELECTION_TYPE = Product::getRoomTypeBookingMethod($id_product);
|
||||
if ($PS_ROOM_UNIT_SELECTION_TYPE == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
$roomsRequired = count($occupancy);
|
||||
} else {
|
||||
@@ -594,11 +590,7 @@ class HotelCartBookingData extends ObjectModel
|
||||
'id_cart' => $id_cart,
|
||||
'id_guest' => $id_guest,
|
||||
);
|
||||
if (defined('_PS_ADMIN_DIR_')) {
|
||||
$PS_ROOM_UNIT_SELECTION_TYPE = Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE');
|
||||
} else {
|
||||
$PS_ROOM_UNIT_SELECTION_TYPE = Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE');
|
||||
}
|
||||
$PS_ROOM_UNIT_SELECTION_TYPE = Product::getRoomTypeBookingMethod($id_product);
|
||||
if ($PS_ROOM_UNIT_SELECTION_TYPE == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
$roomsRequired = count($occupancy);
|
||||
} else {
|
||||
@@ -1178,6 +1170,8 @@ class HotelCartBookingData extends ObjectModel
|
||||
$cart_detail_data[$key]['room_num'] = $obj_htl_room_info->room_num;
|
||||
$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);
|
||||
|
||||
$cart_detail_data[$key]['child_ages'] = json_decode($value['child_ages']);
|
||||
$occupancy = array(
|
||||
@@ -1563,6 +1557,7 @@ 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]['unit_price'] = $unitPrice;
|
||||
$cartHotelData[$prodKey]['unit_price_without_reduction'] = $unitPriceWithoutReduction;
|
||||
$cartHotelData[$prodKey]['total_room_type_amount'] = 0;
|
||||
|
||||
@@ -1368,6 +1368,45 @@ class HotelHelper
|
||||
return true;
|
||||
}
|
||||
|
||||
public function createHotelDefaultRoomTypeSellingTypes()
|
||||
{
|
||||
$propertyTypes = array(
|
||||
'Hotel',
|
||||
'Motel',
|
||||
);
|
||||
|
||||
$sellingTypes = array(
|
||||
'Room',
|
||||
'Apartment',
|
||||
'Villa',
|
||||
'Cottage',
|
||||
'Bungalow',
|
||||
);
|
||||
|
||||
$languages = Language::getLanguages(true);
|
||||
foreach ($propertyTypes as $typeName) {
|
||||
$objType = new HotelRoomTypeSellingType();
|
||||
$objType->type = HotelRoomTypeSellingType::HOTEL_PROPERTY_TYPE;
|
||||
$objType->active = 1;
|
||||
foreach ($languages as $lang) {
|
||||
$objType->name[$lang['id_lang']] = $typeName;
|
||||
}
|
||||
$objType->save();
|
||||
}
|
||||
|
||||
foreach ($sellingTypes as $typeName) {
|
||||
$objType = new HotelRoomTypeSellingType();
|
||||
$objType->type = HotelRoomTypeSellingType::ROOM_TYPE_OBJECT_SELLING_TYPE;
|
||||
$objType->active = 1;
|
||||
foreach ($languages as $lang) {
|
||||
$objType->name[$lang['id_lang']] = $typeName;
|
||||
}
|
||||
$objType->save();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function getPsProducts($id_lang, $start = 0, $limit = 0, $booking_product = null)
|
||||
{
|
||||
$sql = 'SELECT p.`id_product`, pl.`name`, p.`booking_product`
|
||||
@@ -1386,6 +1425,7 @@ class HotelHelper
|
||||
{
|
||||
$obj_hotel_info = new HotelBranchInformation();
|
||||
$obj_hotel_info->active = 1;
|
||||
$obj_hotel_info->id_property_type = 1;
|
||||
$obj_hotel_info->email = 'hotelprime@htl.com';
|
||||
$obj_hotel_info->check_in = '12:00';
|
||||
$obj_hotel_info->check_out = '11:00';
|
||||
@@ -1989,6 +2029,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->save();
|
||||
$product_id = $product->id;
|
||||
|
||||
|
||||
@@ -59,6 +59,7 @@ class HotelReservationSystemDb
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`id_category` int(10) unsigned NOT NULL,
|
||||
`email` varchar(128) NOT NULL,
|
||||
`id_property_type` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`check_in` varchar(255) DEFAULT NULL,
|
||||
`check_out` varchar(255) DEFAULT NULL,
|
||||
`rating` int(2) unsigned NOT NULL,
|
||||
@@ -117,6 +118,22 @@ 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,
|
||||
`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`)
|
||||
) 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,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id_htl_room_type_selling_type`, `id_lang`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_cart_booking_data` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_cart` int(11) NOT NULL,
|
||||
@@ -613,6 +630,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_access`,
|
||||
`'._DB_PREFIX_.'htl_settings_link`,
|
||||
`'._DB_PREFIX_.'htl_settings_link_lang`'
|
||||
|
||||
@@ -234,10 +234,15 @@ class HotelRoomType extends ObjectModel
|
||||
if (!$idLang) {
|
||||
$idLang = Context::getContext()->language->id;
|
||||
}
|
||||
$sql = 'SELECT hrt.*, hbl.`hotel_name`
|
||||
$sql = 'SELECT hrt.*, hbl.`hotel_name`, hrtstl.`name` AS `room_type_selling_type_name`
|
||||
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.')
|
||||
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.')
|
||||
WHERE hrt.`id_product` = '.(int)$id_product;
|
||||
|
||||
return Db::getInstance()->getRow($sql);
|
||||
@@ -298,12 +303,16 @@ 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`
|
||||
$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`
|
||||
'.($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`
|
||||
AND hrtstl.`id_lang` = '.(int)$idLang.')';
|
||||
|
||||
if ($position) {
|
||||
$sql .= ' INNER JOIN `'._DB_PREFIX_.'htl_branch_info` hbi ON (hbi.`id` = hrt.`id_hotel`)
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
class HotelRoomTypeSellingType extends ObjectModel
|
||||
{
|
||||
const HOTEL_PROPERTY_TYPE = 1;
|
||||
const ROOM_TYPE_OBJECT_SELLING_TYPE = 2;
|
||||
|
||||
public $type;
|
||||
public $active;
|
||||
public $date_add;
|
||||
public $date_upd;
|
||||
public $name;
|
||||
|
||||
public static $definition = array(
|
||||
'table' => '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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -222,6 +222,13 @@ 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);
|
||||
$smartyVars['hotel_property_types_info'] = $hotelPropertyTypes;
|
||||
$selectedHotelPropertyType = Tools::getValue('id_property_type');
|
||||
if (!$selectedHotelPropertyType && isset($hotelBranchInfo)) {
|
||||
$selectedHotelPropertyType = $hotelBranchInfo->id_property_type;
|
||||
}
|
||||
$smartyVars['selected_hotel_property_type'] = (int) $selectedHotelPropertyType;
|
||||
|
||||
$this->context->smarty->assign($smartyVars);
|
||||
|
||||
@@ -259,6 +266,7 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
$active = Tools::getValue('ENABLE_HOTEL');
|
||||
$fax = Tools::getValue('fax');
|
||||
$activeRefund = Tools::getValue('active_refund');
|
||||
$idHotelPropertyType = Tools::getValue('id_property_type');
|
||||
$enableUseGlobalMaxCheckoutOffset = Tools::getValue('enable_use_global_max_checkout_offset');
|
||||
$maxCheckoutOffset = trim(Tools::getValue('max_checkout_offset'));
|
||||
$enableUseGlobalMinBookingOffset = Tools::getValue('enable_use_global_min_booking_offset');
|
||||
@@ -288,6 +296,10 @@ 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)) {
|
||||
@@ -503,6 +515,7 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
$objHotelBranch->active = $active;
|
||||
$objHotelBranch->active_refund = $activeRefund;
|
||||
$objHotelBranch->fax = $fax;
|
||||
$objHotelBranch->id_property_type = $idHotelPropertyType;
|
||||
|
||||
// lang fields
|
||||
$hotelCatName = array();
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
<?php
|
||||
/**
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License version 3.0
|
||||
* that is bundled with this package in the file LICENSE.md
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/license/osl-3-0-php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to support@qloapps.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade this module to a newer
|
||||
* versions in the future. If you wish to customize this module for your needs
|
||||
* please refer to https://store.webkul.com/customisation-guidelines for more information.
|
||||
*
|
||||
* @author Webkul IN
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*/
|
||||
|
||||
class AdminHotelRoomTypeSellingTypesController extends ModuleAdminController
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->bootstrap = true;
|
||||
$this->table = 'htl_room_type_selling_type';
|
||||
$this->className = 'HotelRoomTypeSellingType';
|
||||
$this->identifier = 'id_htl_room_type_selling_type';
|
||||
$this->lang = true;
|
||||
$this->context = Context::getContext();
|
||||
$this->toolbar_title = $this->l('Property & Room Types');
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->propertyTypes = array(
|
||||
HotelRoomTypeSellingType::HOTEL_PROPERTY_TYPE => $this->l('Property type'),
|
||||
HotelRoomTypeSellingType::ROOM_TYPE_OBJECT_SELLING_TYPE => $this->l('Room selling type'),
|
||||
);
|
||||
|
||||
$this->fields_list = array(
|
||||
'id_htl_room_type_selling_type' => array(
|
||||
'title' => $this->l('ID'),
|
||||
'align' => 'center',
|
||||
'class' => 'fixed-width-xs',
|
||||
),
|
||||
'name' => array(
|
||||
'title' => $this->l('Name'),
|
||||
'align' => 'left',
|
||||
),
|
||||
'type' => array(
|
||||
'title' => $this->l('Type'),
|
||||
'align' => 'center',
|
||||
'type' => 'select',
|
||||
'list' => $this->propertyTypes,
|
||||
'filter_key' => 'a!type',
|
||||
'callback' => 'getSellingTypeLabel',
|
||||
),
|
||||
'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_type'] = array(
|
||||
'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token,
|
||||
'desc' => $this->l('Add new', null, null, false),
|
||||
'icon' => 'process-icon-new'
|
||||
);
|
||||
}
|
||||
|
||||
parent::initPageHeaderToolbar();
|
||||
}
|
||||
|
||||
public function initToolbar()
|
||||
{
|
||||
$this->toolbar_btn = array();
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
if (!$this->loadObject(true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$typeSelect = array();
|
||||
foreach ($this->propertyTypes as $id => $name) {
|
||||
$typeSelect[] = array('id' => $id, 'name' => $name);
|
||||
}
|
||||
|
||||
$this->fields_form = array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Type'),
|
||||
'icon' => 'icon-tags',
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Name'),
|
||||
'name' => 'name',
|
||||
'lang' => true,
|
||||
'required' => true,
|
||||
'hint' => $this->l('Displayed name for this type.'),
|
||||
),
|
||||
array(
|
||||
'type' => 'select',
|
||||
'label' => $this->l('Type'),
|
||||
'name' => 'type',
|
||||
'required' => true,
|
||||
'options' => array(
|
||||
'query' => $typeSelect,
|
||||
'id' => 'id',
|
||||
'name' => 'name',
|
||||
),
|
||||
),
|
||||
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();
|
||||
}
|
||||
|
||||
public function getSellingTypeLabel($value, $row)
|
||||
{
|
||||
return isset($this->propertyTypes[$value]) ? $this->propertyTypes[$value] : $value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -368,11 +368,16 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
);
|
||||
|
||||
$allotmentTypes = HotelBookingDetail::getAllAllotmentTypes();
|
||||
$occupancyRequiredForBooking = false;
|
||||
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
$occupancyRequiredForBooking = true;
|
||||
}
|
||||
|
||||
foreach ($booking_data['rm_data'] as $roomKey => $roomData) {
|
||||
if (!isset($roomData['id_product'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$booking_data['rm_data'][$roomKey]['occupancy_required_for_booking'] =
|
||||
(int) (Product::getRoomTypeBookingMethod($roomData['id_product']) == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY);
|
||||
}
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'adults' => $adults,
|
||||
'children' => $children,
|
||||
@@ -382,7 +387,6 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
'occupancy' => $this->occupancy,
|
||||
'date_from' => $this->date_from,
|
||||
'date_to' => $this->date_to,
|
||||
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
|
||||
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
|
||||
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
|
||||
'link' => $this->context->link,
|
||||
@@ -684,7 +688,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
$date_from = Tools::getValue('date_from');
|
||||
$date_to = Tools::getValue('date_to');
|
||||
$occupancy = Tools::getValue('occupancy');
|
||||
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
if (Product::getRoomTypeBookingMethod($id_product) == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
if (!Validate::isOccupancy($occupancy)) {
|
||||
$occupancy = array();
|
||||
}
|
||||
@@ -959,10 +963,6 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
{
|
||||
parent::setMedia();
|
||||
$currency = new Currency((int)Configuration::get('PS_CURRENCY_DEFAULT'));
|
||||
$occupancyRequiredForBooking = false;
|
||||
if (Configuration::get('PS_BACKOFFICE_ROOM_BOOKING_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_OCCUPANCY) {
|
||||
$occupancyRequiredForBooking = true;
|
||||
}
|
||||
if ($this->context->employee->isSuperAdmin()) {
|
||||
$backOrderConfigKey = 'PS_BACKDATE_ORDER_SUPERADMIN';
|
||||
} else {
|
||||
@@ -982,7 +982,6 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
|
||||
'SELLING_PREFERENCE_STANDALONE' => Product::SELLING_PREFERENCE_STANDALONE,
|
||||
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
|
||||
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
|
||||
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
|
||||
'rooms_reallocation_url' => $this->context->link->getAdminLink('AdminHotelRoomsBooking'),
|
||||
'rooms_booking_url' => $this->context->link->getAdminLink('AdminHotelRoomsBooking'),
|
||||
'opt_select_all' => $this->l('All Types', null, true),
|
||||
|
||||
@@ -241,7 +241,7 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
|
||||
'callback' => 'getUniqueRoomTypeNames'
|
||||
),
|
||||
'hotel_name' => array(
|
||||
'title' => $this->l('Hotel')
|
||||
'title' => $this->l('Property Name')
|
||||
),
|
||||
'date_from' => array(
|
||||
'title' => $this->l('Date From')
|
||||
|
||||
@@ -49,6 +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';
|
||||
|
||||
// linked products
|
||||
require_once 'classes/RoomTypeServiceProduct.php';
|
||||
|
||||
@@ -555,6 +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('AdminOrderRefundRules', 'Manage Order Refund Rules', 'AdminHotelReservationSystemManagement');
|
||||
$this->installTab('AdminOrderRefundRequests', 'Manage Order Refund Requests', 'AdminHotelReservationSystemManagement');
|
||||
|
||||
@@ -610,6 +611,7 @@ class HotelReservationSystem extends Module
|
||||
|| !$objHtlHelper->insertDefaultHotelEntries()
|
||||
|| !$objHtlHelper->createHotelRoomDefaultFeatures()
|
||||
|| !$objHtlHelper->createHotelDefaultBedTypes()
|
||||
|| !$objHtlHelper->createHotelDefaultRoomTypeSellingTypes()
|
||||
|| !$objHtlHelper->insertHotelCommonFeatures()
|
||||
) {
|
||||
return false;
|
||||
|
||||
@@ -296,15 +296,23 @@ $(document).ready(function() {
|
||||
|
||||
function getBookingOccupancyDetails(bookingform)
|
||||
{
|
||||
let occupancy;
|
||||
if (occupancy_required_for_booking) {
|
||||
if (!bookingform || !bookingform.length) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
var isOccupancy = $(bookingform).data('occupancy-required');
|
||||
if (typeof isOccupancy === 'undefined') {
|
||||
isOccupancy = (typeof occupancy_required_for_booking !== 'undefined') ? occupancy_required_for_booking : false;
|
||||
}
|
||||
var occupancy;
|
||||
if (isOccupancy) {
|
||||
$('.booking_occupancy_wrapper').parent().removeClass('open');
|
||||
let selected_occupancy = $(bookingform).find(".occupancy_info_block.selected")
|
||||
var selected_occupancy = $(bookingform).find(".occupancy_info_block.selected");
|
||||
if (selected_occupancy.length) {
|
||||
occupancy = [];
|
||||
$(selected_occupancy).each(function(ind, element) {
|
||||
if (parseInt($(element).find('.num_adults').val())) {
|
||||
let child_ages = [];
|
||||
var child_ages = [];
|
||||
$(element).find('.guest_child_age').each(function(index) {
|
||||
if ($(this).val() > -1) {
|
||||
child_ages.push($(this).val());
|
||||
@@ -796,7 +804,8 @@ $(document).ready(function() {
|
||||
var adults = 0;
|
||||
var children = 0;
|
||||
var rooms = $(booking_occupancy_wrapper).find('.occupancy_info_block').length;
|
||||
|
||||
var roomLabel = $(booking_occupancy_wrapper).data('attribute_type') || room_txt;
|
||||
var roomsLabel = $(booking_occupancy_wrapper).data('attribute_types') || rooms_txt;
|
||||
$(booking_occupancy_wrapper).find(".num_adults" ).each(function(key, val) {
|
||||
adults += parseInt($(this).val());
|
||||
});
|
||||
@@ -818,9 +827,9 @@ $(document).ready(function() {
|
||||
}
|
||||
}
|
||||
if (parseInt(rooms) > 1) {
|
||||
guestButtonVal += ', ' + parseInt(rooms) + ' ' + rooms_txt;
|
||||
guestButtonVal += ', ' + parseInt(rooms) + ' ' + roomsLabel;
|
||||
} else {
|
||||
guestButtonVal += ', ' + parseInt(rooms) + ' ' + room_txt;
|
||||
guestButtonVal += ', ' + parseInt(rooms) + ' ' + roomLabel;
|
||||
}
|
||||
$(booking_occupancy_wrapper).siblings('.booking_guest_occupancy').find('span').text(guestButtonVal);
|
||||
}
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
{if isset($edit)}
|
||||
<i class='icon-pencil'></i> {l s='Edit Hotel' mod='hotelreservationsystem'}
|
||||
<i class='icon-pencil'></i> {l s='Edit Property' mod='hotelreservationsystem'}
|
||||
{else}
|
||||
<i class='icon-plus'></i> {l s='Add New Hotel' mod='hotelreservationsystem'}
|
||||
<i class='icon-plus'></i> {l s='Add New Property' mod='hotelreservationsystem'}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-3">
|
||||
<span>
|
||||
{l s='Enable Hotel' mod='hotelreservationsystem'}
|
||||
{l s='Enable' mod='hotelreservationsystem'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-lg-9 ">
|
||||
@@ -123,9 +123,26 @@
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-sm-3 required" for="id_property_type">
|
||||
<span>
|
||||
{l s='Property Type :' mod='hotelreservationsystem'}
|
||||
</span>
|
||||
</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="id_property_type" id="id_property_type" class="form-control chosen">
|
||||
{foreach from=$hotel_property_types_info item=property_type}
|
||||
<option value="{$property_type.id_property_type|escape:'htmlall':'UTF-8'}"
|
||||
{if isset($selected_hotel_property_type) && $selected_hotel_property_type == $property_type.id_property_type}selected{/if}>
|
||||
{$property_type.name|escape:'htmlall':'UTF-8'}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label required" for="hotel_name" >
|
||||
{l s='Hotel Name :' mod='hotelreservationsystem'}
|
||||
{l s='Name :' mod='hotelreservationsystem'}
|
||||
{include file="../../../_partials/htl-form-fields-flag.tpl"}
|
||||
</label>
|
||||
<div class="col-lg-6">
|
||||
@@ -282,7 +299,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">
|
||||
{l s='Hotel Policies :' mod='hotelreservationsystem'}
|
||||
{l s='Policies :' mod='hotelreservationsystem'}
|
||||
{include file="../../../_partials/htl-form-fields-flag.tpl"}
|
||||
</label>
|
||||
<div class="col-lg-6">
|
||||
@@ -417,7 +434,7 @@
|
||||
</div>
|
||||
<hr>
|
||||
{* Image table *}
|
||||
<h4><i class="icon-image"></i> <span>{l s='Hotel Images' mod='hotelreservationsystem'}</span></h4>
|
||||
<h4><i class="icon-image"></i> <span>{l s='Property Images' mod='hotelreservationsystem'}</span></h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
{include file="../../_partials/htl-images-list.tpl"}
|
||||
@@ -425,7 +442,7 @@
|
||||
</div>
|
||||
{else}
|
||||
<div class="alert alert-warning">
|
||||
{l s='Please save hotel information before saving hotel images.' mod='hotelreservationsystem'}
|
||||
{l s='Please save property information before saving property images.' mod='hotelreservationsystem'}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -482,7 +499,7 @@
|
||||
</div>
|
||||
{else}
|
||||
<div class="alert alert-warning">
|
||||
{l s='Please save the hotel information before saving the hotel booking restrictions.' mod='hotelreservationsystem'}
|
||||
{l s='Please save the property information before saving the property booking restrictions.' mod='hotelreservationsystem'}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -572,7 +589,7 @@
|
||||
</div>
|
||||
{else}
|
||||
<div class="alert alert-warning">
|
||||
{l s='Please save hotel information before saving refund policy options.' mod='hotelreservationsystem'}
|
||||
{l s='Please save property information before saving refund policy options.' mod='hotelreservationsystem'}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -595,7 +612,7 @@
|
||||
</div>
|
||||
{else}
|
||||
<div class="alert alert-warning">
|
||||
{l s='Please save hotel information before assigning hotel features.' mod='hotelreservationsystem'}
|
||||
{l s='Please save property information before assigning property features.' mod='hotelreservationsystem'}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#avail_room_data_{$book_k|escape:'htmlall':'UTF-8'}" data-toggle="tab">{l s='Available Rooms' mod='hotelreservationsystem'}</a></li>
|
||||
<li class="active"><a href="#avail_room_data_{$book_k|escape:'htmlall':'UTF-8'}" data-toggle="tab">{l s='Available %s' sprintf=$book_v['room_type_selling_type_name']|cat:'s' mod='hotelreservationsystem'}</a></li>
|
||||
<li><a href="#part_room_data_{$book_k|escape:'htmlall':'UTF-8'}" data-toggle="tab">{l s='Partially Available' mod='hotelreservationsystem'}</a></li>
|
||||
<li><a href="#book_room_data_{$book_k|escape:'htmlall':'UTF-8'}" data-toggle="tab">{l s='Booked Rooms' mod='hotelreservationsystem'}</a></li>
|
||||
<li><a href="#unavail_room_data_{$book_k|escape:'htmlall':'UTF-8'}" data-toggle="tab">{l s='Unavailable Rooms' mod='hotelreservationsystem'}</a></li>
|
||||
<li><a href="#book_room_data_{$book_k|escape:'htmlall':'UTF-8'}" data-toggle="tab">{l s='Booked %s' sprintf=$book_v['room_type_selling_type_name']|cat:'s' mod='hotelreservationsystem'}</a></li>
|
||||
<li><a href="#unavail_room_data_{$book_k|escape:'htmlall':'UTF-8'}" data-toggle="tab">{l s='Unavailable %s' sprintf=$book_v['room_type_selling_type_name']|cat:'s' mod='hotelreservationsystem'}</a></li>
|
||||
</ul>
|
||||
<div class="tab-content panel">
|
||||
<div id="avail_room_data_{$book_k|escape:'htmlall':'UTF-8'}" class="tab-pane active">
|
||||
@@ -27,11 +27,11 @@
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><span class="title_box">{l s='Room No.' mod='hotelreservationsystem'}</span></th>
|
||||
<th><span class="title_box">{l s='%s No.' sprintf=$book_v['room_type_selling_type_name'] mod='hotelreservationsystem'}</span></th>
|
||||
<th><span class="title_box">{l s='Duration' mod='hotelreservationsystem'}</span></th>
|
||||
<th><span class="title_box">{l s='Message' mod='hotelreservationsystem'}</span></th>
|
||||
<th><span class="title_box">{l s='Allotment Type' mod='hotelreservationsystem'}</span></th>
|
||||
{if $occupancy_required_for_booking}
|
||||
{if $book_v.occupancy_required_for_booking}
|
||||
<th class="fixed-width-xxl"><span class="title_box">{l s='Guests' mod='hotelreservationsystem'}</span></th>
|
||||
{/if}
|
||||
<th><span class="title_box">{l s='Action' mod='hotelreservationsystem'}</span></th>
|
||||
@@ -53,19 +53,19 @@
|
||||
{/foreach}
|
||||
<input type="text" id="comment_{$avai_v['id_room']|escape:'htmlall':'UTF-8'}" name="comment_{$avai_v['id_room']|escape:'htmlall':'UTF-8'}" class="form-control booking_type_comment" placeholder="{l s='Allotment message' mod='hotelreservationsystem'}">
|
||||
</td>
|
||||
{if $occupancy_required_for_booking}
|
||||
<td class="booking_occupancy">
|
||||
{if $book_v.occupancy_required_for_booking}
|
||||
<td class="booking_occupancy" data-occupancy-required="{$book_v.occupancy_required_for_booking|intval}">
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-default btn-left btn-block booking_guest_occupancy input-occupancy" type="button">
|
||||
<span>{l s='Select occupancy' mod='hotelreservationsystem'}</span>
|
||||
</button>
|
||||
<div class="dropdown-menu booking_occupancy_wrapper well well-sm">
|
||||
<div class="dropdown-menu booking_occupancy_wrapper well well-sm" data-attribute_types="{$book_v['room_type_selling_type_name']|cat:'s'}" data-attribute_type="{$book_v['room_type_selling_type_name']}">
|
||||
<input type="hidden" class="max_adults" value="{if isset($book_v)}{$book_v['max_adults']|escape:'html':'UTF-8'}{/if}">
|
||||
<input type="hidden" class="max_children" value="{if isset($book_v)}{$book_v['max_children']|escape:'html':'UTF-8'}{/if}">
|
||||
<input type="hidden" class="max_guests" value="{if isset($book_v)}{$book_v['max_guests']|escape:'html':'UTF-8'}{/if}">
|
||||
<div class="booking_occupancy_inner row">
|
||||
<div class="occupancy_info_block col-sm-12" occ_block_index="0">
|
||||
<div class="occupancy_info_head col-sm-12"><label class="room_num_wrapper">{l s='Room - 1' mod='hotelreservationsystem'}</label></div>
|
||||
<div class="occupancy_info_head col-sm-12"><label class="room_num_wrapper">{l s='%s - 1' sprintf=$book_v['room_type_selling_type_name'] mod='hotelreservationsystem'}</label></div>
|
||||
<div class="col-sm-12">
|
||||
<div class="row">
|
||||
<div class="form-group col-xs-6 occupancy_count_block">
|
||||
@@ -100,7 +100,7 @@
|
||||
</td>
|
||||
{/if}
|
||||
<td>
|
||||
<button type="button" data-id-cart="" data-id-cart-book-data="" data-id-product="{$avai_v['id_product']|escape:'htmlall':'UTF-8'}" data-id-room="{$avai_v['id_room']|escape:'htmlall':'UTF-8'}" data-id-hotel="{$avai_v['id_hotel']}" data-date-from="{$date_from|escape:'htmlall':'UTF-8'}" data-date-to ="{$date_to|escape:'htmlall':'UTF-8'}" class="btn btn-primary avai_add_cart">{l s='Add To Cart' mod='hotelreservationsystem'}</button>
|
||||
<button data-occupancy-required="{$book_v.occupancy_required_for_booking}" type="button" data-id-cart="" data-id-cart-book-data="" data-id-product="{$avai_v['id_product']|escape:'htmlall':'UTF-8'}" data-id-room="{$avai_v['id_room']|escape:'htmlall':'UTF-8'}" data-id-hotel="{$avai_v['id_hotel']}" data-date-from="{$date_from|escape:'htmlall':'UTF-8'}" data-date-to ="{$date_to|escape:'htmlall':'UTF-8'}" class="btn btn-primary avai_add_cart">{l s='Add To Cart' mod='hotelreservationsystem'}</button>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
@@ -114,9 +114,9 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><span class="title_box">{l s='Duration' mod='hotelreservationsystem'}</span></th>
|
||||
<th><span class="title_box">{l s='Room No.' mod='hotelreservationsystem'}</span></th>
|
||||
<th><span class="title_box">{l s='%s No.' sprintf=$book_v['room_type_selling_type_name'] mod='hotelreservationsystem'}</span></th>
|
||||
<th><span class="title_box">{l s='Allotment Type' mod='hotelreservationsystem'}</span></th>
|
||||
{if $occupancy_required_for_booking}
|
||||
{if $book_v.occupancy_required_for_booking}
|
||||
<th class="fixed-width-xxl"><span class="title_box">{l s='Guests' mod='hotelreservationsystem'}</span></th>
|
||||
{/if}
|
||||
<th><span class="title_box">{l s='Action' mod='hotelreservationsystem'}</span></th>
|
||||
@@ -142,13 +142,13 @@
|
||||
{/foreach}
|
||||
<input type="text" id="comment_{$sub_part_v['id_room']|escape:'htmlall':'UTF-8'}_{$sub_part_k|escape:'htmlall':'UTF-8'}" name="comment_{$sub_part_v['id_room']|escape:'htmlall':'UTF-8'}_{$sub_part_k|escape:'htmlall':'UTF-8'}" class="form-control booking_type_comment" placeholder="{l s='Allotment message' mod='hotelreservationsystem'}">
|
||||
</td>
|
||||
{if $occupancy_required_for_booking}
|
||||
<td class="booking_occupancy">
|
||||
{if $book_v.occupancy_required_for_booking}
|
||||
<td class="booking_occupancy" data-occupancy-required="{$book_v.occupancy_required_for_booking|intval}">
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-default btn-left btn-block booking_guest_occupancy input-occupancy" type="button">
|
||||
<span>{l s='Select occupancy' mod='hotelreservationsystem'}</span>
|
||||
</button>
|
||||
<div class="dropdown-menu booking_occupancy_wrapper well well-sm">
|
||||
<div class="dropdown-menu booking_occupancy_wrapper well well-sm" data-attribute_types="{$book_v['room_type_selling_type_name']|cat:'s'}" data-attribute_type="{$book_v['room_type_selling_type_name']}">
|
||||
<input type="hidden" class="max_adults" value="{if isset($book_v)}{$book_v['max_adults']|escape:'html':'UTF-8'}{/if}">
|
||||
<input type="hidden" class="max_children" value="{if isset($book_v)}{$book_v['max_children']|escape:'html':'UTF-8'}{/if}">
|
||||
<input type="hidden" class="max_guests" value="{if isset($book_v)}{$book_v['max_guests']|escape:'html':'UTF-8'}{/if}">
|
||||
@@ -189,7 +189,7 @@
|
||||
</td>
|
||||
{/if}
|
||||
<td>
|
||||
<button type="button" data-id-cart="" data-id-cart-book-data="" data-id-product="{$sub_part_v['id_product']|escape:'htmlall':'UTF-8'}" data-id-room="{$sub_part_v['id_room']|escape:'htmlall':'UTF-8'}" data-id-hotel="{$sub_part_v['id_hotel']|escape:'htmlall':'UTF-8'}" data-date-from="{$part_v['date_from']|escape:'htmlall':'UTF-8'}" data-date-to ="{$part_v['date_to']|escape:'htmlall':'UTF-8'}" data-sub-key="{$sub_part_k|escape:'htmlall':'UTF-8'}" class="btn btn-primary par_add_cart">{l s='Add To Cart' mod='hotelreservationsystem'}</button>
|
||||
<button data-occupancy-required="{$book_v.occupancy_required_for_booking}" type="button" data-id-cart="" data-id-cart-book-data="" data-id-product="{$sub_part_v['id_product']|escape:'htmlall':'UTF-8'}" data-id-room="{$sub_part_v['id_room']|escape:'htmlall':'UTF-8'}" data-id-hotel="{$sub_part_v['id_hotel']|escape:'htmlall':'UTF-8'}" data-date-from="{$part_v['date_from']|escape:'htmlall':'UTF-8'}" data-date-to ="{$part_v['date_to']|escape:'htmlall':'UTF-8'}" data-sub-key="{$sub_part_k|escape:'htmlall':'UTF-8'}" class="btn btn-primary par_add_cart">{l s='Add To Cart' mod='hotelreservationsystem'}</button>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
@@ -203,7 +203,7 @@
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><span class="title_box">{l s='Room No.' mod='hotelreservationsystem'}</span></th>
|
||||
<th><span class="title_box">{l s='%s No.' sprintf=$book_v['room_type_selling_type_name'] mod='hotelreservationsystem'}</span></th>
|
||||
<th><span class="title_box">{l s='Duration' mod='hotelreservationsystem'}</span></th>
|
||||
<th><span class="title_box">{l s='Order' mod='hotelreservationsystem'}</span></th>
|
||||
<th><span class="title_box">{l s='Message' mod='hotelreservationsystem'}</span></th>
|
||||
@@ -246,7 +246,7 @@
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><span class="title_box">{l s='Room No.' mod='hotelreservationsystem'}</span></th>
|
||||
<th><span class="title_box">{l s='%s No.' sprintf=$book_v['room_type_selling_type_name'] mod='hotelreservationsystem'}</span></th>
|
||||
<th><span class="title_box">{l s='Status' mod='hotelreservationsystem'}</span></th>
|
||||
<th><span class="title_box">{l s='Duration' mod='hotelreservationsystem'}</span></th>
|
||||
<th><span class="title_box">{l s='Message' mod='hotelreservationsystem'}</span></th>
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
{/if}
|
||||
<th>{l s='Room num' mod='hotelreservationsystem'}</th>
|
||||
<th>{l s='Room type' mod='hotelreservationsystem'}</th>
|
||||
<th>{l s='Hotel' mod='hotelreservationsystem'}</th>
|
||||
<th>{l s='Property' mod='hotelreservationsystem'}</th>
|
||||
<th>{l s='Duration' mod='hotelreservationsystem'}</th>
|
||||
<th>{l s='Total cost (tax incl.)' mod='hotelreservationsystem'}</th>
|
||||
<th>{l s='Total paid amount (tax incl.)' mod='hotelreservationsystem'}</th>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
{if isset($location_enabled) && $location_enabled}
|
||||
<div class="form-group grid-item area-4" style="grid-column: span 4;">
|
||||
<div class="dropdown">
|
||||
<input type="text" class="form-control header-rmsearch-input input-location" id="hotel_location" name="hotel_location" autocomplete="off" placeholder="{l s='Hotel Location' mod='wkroomsearchblock'}" {if isset($search_data['location'])}value="{$search_data['location']|escape:'htmlall':'UTF-8'}"{/if}>
|
||||
<input type="text" class="form-control header-rmsearch-input input-location" id="hotel_location" name="hotel_location" autocomplete="off" placeholder="{l s='Property Location' mod='wkroomsearchblock'}" {if isset($search_data['location'])}value="{$search_data['location']|escape:'htmlall':'UTF-8'}"{/if}>
|
||||
<input hidden="hidden" name="location_category_id" id="location_category_id" {if isset($search_data['location_category_id'])}value="{$search_data['location_category_id']|escape:'htmlall':'UTF-8'}"{/if}>
|
||||
<ul class="location_search_results_ul dropdown-menu"></ul>
|
||||
</div>
|
||||
@@ -50,7 +50,7 @@
|
||||
<input type="hidden" id="min_booking_offset" name="min_booking_offset" value="{if isset($min_booking_offset)}{$min_booking_offset|escape:'htmlall':'UTF-8'}{/if}">
|
||||
|
||||
<div class="hotel-selector-wrap {if isset($language_is_rtl) && $language_is_rtl}rtl{/if}">
|
||||
<select name="id_hotel" class="chosen header-rmsearch-input" data-placeholder="{l s='Select Hotel' mod='wkroomsearchblock'}" id="id_hotel_button">
|
||||
<select name="id_hotel" class="chosen header-rmsearch-input" data-placeholder="{l s='Select Property' mod='wkroomsearchblock'}" id="id_hotel_button">
|
||||
<option value=""></option>
|
||||
{foreach $hotels_info as $name_val}
|
||||
<option class="search_result_li" value="{$name_val['id']|escape:'htmlall':'UTF-8'}" data-id-hotel="{$name_val['id']|escape:'htmlall':'UTF-8'}" data-hotel-cat-id="{$name_val['id_category']|escape:'htmlall':'UTF-8'}" data-max_order_date="{$name_val['max_order_date']}" data-min_booking_offset="{$name_val['min_booking_offset']|escape:'htmlall':'UTF-8'}" {if isset($search_data) && $name_val['id'] == $search_data['htl_dtl']['id']}selected{/if}>{$name_val['hotel_name']|escape:'htmlall':'UTF-8'}</option>
|
||||
|
||||
@@ -19,9 +19,15 @@
|
||||
* @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}
|
||||
<div class="booking-form card">
|
||||
<div class="booking_room_fields">
|
||||
<div class="booking_room_fields" data-occupancy-required="{$occupancy_required_for_booking|intval}">
|
||||
{block name='booking_form_content'}
|
||||
<form id="booking-form" action="" method="post">
|
||||
{block name='product_hidden_fields'}
|
||||
@@ -36,7 +42,7 @@
|
||||
{block name='booking_form_hotel_location'}
|
||||
{if isset($id_hotel) && $id_hotel}
|
||||
<div class="form-group htl_location_block">
|
||||
<label for="" class="control-label">{l s='Hotel Location'}</label>
|
||||
<label for="" class="control-label">{l s='Property Location'}</label>
|
||||
<p>{$hotel_location|escape:'html':'UTF-8'}</p>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -66,7 +72,7 @@
|
||||
{include file="./occupancy_field.tpl"}
|
||||
{/block}
|
||||
{else}
|
||||
<label class="control-label">{l s='No. of Rooms'}</label>
|
||||
<label class="control-label">{l s='No. of %s' sprintf=$attribute_types}</label>
|
||||
{block name='quantity_field'}
|
||||
{include file="./quantity_field.tpl"}
|
||||
{/block}
|
||||
@@ -79,7 +85,7 @@
|
||||
<hr class="separator-hr-mg-10">
|
||||
<div class="row price_desc_block">
|
||||
<div class="col-sm-6">
|
||||
<label class="control-label">{l s='Room Price'}</label>
|
||||
<label class="control-label">{l s='%s Price' sprintf=$attribute_type}</label>
|
||||
<p>
|
||||
<span class="total_price_block">{convertPrice price=$rooms_price|floatval}</span>
|
||||
<span class="pull-right plus-sign">+</span>
|
||||
@@ -100,7 +106,7 @@
|
||||
<div class="services-info-tooltip-cont">
|
||||
{if isset($selected_service_product) && $selected_service_product}
|
||||
<div class="extra-service-panel">
|
||||
<p class="panel_title">{l s='Selected services'} <span>{l s='(Per room)'}</span></p>
|
||||
<p class="panel_title">{l s='Selected services'} <span>{l s='(Per %s)' sprintf=$attribute_type}</span></p>
|
||||
<div class="services-list">
|
||||
{foreach $selected_service_product as $product}
|
||||
<div class="services-list-row">
|
||||
@@ -143,7 +149,7 @@
|
||||
<hr>
|
||||
<div class="extra-service-panel">
|
||||
<div class="summary-row">
|
||||
<div>{l s='Total price per room'}</div>
|
||||
<div>{l s='Total price per %s' sprintf=$attribute_type}</div>
|
||||
<div><p class="service_price">{displayPrice price=$demands_price_per_room}</p></div>
|
||||
</div>
|
||||
<div class="summary-row">
|
||||
@@ -181,7 +187,7 @@
|
||||
<span class="num_searched_avail_rooms">
|
||||
{$total_available_rooms|escape:'html':'UTF-8'}
|
||||
</span>
|
||||
{if $total_available_rooms > 1} {l s='rooms left!'} {else} {l s='room left!'} {/if}
|
||||
{if $total_available_rooms > 1} {l s='%s left!' sprintf=$attribute_types} {else} {l s='%s left!' sprintf=$attribute_type} {/if}
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
@@ -212,7 +218,7 @@
|
||||
{/block}
|
||||
{else}
|
||||
<div class="sold_out_alert">
|
||||
<span>{l s='All rooms sold out!'}</span>
|
||||
<span>{l s='All %s sold out!' sprintf=$attribute_types}</span>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
@@ -220,7 +226,7 @@
|
||||
{block name='booking_form_associated_hotels'}
|
||||
{if isset($associated_hotels) && $associated_hotels}
|
||||
<div class="form-group">
|
||||
<label class="control-label">{l s='Select Hotel'}</label>
|
||||
<label class="control-label">{l s='Select Property'}</label>
|
||||
<select class="chosen input-hotel" name="service_id_hotel" id="service_id_hotel">
|
||||
{foreach $associated_hotels as $hotel}
|
||||
<option value="{$hotel.id_hotel}" {if isset($service_id_hotel) && $service_id_hotel == $hotel['id_hotel']}selected{elseif $hotel@first}selected{/if}>{$hotel.name}</option>
|
||||
|
||||
@@ -20,12 +20,20 @@
|
||||
* @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}
|
||||
|
||||
<div class="form-group dropdown">
|
||||
{block name='occupancy_field_button'}
|
||||
<button class="form-control booking_guest_occupancy input-occupancy{if isset($error) && $error == 1} error_border{/if}" type="button">
|
||||
<span class="">
|
||||
{if isset($occupancies) && $occupancies}
|
||||
{if (isset($occupancy_adults) && $occupancy_adults)}{$occupancy_adults} {if $occupancy_adults > 1}{l s='Adults'}{else}{l s='Adult'}{/if}, {if isset($occupancy_children) && $occupancy_children}{$occupancy_children} {if $occupancy_children > 1} {l s='Children'}{else}{l s='Child'}{/if}, {/if}{$occupancies|count} {if $occupancies|count > 1}{l s='Rooms'}{else}{l s='Room'}{/if}{else}{l s='1 Adult, 1 Room'}{/if}
|
||||
{if (isset($occupancy_adults) && $occupancy_adults)}{$occupancy_adults} {if $occupancy_adults > 1}{l s='Adults'}{else}{l s='Adult'}{/if}, {if isset($occupancy_children) && $occupancy_children}{$occupancy_children} {if $occupancy_children > 1} {l s='Children'}{else}{l s='Child'}{/if}, {/if}{$occupancies|count} {if $occupancies|count > 1}{$attribute_types|escape:'html':'UTF-8'}{else}{$attribute_type|escape:'html':'UTF-8'}{/if}{else}1 {l s='Adult'}, 1 {$attribute_type|escape:'html':'UTF-8'}{/if}
|
||||
{else}
|
||||
{l s='Select Occupancy'}
|
||||
{/if}
|
||||
@@ -34,7 +42,7 @@
|
||||
{/block}
|
||||
|
||||
{block name='occupancy_field_content'}
|
||||
<div class="dropdown-menu booking_occupancy_wrapper">
|
||||
<div class="dropdown-menu booking_occupancy_wrapper" data-room-label="{$attribute_type|escape:'html':'UTF-8'}" data-rooms-label="{$attribute_types|escape:'html':'UTF-8'}">
|
||||
<input type="hidden" class="max_avail_type_qty" value="{if isset($total_available_rooms)}{$total_available_rooms|escape:'html':'UTF-8'}{/if}">
|
||||
<input type="hidden" class="max_adults" value="{$room_type_info['max_adults']|escape:'html':'UTF-8'}">
|
||||
<input type="hidden" class="max_children" value="{$room_type_info['max_children']|escape:'html':'UTF-8'}">
|
||||
@@ -46,7 +54,7 @@
|
||||
{assign var=countRoom value=1}
|
||||
{foreach from=$occupancies key=key item=$occupancy name=occupancyInfo}
|
||||
<div class="occupancy_info_block selected" occ_block_index="{$key|escape:'htmlall':'UTF-8'}">
|
||||
<div class="occupancy_info_head"><span class="room_num_wrapper">{l s='Room'} - {$countRoom|escape:'htmlall':'UTF-8'} </span>{if !$smarty.foreach.occupancyInfo.first}<a class="remove-room-link pull-right" href="#">{l s='Remove'}</a>{/if}</div>
|
||||
<div class="occupancy_info_head"><span class="room_num_wrapper">{$attribute_type|escape:'htmlall':'UTF-8'} - {$countRoom|escape:'htmlall':'UTF-8'} </span>{if !$smarty.foreach.occupancyInfo.first}<a class="remove-room-link pull-right" href="#">{l s='Remove'}</a>{/if}</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-5 col-xs-6 occupancy_count_block">
|
||||
<div class="row">
|
||||
@@ -117,7 +125,7 @@
|
||||
{/foreach}
|
||||
{else}
|
||||
<div class="occupancy_info_block" occ_block_index="0">
|
||||
<div class="occupancy_info_head"><span class="room_num_wrapper">{l s='Room - 1'}</span></div>
|
||||
<div class="occupancy_info_head"><span class="room_num_wrapper">{$attribute_type|escape:'htmlall':'UTF-8'} - 1</span></div>
|
||||
<div class="row">
|
||||
<div class="form-group col-sm-5 col-xs-6 occupancy_count_block">
|
||||
<div class="row">
|
||||
@@ -186,7 +194,7 @@
|
||||
<span class="add_occupancy_block">
|
||||
<a class="add_new_occupancy_btn {if isset($occupancies) && $occupancies && isset($total_available_rooms) && $total_available_rooms <= count($occupancies)} disabled{/if}" data-title-available="{l s='Click to add more rooms.'}" data-title-unavailable="{l s='No more rooms available.'}" href="#">
|
||||
<i class="icon-plus"></i>
|
||||
<span>{l s='Add Room'}</span>
|
||||
<span>{l s='Add'} {$attribute_type|escape:'html':'UTF-8'}</span>
|
||||
</a>
|
||||
</span>
|
||||
<span>
|
||||
|
||||
@@ -19,7 +19,13 @@
|
||||
* @copyright Since 2010 Webkul
|
||||
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
|
||||
*}
|
||||
|
||||
{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}
|
||||
<div class="product-detail" data-id-product="{$data_v.id_product}" data-date-diff="{$rm_k}">
|
||||
<div class="row">
|
||||
{block name='order_room_detail_room_image'}
|
||||
@@ -42,20 +48,20 @@
|
||||
{if $rm_v['count_cancelled'] > 0}
|
||||
<span class="badge badge-danger">
|
||||
{if $rm_v['count_cancelled'] > 1}
|
||||
{$rm_v['count_cancelled']} {l s='Rooms Cancelled'}
|
||||
{$rm_v['count_cancelled']} {l s='%s Cancelled' sprintf=$attribute_types|escape:'html':'UTF-8'}
|
||||
{else}
|
||||
{$rm_v['count_cancelled']} {l s='Room Cancelled'}
|
||||
{$rm_v['count_cancelled']} {l s='%s Cancelled' sprintf=$attribute_type|escape:'html':'UTF-8'}
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
{if $rm_v['count_refunded'] > 0}
|
||||
<span class="badge badge-danger">
|
||||
{if $rm_v['count_refunded'] > 1}
|
||||
{$rm_v['count_refunded']} {l s='Rooms Refunded'}
|
||||
{else}
|
||||
{$rm_v['count_refunded']} {l s='Room Refunded'}
|
||||
{/if}
|
||||
</span>
|
||||
<span class="badge badge-danger">
|
||||
{if $rm_v['count_refunded'] > 1}
|
||||
{$rm_v['count_refunded']} {l s='%s Refunded' sprintf=$attribute_types|escape:'html':'UTF-8'}
|
||||
{else}
|
||||
{$rm_v['count_refunded']} {l s='%s Refunded' sprintf=$attribute_type|escape:'html':'UTF-8'}
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -82,7 +88,7 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Rooms'}</dt>
|
||||
<dt class="col-xs-5">{if $rm_v.num_rm > 1}{$attribute_types|escape:'html':'UTF-8'}{else}{$attribute_type|escape:'html':'UTF-8'}{/if}</dt>
|
||||
<dd class="col-xs-7">{$rm_v.num_rm|string_format:'%02d'}</dd>
|
||||
</div>
|
||||
</div>
|
||||
@@ -132,7 +138,7 @@
|
||||
<div class="price-info-tooltip-cont">
|
||||
<div class="list-row">
|
||||
<div>
|
||||
<p>{l s='Room(s) cost:'}</p>
|
||||
<p>{l s='%s cost:' sprintf=$attribute_types|escape:'html':'UTF-8'}</p>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<p>
|
||||
|
||||
@@ -101,8 +101,12 @@
|
||||
{block name='room_type_list_room_booking_fields'}
|
||||
{if !isset($restricted_country_mode) && !$PS_CATALOG_MODE && !$order_date_restrict}
|
||||
{if (!isset($display_all_room_types) || !$display_all_room_types)}
|
||||
<div class="booking_room_fields">
|
||||
{if isset($occupancy_required_for_booking) && $occupancy_required_for_booking}
|
||||
{assign var=room_occ_required value=false}
|
||||
{if isset($room_v['occupancy_required_for_booking'])}
|
||||
{assign var=room_occ_required value=$room_v['occupancy_required_for_booking']}
|
||||
{/if}
|
||||
<div class="booking_room_fields" data-occupancy-required="{$room_occ_required|intval}">
|
||||
{if $room_occ_required}
|
||||
<div class="booking_guest_occupancy_conatiner">
|
||||
{block name='occupancy_field'}
|
||||
{include file="./occupancy_field.tpl" room_type_info=$room_v total_available_rooms=$room_v['room_left']}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
{if $total_rooms_wt + $total_extra_demands_wt + $total_additional_services_wt + $total_additional_services_auto_add_wt}
|
||||
<p>
|
||||
<span>
|
||||
{l s='Total rooms cost'}
|
||||
{l s='Total Stay cost'}
|
||||
{if $display_tax_label}
|
||||
{if $use_taxes && $priceDisplay == 0}
|
||||
{l s='(tax incl)'}
|
||||
|
||||
@@ -378,6 +378,9 @@ 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');
|
||||
@@ -398,7 +401,7 @@ var ajaxCart = {
|
||||
if (typeof dateTo != 'undefined')
|
||||
req.append('dateTo', dateTo);
|
||||
|
||||
if (occupancy_required_for_booking) {
|
||||
if (isOccupancyBooking) {
|
||||
req.append('occupancy', JSON.stringify(occupancy));
|
||||
} else {
|
||||
req.append('qty', ((occupancy && occupancy != null) ? occupancy : '1'));
|
||||
@@ -425,6 +428,7 @@ var ajaxCart = {
|
||||
contentType: false,
|
||||
processData: false,
|
||||
success: function(jsonData, textStatus, jqXHR) {
|
||||
console.log(jsonData);
|
||||
if (pagename == 'product') {
|
||||
if (jsonData.avail_rooms == 0) {
|
||||
disableRoomTypeDemands(1);
|
||||
@@ -1203,16 +1207,29 @@ 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;
|
||||
if (occupancy_required_for_booking) {
|
||||
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 labelTemplate = isOccupancyBooking ? $labelContainer.data('label-occupancy') : $labelContainer.data('label-quantity');
|
||||
if (labelTemplate) {
|
||||
var labelText = labelTemplate.replace(/__ROOMS__/g, roomsLabel).replace(/__ROOM__/g, roomLabel);
|
||||
$roomLabel.text(labelText);
|
||||
}
|
||||
}
|
||||
if (isOccupancyBooking) {
|
||||
$.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, roomLabel, roomsLabel);
|
||||
} else {
|
||||
product_quantity_text = product.occupancy;
|
||||
}
|
||||
@@ -1454,7 +1471,8 @@ function getBookingOccupancyDetails(bookingform, booking_product)
|
||||
{
|
||||
let occupancy;
|
||||
if (booking_product) {
|
||||
if (occupancy_required_for_booking) {
|
||||
var isOccupancyBooking = getOccupancyRequiredForBooking(bookingform);
|
||||
if (isOccupancyBooking) {
|
||||
$('.booking_guest_occupancy_conatiner .dropdown').removeClass('open');
|
||||
let selected_occupancy = $(bookingform).find(".occupancy_info_block.selected")
|
||||
if (selected_occupancy.length) {
|
||||
@@ -1496,3 +1514,30 @@ 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;
|
||||
}
|
||||
|
||||
@@ -27,10 +27,11 @@ $(document).ready(function(){
|
||||
|
||||
booking_occupancy_inner = $(this).closest('.booking_occupancy_inner');
|
||||
var booking_occupancy_wrapper = $(this).closest('.booking_occupancy_wrapper');
|
||||
var roomLabels = getRoomLabels(booking_occupancy_wrapper);
|
||||
$(this).closest('.occupancy_info_block').hide('fast', function(){
|
||||
$(this).remove()
|
||||
$(booking_occupancy_inner).find('.room_num_wrapper').each(function(key, val) {
|
||||
$(this).text(room_txt + ' - '+ (key+1) );
|
||||
$(this).text(roomLabels.room + ' - '+ (key+1) );
|
||||
});
|
||||
var countRooms = parseInt($(booking_occupancy_wrapper).find('.occupancy_info_block').length);
|
||||
if (countRooms < $(booking_occupancy_wrapper).find('.max_avail_type_qty').val()) {
|
||||
@@ -236,10 +237,11 @@ $(document).ready(function(){
|
||||
return true;
|
||||
}
|
||||
|
||||
$(document).on('click', '.booking_occupancy_wrapper .add_new_occupancy_btn', function(e) {
|
||||
$(document).on('click', '.booking_occupancy_wrapper .add_new_occupancy_btn', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var booking_occupancy_wrapper = $(this).closest('.booking_occupancy_wrapper');
|
||||
var roomLabels = getRoomLabels(booking_occupancy_wrapper);
|
||||
var occupancy_block = '';
|
||||
var roomBlockIndex = parseInt($(booking_occupancy_wrapper).find(".occupancy_info_block").last().attr('occ_block_index'));
|
||||
roomBlockIndex += 1;
|
||||
@@ -252,7 +254,7 @@ $(document).ready(function(){
|
||||
&& countRooms <= $(booking_occupancy_wrapper).find('.max_avail_type_qty').val()
|
||||
) {
|
||||
occupancy_block += '<div class="occupancy_info_block" occ_block_index="'+roomBlockIndex+'" style="display:none;">';
|
||||
occupancy_block += '<div class="occupancy_info_head"><span class="room_num_wrapper">'+ room_txt + ' - ' + countRooms + '</span><a class="remove-room-link pull-right" href="#">' + remove_txt + '</a></div>';
|
||||
occupancy_block += '<div class="occupancy_info_head"><span class="room_num_wrapper">'+ roomLabels.room + ' - ' + countRooms + '</span><a class="remove-room-link pull-right" href="#">' + remove_txt + '</a></div>';
|
||||
occupancy_block += '<div class="row">';
|
||||
occupancy_block += '<div class="form-group col-sm-5 col-xs-6 occupancy_count_block">';
|
||||
occupancy_block += '<div class="row">';
|
||||
@@ -363,6 +365,7 @@ function setRoomTypeGuestOccupancy(booking_occupancy_wrapper)
|
||||
var adults = 0;
|
||||
var children = 0;
|
||||
var rooms = $(booking_occupancy_wrapper).find('.occupancy_info_block').length;
|
||||
var roomLabels = getRoomLabels(booking_occupancy_wrapper);
|
||||
|
||||
$(booking_occupancy_wrapper).find(".num_adults" ).each(function(key, val) {
|
||||
adults += parseInt($(this).val());
|
||||
@@ -370,12 +373,18 @@ function setRoomTypeGuestOccupancy(booking_occupancy_wrapper)
|
||||
$(booking_occupancy_wrapper).find(".num_children" ).each(function(key, val) {
|
||||
children += parseInt($(this).val());
|
||||
});
|
||||
guestButtonVal = getRoomTypeGuestOccupancyFormated(adults, children, rooms);
|
||||
guestButtonVal = getRoomTypeGuestOccupancyFormated(adults, children, rooms, roomLabels.room, roomLabels.rooms);
|
||||
$(booking_occupancy_wrapper).siblings('.booking_guest_occupancy').find('span').text(guestButtonVal);
|
||||
}
|
||||
|
||||
function getRoomTypeGuestOccupancyFormated(adults, children, rooms)
|
||||
function getRoomTypeGuestOccupancyFormated(adults, children, rooms, roomLabel, roomsLabel)
|
||||
{
|
||||
if (!roomLabel) {
|
||||
roomLabel = (typeof room_txt !== 'undefined') ? room_txt : 'Room';
|
||||
}
|
||||
if (!roomsLabel) {
|
||||
roomsLabel = (typeof rooms_txt !== 'undefined') ? rooms_txt : roomLabel;
|
||||
}
|
||||
var guestButtonVal = parseInt(adults) + ' ';
|
||||
if (parseInt(adults) > 1) {
|
||||
guestButtonVal += adults_txt;
|
||||
@@ -390,14 +399,33 @@ function getRoomTypeGuestOccupancyFormated(adults, children, rooms)
|
||||
}
|
||||
}
|
||||
if (parseInt(rooms) > 1) {
|
||||
guestButtonVal += ', ' + parseInt(rooms) + ' ' + rooms_txt;
|
||||
guestButtonVal += ', ' + parseInt(rooms) + ' ' + roomsLabel;
|
||||
} else {
|
||||
guestButtonVal += ', ' + parseInt(rooms) + ' ' + room_txt;
|
||||
guestButtonVal += ', ' + parseInt(rooms) + ' ' + roomLabel;
|
||||
}
|
||||
|
||||
return guestButtonVal;
|
||||
}
|
||||
|
||||
function getRoomLabels(booking_occupancy_wrapper)
|
||||
{
|
||||
var $wrapper = $(booking_occupancy_wrapper);
|
||||
var roomLabel = $wrapper.attr('data-room-label');
|
||||
var roomsLabel = $wrapper.attr('data-rooms-label');
|
||||
|
||||
if (!roomLabel) {
|
||||
roomLabel = (typeof room_txt !== 'undefined') ? room_txt : 'Room';
|
||||
}
|
||||
if (!roomsLabel) {
|
||||
roomsLabel = (typeof rooms_txt !== 'undefined') ? rooms_txt : roomLabel;
|
||||
}
|
||||
|
||||
return {
|
||||
room: roomLabel,
|
||||
rooms: roomsLabel
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
function resetOccupancyField(booking_occupancy_wrapper)
|
||||
{
|
||||
|
||||
@@ -1551,7 +1551,8 @@ function getBookingOccupancy()
|
||||
{
|
||||
let bookingform = $("#booking-form");
|
||||
let occupancy;
|
||||
if (occupancy_required_for_booking) {
|
||||
var isOccupancyBooking = getOccupancyRequiredForBooking(bookingform);
|
||||
if (isOccupancyBooking) {
|
||||
let selected_occupancy = $(bookingform).find(".occupancy_info_block.selected")
|
||||
if (selected_occupancy.length) {
|
||||
occupancy = [];
|
||||
@@ -1590,4 +1591,16 @@ function getBookingOccupancy()
|
||||
}
|
||||
|
||||
return occupancy;
|
||||
}
|
||||
}
|
||||
|
||||
function getOccupancyRequiredForBooking(bookingform)
|
||||
{
|
||||
var value = occupancy_required_for_booking;
|
||||
if (bookingform && $(bookingform).length) {
|
||||
var dataVal = $(bookingform).closest('.booking_room_fields').data('occupancy-required');
|
||||
if (typeof dataVal !== 'undefined') {
|
||||
value = parseInt(dataVal, 10) === 1;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
<span class="cross" title="{l s='Close window' mod='blockcart'}"></span>
|
||||
{block name='blockcart_layer_cart_left_heading'}
|
||||
<h2 class="layer_cart_room_txt">
|
||||
<i class="icon-check"></i>{l s='Room successfully added to your cart' mod='blockcart'}
|
||||
<i class="icon-check"></i><span class="layer_cart_room_success_msg" data-room-msg-template="{l s='%s successfully added to your cart' mod='blockcart' sprintf=['__ROOM__']}">{l s='Room successfully added to your cart' mod='blockcart'}</span>
|
||||
</h2>
|
||||
<h2 class="layer_cart_product_txt">
|
||||
<i class="icon-check"></i>{l s='Product successfully added to your cart' mod='blockcart'}
|
||||
@@ -223,12 +223,14 @@
|
||||
<span id="layer_cart_product_unit_price"></span>
|
||||
</div>
|
||||
<div>
|
||||
<strong class="dark layer_cart_room_txt">{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} - </strong>
|
||||
<strong class="dark layer_cart_room_txt" data-label-occupancy="{l s='%s occupancy' mod='blockcart' sprintf=['__ROOM__']}" data-label-quantity="{l s='%s quantity added' mod='blockcart' sprintf=['__ROOMS__']}">
|
||||
<span class="layer_cart_attribute_type" data-room-msg-template="{if isset($occupancy_required_for_booking) && $occupancy_required_for_booking}{l s='%s occupancy' mod='blockcart' sprintf=['__ROOM__']}{else}{l s='%s quantity added' mod='blockcart' sprintf=['__ROOMS__']}{/if}">{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}</span> -
|
||||
</strong>
|
||||
<strong class="dark layer_cart_product_txt">{l s='Quantity' mod='blockcart'} - </strong>
|
||||
<span id="layer_cart_product_quantity"></span>
|
||||
</div>
|
||||
<div>
|
||||
<strong class="dark layer_cart_room_txt">{l s='Room type cost' mod='blockcart'} - </strong>
|
||||
<strong class="dark layer_cart_room_txt"><span class="layer_cart_room_type_cost_label">{l s='Room type cost' mod='blockcart'}</span> - </strong>
|
||||
<strong class="dark layer_cart_product_txt">{l s='Total' mod='blockcart'} - </strong>
|
||||
<span id="layer_cart_product_price"></span>
|
||||
</div>
|
||||
@@ -255,7 +257,7 @@
|
||||
{block name='blockcart_layer_cart_room_total_price'}
|
||||
<div class="layer_cart_row">
|
||||
<strong class="dark">
|
||||
{l s='Total Rooms Cost in cart' mod='blockcart'}
|
||||
{l s='Total Stay Cost in cart' mod='blockcart'}
|
||||
{if $display_tax_label}
|
||||
{if $priceDisplay == 1}
|
||||
{l s='(tax excl.)' mod='blockcart'}
|
||||
|
||||
@@ -100,6 +100,13 @@
|
||||
|
||||
<div class="row">
|
||||
{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}
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Check-in'}</dt>
|
||||
@@ -117,7 +124,7 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="row">
|
||||
<dt class="col-xs-5">{l s='Rooms'}</dt>
|
||||
<dt class="col-xs-5">{if $rm_v.num_rm > 1}{$attribute_types|escape:'html':'UTF-8'}{else}{$attribute_type|escape:'html':'UTF-8'}{/if}</dt>
|
||||
<dd class="col-xs-7">{$rm_v.num_rm|string_format:'%02d'}</dd>
|
||||
</div>
|
||||
</div>
|
||||
@@ -424,7 +431,7 @@
|
||||
{if isset($cart_htl_data)}
|
||||
<tr class="item">
|
||||
<td>
|
||||
<strong>{l s='Total Rooms Cost'} {if $use_taxes && $display_tax_label == 1}{if $priceDisplay == 1}{l s='(tax excl.)'}{elseif $priceDisplay == 0}{l s='(tax incl.)'}{/if} {/if}</strong>
|
||||
<strong>{l s='Total Stay Cost'} {if $use_taxes && $display_tax_label == 1}{if $priceDisplay == 1}{l s='(tax excl.)'}{elseif $priceDisplay == 0}{l s='(tax incl.)'}{/if} {/if}</strong>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
{if $priceDisplay && $use_tax}
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
{if isset($obj_hotel_branch_information) && $obj_hotel_branch_information}
|
||||
<div class="card hotel-details">
|
||||
<div class="card-header">
|
||||
{l s='Hotel Details'}
|
||||
{l s='%s Details' sprintf=$property_name}
|
||||
<div class="booking-actions-wrap">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 clearfix">
|
||||
@@ -102,7 +102,7 @@
|
||||
<div class="description-list">
|
||||
<dl class="">
|
||||
<div class="row">
|
||||
<dt class="col-xs-6 col-sm-3">{l s='Hotel Name'}</dt>
|
||||
<dt class="col-xs-6 col-sm-3">{l s='%s Name' sprintf=$property_name}</dt>
|
||||
<dd class="col-xs-6 col-sm-3">{$obj_hotel_branch_information->hotel_name}</dd>
|
||||
<dt class="col-xs-6 col-sm-3">{l s='Phone Number'}</dt>
|
||||
<dd class="col-xs-6 col-sm-3">
|
||||
@@ -176,7 +176,7 @@
|
||||
{if isset($obj_hotel_branch_information)}
|
||||
<div class="card hotel-location visible-xs visible-sm hidden-md hidden-lg">
|
||||
<div class="card-header">
|
||||
{l s='Hotel Location'}
|
||||
{l s='%s Location' sprintf=$property_name}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="card-subtitle">
|
||||
@@ -191,7 +191,7 @@
|
||||
{$hotel_address_info['country']}, {$hotel_address_info['postcode']}
|
||||
</p>
|
||||
{else}
|
||||
<div class="card-text">{l s='Hotel location not available.'}</div>
|
||||
<div class="card-text">{l s='%s location not available.' sprintf=$property_name}</div>
|
||||
{/if}
|
||||
|
||||
{if ($obj_hotel_branch_information->latitude|floatval != 0 && $obj_hotel_branch_information->longitude|floatval != 0) && $view_on_map}
|
||||
@@ -327,7 +327,7 @@
|
||||
{assign var=total_standard_products_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_STANDALONE) + $order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_HOTEL_STANDALONE))}
|
||||
{if isset($cart_htl_data) && $cart_htl_data}
|
||||
<tr>
|
||||
<td>{l s='Total rooms cost'} {if $use_taxes && $display_tax_label == 1}{if $priceDisplay == 1}{l s='(tax excl.)'}{elseif $priceDisplay == 0}{l s='(tax incl.)'}{/if} {/if}</td>
|
||||
<td>{l s='Total Stay Cost'} {if $use_taxes && $display_tax_label == 1}{if $priceDisplay == 1}{l s='(tax excl.)'}{elseif $priceDisplay == 0}{l s='(tax incl.)'}{/if} {/if}</td>
|
||||
<td class="text-right">
|
||||
{if $priceDisplay && $use_tax}
|
||||
<span class="price">{displayWtPriceWithCurrency price=($room_price_tax_excl + $room_services_price_tax_excl - $total_convenience_fee_te) currency=$currency}</span>
|
||||
@@ -494,7 +494,7 @@
|
||||
<ul class="nav nav-tabs">
|
||||
{if $has_general_hotel_policies}
|
||||
<li class="active">
|
||||
<a href="#tab-hotel-policies-general" data-toggle="tab">{l s='Hotel Policies'}</a>
|
||||
<a href="#tab-hotel-policies-general" data-toggle="tab">{l s='%s Policies' sprintf=$property_name}</a>
|
||||
</li>
|
||||
{/if}
|
||||
{if $has_refund_hotel_policies}
|
||||
@@ -675,7 +675,7 @@
|
||||
{if isset($obj_hotel_branch_information)}
|
||||
<div class="card hotel-location hidden-xs hidden-sm visible-md">
|
||||
<div class="card-header">
|
||||
{l s='Hotel Location'}
|
||||
{l s='%s Location' sprintf=$property_name}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="card-subtitle">
|
||||
@@ -691,7 +691,7 @@
|
||||
{$hotel_address_info['country']}, {$hotel_address_info['postcode']}
|
||||
</p>
|
||||
{else}
|
||||
<div class="card-text">{l s='Hotel location not available.'}</div>
|
||||
<div class="card-text">{l s='%s location not available.' sprintf=$property_name }</div>
|
||||
{/if}
|
||||
|
||||
{if ($obj_hotel_branch_information->latitude|floatval != 0 && $obj_hotel_branch_information->longitude|floatval != 0) && $view_on_map}
|
||||
@@ -736,7 +736,7 @@
|
||||
|
||||
{if isset($cart_htl_data) && $cart_htl_data}
|
||||
<tr>
|
||||
<td>{l s='Total rooms cost'} {if $use_taxes && $display_tax_label == 1}{if $priceDisplay == 1}{l s='(tax excl.)'}{elseif $priceDisplay == 0}{l s='(tax incl.)'}{/if} {/if}</td>
|
||||
<td>{l s='Total Stay Cost'} {if $use_taxes && $display_tax_label == 1}{if $priceDisplay == 1}{l s='(tax excl.)'}{elseif $priceDisplay == 0}{l s='(tax incl.)'}{/if} {/if}</td>
|
||||
<td class="text-right">
|
||||
{if $priceDisplay && $use_tax}
|
||||
<span class="price">{displayWtPriceWithCurrency price=($room_price_tax_excl + $room_services_price_tax_excl - $total_convenience_fee_te) currency=$currency}</span>
|
||||
@@ -956,14 +956,21 @@
|
||||
{foreach from=$cart_htl_data key=data_k item=data_v}
|
||||
{foreach from=$data_v['date_diff'] key=rm_k item=rm_v}
|
||||
<div id="room-info-tab-{$data_v.id_product}-{$rm_k}" class="tab-pane {if $flag_is_first_iteration}active{/if}">
|
||||
{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}
|
||||
<div class="refund_element_summary clearfix">
|
||||
<p class="refund_element_name">{$data_v.name}</p>
|
||||
<div class="col-xs-3">
|
||||
<p>{l s='Total Rooms'}</p>
|
||||
<p>{l s='Total %s' sprintf=$attribute_types|escape:'html':'UTF-8'}</p>
|
||||
<strong>{$rm_v.num_rm|string_format:'%02d'}</strong>
|
||||
</div>
|
||||
<div class="col-xs-3">
|
||||
<p>{l s='Cancelled Rooms'}</p>
|
||||
<p>{l s='Cancelled %s' sprintf=$attribute_types|escape:'html':'UTF-8'}</p>
|
||||
<strong>{($rm_v.count_cancelled + $rm_v.count_refunded)|string_format:'%02d'}</strong>
|
||||
</div>
|
||||
</div>
|
||||
@@ -975,7 +982,7 @@
|
||||
<div class="checkbox">
|
||||
<label for="bookings_to_refund_{$hotel_booking_detail.id_htl_booking}">
|
||||
<input type="checkbox" class="bookings_to_refund" id="bookings_to_refund_{$hotel_booking_detail.id_htl_booking}" name="bookings_to_refund[]" value="{$hotel_booking_detail.id_htl_booking|escape:'html':'UTF-8'}" {if $is_room_cancelled || ($hotel_booking_detail.id_status != $ROOM_STATUS_ALLOTED)}disabled{/if}/>
|
||||
{l s='Room'} - {$smarty.foreach.foreachRefundRooms.iteration|string_format:'%02d'}
|
||||
{l s='%s - %s' sprintf=[$attribute_type|escape:'html':'UTF-8', $smarty.foreach.foreachRefundRooms.iteration|string_format:'%02d']}
|
||||
</label>
|
||||
|
||||
<span>({$hotel_booking_detail.adults|string_format:'%02d'} {if $hotel_booking_detail.adults > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $hotel_booking_detail.children > 0}{l s=', '}{$hotel_booking_detail.children|string_format:'%02d'} {if $hotel_booking_detail.children > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if})</span>
|
||||
@@ -1016,7 +1023,7 @@
|
||||
</div>
|
||||
{else}
|
||||
<div class="extra-services-wrap clearfix">
|
||||
<p class="text-muted">{l s='No extra services added for this room.'}</p>
|
||||
<p class="text-muted">{l s='No extra services added for this %s.' sprintf=$attribute_type|escape:'html':'UTF-8'}</p>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<tr>
|
||||
<th>{l s='Rooms'}</th>
|
||||
<th>{l s='Room type'}</th>
|
||||
<th>{l s='Hotel'}</th>
|
||||
<th>{l s='Property Name'}</th>
|
||||
<th>{l s='Duration'}</th>
|
||||
<th>{l s='Total rooms price (tax incl.)'}</th>
|
||||
<th>{l s='Extra services price (tax incl.)'}</th>
|
||||
|
||||
@@ -205,14 +205,18 @@
|
||||
{/block}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{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}
|
||||
<div class="product_info_containter">
|
||||
<!-- tab hook is added here -->
|
||||
<!--HOOK_PRODUCT_TAB -->
|
||||
<section class="page-product-box">
|
||||
{block name='product_tabs'}
|
||||
<ul class="nav nav-tabs product_description_tabs">
|
||||
<li class="active"><a href="#product_info_tab" class="idTabHrefShort" data-toggle="tab">{if $product->booking_product}{l s='Room Information'}{else}{l s='Product Information'}{/if}</a></li>
|
||||
<li class="active"><a href="#product_info_tab" class="idTabHrefShort" data-toggle="tab">{if $product->booking_product}{l s='%s Information' sprintf=$attribute_type}{else}{l s='Product Information'}{/if}</a></li>
|
||||
{* Block for booking products *}
|
||||
{if isset($id_hotel) && $id_hotel}
|
||||
<li><a href="#refund_policies_tab" class="idTabHrefShort" data-toggle="tab">{l s='Refund Policies'}</a></li>
|
||||
@@ -282,7 +286,7 @@
|
||||
{if isset($features) && $features}
|
||||
<div class="info_margin_div">
|
||||
<div class="room_info_heading">
|
||||
<span>{l s='Room Features'}</span>
|
||||
<span>{l s='%s Features' sprintf=$attribute_type}</span>
|
||||
</div>
|
||||
<div class="room_info_content row">
|
||||
{foreach from=$features key=ftr_k item=ftr_v}
|
||||
@@ -302,7 +306,7 @@
|
||||
{if isset($hotel_features) && $hotel_features}
|
||||
<div class="info_margin_div">
|
||||
<div class="room_info_heading">
|
||||
<span>{l s='Hotel Features'}</span>
|
||||
<span>{l s='%s Features' sprintf=$property_type}</span>
|
||||
</div>
|
||||
<div class="room_info_content row">
|
||||
{foreach from=$hotel_features key=ftr_k item=ftr_v}
|
||||
@@ -316,7 +320,7 @@
|
||||
{if isset($hotel_description) && $hotel_description}
|
||||
<div class="info_margin_div">
|
||||
<div class="room_info_heading">
|
||||
<span>{l s='Hotel Description'}</span>
|
||||
<span>{l s='%s Description' sprintf=$property_type}</span>
|
||||
</div>
|
||||
<div class="room_info_content">
|
||||
{$hotel_description}
|
||||
@@ -365,7 +369,7 @@
|
||||
{if isset($hotel_policies) && $hotel_policies}
|
||||
<div class="info_margin_div">
|
||||
<div class="room_info_heading">
|
||||
<span>{l s='Hotel Policies'}</span>
|
||||
<span>{l s='%s Policies' sprintf=$property_type}</span>
|
||||
</div>
|
||||
<div class="room_info_content">
|
||||
<p class="">{$hotel_policies}</p>
|
||||
|
||||
@@ -91,6 +91,13 @@
|
||||
{/block}
|
||||
{block name='shopping_cart_room_type_booking_information'}
|
||||
{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}
|
||||
<div class="room_duration_block">
|
||||
<div class="col-sm-3 col-xs-6">
|
||||
<p class="room_duration_block_head">{l s='CHECK IN'}</p>
|
||||
@@ -103,7 +110,7 @@
|
||||
<div class="col-sm-6 col-xs-6">
|
||||
<p class="room_duration_block_head">{l s='OCCUPANCY'}</p>
|
||||
<p class="room_duration_block_value">
|
||||
{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} {$attribute_types|escape:'html':'UTF-8'}{else} {$attribute_type|escape:'html':'UTF-8'}{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -137,7 +144,7 @@
|
||||
{/if}
|
||||
</p>
|
||||
<p class="total_price_detial">
|
||||
{l s='Total rooms price'} {if $display_tax_label}{if $priceDisplay} {l s='(Excl.'} {else}{l s='(Incl.)'}{/if} {l s='all taxes.)'}{/if}
|
||||
{l s='Total %s price' sprintf=$attribute_types|escape:'html':'UTF-8'} {if $display_tax_label}{if $priceDisplay} {l s='(Excl.'} {else}{l s='(Incl.)'}{/if} {l s='all taxes.)'}{/if}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user