Merge branch 'develop' into gli-2594

This commit is contained in:
Sumit Panwar
2025-06-12 18:52:49 +05:30
76 changed files with 756 additions and 1583 deletions

View File

@@ -55,7 +55,7 @@
<span class="message-date">&nbsp;<i class="icon-calendar"></i> - {dateFormat date=$message.date_add full=0} - <i class="icon-time"></i> {$message.date_add|substr:11:5}</span>
{if $message.private}<span class="badge badge-info">{l s='Private'}</span>{/if}
{if isset($message.file_name)} <span class="message-product">&nbsp;<i class="icon-link"></i> <a href="{$message.file_name|escape:'html':'UTF-8'}" class="_blank">{l s="Attachment"}</a></span>{/if}
{if isset($message.product_name)} <span class="message-attachment">&nbsp;<i class="icon-book"></i> <a href="{$message.product_link|escape:'html':'UTF-8'}" class="_blank">{l s="Room type:"} {$message.product_name|escape:'html':'UTF-8'} </a></span>{/if}
{if isset($message.product_name)} <span class="message-attachment">&nbsp;<i class="icon-book"></i> <a href="{$message.product_link|escape:'html':'UTF-8'}" class="_blank">{if isset($message.booking_product) && $message.booking_product}{l s="Room type:"}{else}{l s="Product:"}{/if} {$message.product_name|escape:'html':'UTF-8'} </a></span>{/if}
<p class="message-item-text">{$message.message|escape:'html':'UTF-8'|nl2br}</p>
</div>
</div>

View File

@@ -37,7 +37,7 @@
{block name=script}
var langPackOk = "<img src=\"{$smarty.const._PS_IMG_}admin/information.png\" alt=\"\" /> {l s='A language pack is available for this ISO.'}";
var langPackVersion = "{l s='The Prestashop version compatible with this language and your system is:'}";
var langPackVersion = "{l s='The QloApps version compatible with this language and your system is:'}";
var langPackInfo = "{l s='After creating the language, you can import the content of the language pack, which you can download under "Localization -- Translations."'}";
var noLangPack = "<img src=\"{$smarty.const._PS_IMG_}admin/information.png\" alt=\"\" /> {l s='No language pack is available on prestashop.com for this ISO code'}";
var download = "{l s='Download'}";

View File

@@ -257,37 +257,6 @@
}
return typeIsPack;
}
$("#product_form").validate({
ignore: '.updateCurrentText',
rules: {
inputPackItems: {
required: {
depends: checkIfProductTypeIsPack
},
}
},
messages: {
inputPackItems: {
required: ""
}
},
// override jquery validate plugin defaults for bootstrap 3
highlight: function(element) {
$(element).closest('.form-group').addClass('has-error');
},
unhighlight: function(element) {
$(element).closest('.form-group').removeClass('has-error');
},
errorElement: 'span',
errorClass: 'help-block',
errorPlacement: function(error, element) {
if(element.parent('.input-group').length) {
error.insertAfter(element.parent());
} else {
error.insertAfter(element);
}
}
});
});
</script>

View File

@@ -58,7 +58,7 @@
</a>
</td>
<td>
<span class="">{(int)$product['quantity']}</span>
{if $product['allow_multiple_quantity']}<span class="">{(int)$product['quantity']}</span>{else}--{/if}
</td>
<td class="unit_price_tax_excl">
<p>{displayPrice price=$product.total_price_tax_excl currency=$currency->id}</p>

View File

@@ -58,7 +58,7 @@
</a>
</td>
<td>
<span class="">{(int)$product['quantity']}</span>
{if $product['allow_multiple_quantity']}<span class="">{(int)$product['quantity']}</span>{else}--{/if}
</td>
<td class="unit_price_tax_excl">
<p>{displayPrice price=$product.total_price_tax_excl currency=$currency->id}</p>

View File

@@ -635,7 +635,10 @@
'width': '90%',
'height': '90%',
'afterClose' : function () {
searchCustomers();
let customer = $('#customer').val();
if (customer != '' && customer.length > 3) {
searchCustomers();
}
}
});
/*$("#new_address").fancybox({
@@ -885,9 +888,11 @@
});
}
let customerSearchAjax = '';
function searchCustomers()
{
$.ajax({
abortRunningAjax(customerSearchAjax);
customerSearchAjax = $.ajax({
type:"POST",
url : "{$link->getAdminLink('AdminCustomers')}",
async: true,
@@ -927,6 +932,12 @@
});
}
function abortRunningAjax(ajaxVar) {
if (ajaxVar) {
ajaxVar.abort();
}
}
function setupCustomer(idCustomer)
{
//$('#carts').show();// by webkul
@@ -1740,6 +1751,7 @@
$('#room_type_services_desc').show();
$('#add_new_room_services_block').hide();
$('#back_to_service_btn').hide();
$('#btn_new_room_service').show();
});
// Add new custom service: Show hide new custom service form
@@ -1747,6 +1759,7 @@
$('#add_new_room_services_block').show();
$('#back_to_service_btn').show();
$('#room_type_services_desc').hide();
$('#btn_new_room_service').hide();
});
// Add new custom service: change auto added option

View File

@@ -749,7 +749,12 @@
<thead>
<tr>
<th>{l s='Request ID'}</th>
<th>{l s='Total Rooms'}</th>
{if isset($refundReqBookings) && $refundReqBookings}
<th>{l s='Total Rooms'}</th>
{/if}
{if isset($refundReqProducts) && $refundReqProducts}
<th>{l s='Total Products'}</th>
{/if}
<th>{l s='Requested Date'}</th>
<th>{l s='Status'}</th>
</tr>
@@ -760,9 +765,12 @@
<td>
<a href="{$link->getAdminLink('AdminOrderRefundRequests')}&vieworder_return&id_order_return={$return_info.id_order_return}" target="_blank">#{$return_info.id_order_return}</a>
</td>
<td>
{$return_info.total_rooms|escape:'html':'UTF-8'}
</td>
{if isset($refundReqBookings) && $refundReqBookings}
<td>{$return_info.total_rooms}</td>
{/if}
{if isset($refundReqProducts) && $refundReqProducts}
<td>{$return_info.total_products}</td>
{/if}
<td>
{$return_info.date_add}
</td>

View File

@@ -83,7 +83,7 @@
<input type="checkbox" name="id_service_product_order_detail[]" value="{$product.id_service_product_order_detail|escape:'html':'UTF-8'}"/>
</td>
<td><b>{$product.name|escape:'html':'UTF-8'}{if $product.option_name} : {$product.option_name|escape:'html':'UTF-8'}{/if}</b></td>
<td>{$product.quantity|escape:'html':'UTF-8'}</td>
<td>{if $product.allow_multiple_quantity}{$product.quantity|escape:'html':'UTF-8'}{else}--{/if}</td>
<td>{convertPriceWithCurrency price=$product.total_price_tax_incl currency=$currency->id}</td>
</tr>
{/foreach}

View File

@@ -78,13 +78,10 @@
<div class="input-group">
<span class="input-group-addon">{$currencySign}</span>
<input type="text" class="form-control unit_price" value="{Tools::ps_round($service['unit_price_tax_excl'], 2)}" data-id-product="{$service['id_product']}" name="service_price[{$service['id_service_product_order_detail']}]">
{if Product::PRICE_CALCULATION_METHOD_PER_DAY == $service.product_price_calculation_method}
{if Product::PRICE_CALCULATION_METHOD_PER_DAY == $service.price_calculation_method}
<span class="input-group-addon">{l s='/ night'}</span>
{/if}
</div>
{* {if $service['product_price_calculation_method'] == Product::PRICE_CALCULATION_METHOD_PER_DAY}
{l s='/ night'}
{/if} *}
</td>
<td>{displayPrice price=$service['total_price_tax_excl']|escape:'html':'UTF-8' currency=$orderCurrency}</td>
<td class="text-right"><a class="btn btn-danger pull-right del_room_additional_service" data-id_service_product_order_detail="{$service['id_service_product_order_detail']}" href="#"><i class="icon-trash"></i></a></td>
@@ -150,7 +147,7 @@
<div class="input-group">
<span class="input-group-addon">{$currencySign}</span>
<input type="text" class="form-control unit_price" name="service_price[{$product['id_product']|escape:'html':'UTF-8'}]" value="{$product['price_tax_exc']}" data-id-product="{$product.id_product}">
{if Product::PRICE_CALCULATION_METHOD_PER_DAY == $product['product_price_calculation_method']}
{if Product::PRICE_CALCULATION_METHOD_PER_DAY == $product['price_calculation_method']}
<span class="input-group-addon">{l s='/ night'}</span>
{/if}
</div>
@@ -274,7 +271,7 @@
</td>
<td>
{displayPrice price=$service['unit_price_tax_excl'] currency=$orderCurrency}
{if $service['product_price_calculation_method'] == Product::PRICE_CALCULATION_METHOD_PER_DAY}
{if $service['price_calculation_method'] == Product::PRICE_CALCULATION_METHOD_PER_DAY}
{l s='/ night'}
{/if}
</td>

View File

@@ -17,7 +17,7 @@
* @license LICENSE.txt
*}
{l s='This room already has a booking for the selected date range.'}
{sprintf({l s='The room "%s" already has a booking for the selected date range.'}, $orderDetails->room_num)}
<div class="row">
<div class="col-xs-12">
<span class="error_message_label">{l s='Order ID'}:</span> <a href="{$link->getAdminLink('AdminOrders')}&id_order={$orderDetails->id_order}&vieworder" target="_blank"><strong>#{$orderDetails->id_order|intval}</strong></a>

View File

@@ -1238,6 +1238,7 @@
};
$('#page-loader').show();
$('[name="submitBulkCreateRooms"]').attr('disabled', 'disable');
$.ajax({
url: prod_link,
type: 'POST',
@@ -1253,6 +1254,7 @@
},
complete: function() {
$('#page-loader').hide();
$('[name="submitBulkCreateRooms"]').attr('disabled', false);
}
});
},

View File

@@ -1034,7 +1034,7 @@ class CartCore extends ObjectModel
$shop = Context::getContext()->shop;
}
if (Context::getContext()->customer->id) {
if (!empty(Context::getContext()->customer->id)) {
if ($id_address_delivery == 0 && (int)$this->id_address_delivery) { // The $id_address_delivery is null, use the cart delivery address
$id_address_delivery = $this->id_address_delivery;
} elseif (!Customer::customerHasAddress(Context::getContext()->customer->id, $id_address_delivery)) { // The $id_address_delivery must be linked with customer
@@ -2432,7 +2432,7 @@ class CartCore extends ObjectModel
$array[$selectedProduct['id_room_type_hotel']]['total_price_tax_incl'] += $selectedProduct['total_price_tax_incl'];
} else {
$array[$selectedProduct['id_room_type_hotel']] = array(
'quantity' => 0,
'quantity' => $selectedProduct['quantity'],
'id_hotel' => $selectedProduct['id_room_type_hotel'],
'total_price_tax_excl' => $selectedProduct['total_price_tax_excl'],
'total_price_tax_incl' => $selectedProduct['total_price_tax_incl'],
@@ -2452,35 +2452,37 @@ class CartCore extends ObjectModel
}
}
foreach($array as $selectedProduct) {
$product['cart_quantity'] = $selectedProduct['quantity'];
$product['total'] = $selectedProduct['total_price_tax_excl'];
$product['total_wt'] = $selectedProduct['total_price_tax_incl'];
$product['price_wt'] = $selectedProduct['total_price_tax_incl'] / $selectedProduct['quantity'];
$product['price'] = $selectedProduct['total_price_tax_excl'] / $selectedProduct['quantity'];
$product['id_hotel'] = $selectedProduct['id_hotel'];
$product['id_room_type'] = $selectedProduct['id_room_type'];
$product['id_hotel_cart_booking'] = $selectedProduct['id_hotel_cart_booking'];
$productinfo = $product;
$productinfo['selling_preference_type'] = Product::SELLING_PREFERENCE_WITH_ROOM_TYPE;
$orderPackage[$id_address][$selectedProduct['id_hotel']]['product_list'][] = $productinfo;
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['id_hotel'])) {
$orderPackage[$id_address][$selectedProduct['id_hotel']]['id_hotel'] = $selectedProduct['id_hotel'];
}
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['carrier_list'])) {
$orderPackage[$id_address][$selectedProduct['id_hotel']]['carrier_list'] = $product['carrier_list'];
} else {
$orderPackage[$id_address][$selectedProduct['id_hotel']]['carrier_list'] = array_intersect($orderPackage[$id_address][$selectedProduct['id_hotel']]['carrier_list'], $product['carrier_list']);
}
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['warehouse_list'])) {
$orderPackage[$id_address][$selectedProduct['id_hotel']]['warehouse_list'] = $package['warehouse_list'];
}
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['id_warehouse'])) {
$orderPackage[$id_address][$selectedProduct['id_hotel']]['id_warehouse'] = $package['id_warehouse'];
}
if (isset($package['id_carrier'])) {
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['id_carrier'])) {
$orderPackage[$id_address][$selectedProduct['id_hotel']]['id_carrier'] = $package['id_carrier'];
if ($array) {
foreach($array as $selectedProduct) {
$product['cart_quantity'] = $selectedProduct['quantity'];
$product['total'] = $selectedProduct['total_price_tax_excl'];
$product['total_wt'] = $selectedProduct['total_price_tax_incl'];
$product['price_wt'] = $selectedProduct['total_price_tax_incl'] / $selectedProduct['quantity'];
$product['price'] = $selectedProduct['total_price_tax_excl'] / $selectedProduct['quantity'];
$product['id_hotel'] = $selectedProduct['id_hotel'];
$product['id_room_type'] = $selectedProduct['id_room_type'];
$product['id_hotel_cart_booking'] = $selectedProduct['id_hotel_cart_booking'];
$productinfo = $product;
$productinfo['selling_preference_type'] = Product::SELLING_PREFERENCE_WITH_ROOM_TYPE;
$orderPackage[$id_address][$selectedProduct['id_hotel']]['product_list'][] = $productinfo;
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['id_hotel'])) {
$orderPackage[$id_address][$selectedProduct['id_hotel']]['id_hotel'] = $selectedProduct['id_hotel'];
}
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['carrier_list'])) {
$orderPackage[$id_address][$selectedProduct['id_hotel']]['carrier_list'] = $product['carrier_list'];
} else {
$orderPackage[$id_address][$selectedProduct['id_hotel']]['carrier_list'] = array_intersect($orderPackage[$id_address][$selectedProduct['id_hotel']]['carrier_list'], $product['carrier_list']);
}
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['warehouse_list'])) {
$orderPackage[$id_address][$selectedProduct['id_hotel']]['warehouse_list'] = $package['warehouse_list'];
}
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['id_warehouse'])) {
$orderPackage[$id_address][$selectedProduct['id_hotel']]['id_warehouse'] = $package['id_warehouse'];
}
if (isset($package['id_carrier'])) {
if (!isset($orderPackage[$id_address][$selectedProduct['id_hotel']]['id_carrier'])) {
$orderPackage[$id_address][$selectedProduct['id_hotel']]['id_carrier'] = $package['id_carrier'];
}
}
}
}
@@ -2528,38 +2530,41 @@ class CartCore extends ObjectModel
);
}
}
foreach($array as $hotelProduct) {
$serviceProduct = $product;
$serviceProduct['cart_quantity'] = $hotelProduct['quantity'];
$serviceProduct['id_hotel'] = $hotelProduct['id_hotel'];
$serviceProduct['total'] = $hotelProduct['total_price_tax_excl'];
$serviceProduct['total_wt'] = $hotelProduct['total_price_tax_incl'];
$serviceProduct['price'] = $hotelProduct['total_price_tax_excl'] / $hotelProduct['quantity'];
$serviceProduct['price_wt'] = $hotelProduct['total_price_tax_incl'] / $hotelProduct['quantity'];
$serviceProduct['id_room_type'] = $hotelProduct['id_room_type'];
$serviceProduct['id_hotel_cart_booking'] = $hotelProduct['id_hotel_cart_booking'];
// if (!empty($hotelProducts['products'])) {
// foreach($hotelProducts['products'] as $hotelProduct) {
$productinfo = $serviceProduct;
$productinfo['selling_preference_type'] = Product::SELLING_PREFERENCE_HOTEL_STANDALONE;
$orderPackage[$id_address][$hotelProduct['id_hotel']]['product_list'][] = $productinfo;
if (!isset($orderPackage[$id_address][$hotelProduct['id_hotel']]['id_hotel'])) {
$orderPackage[$id_address][$hotelProduct['id_hotel']]['id_hotel'] = $hotelProduct['id_hotel'];
}
if (!isset($orderPackage[$id_address][$hotelProduct['id_hotel']]['carrier_list'])) {
$orderPackage[$id_address][$hotelProduct['id_hotel']]['carrier_list'] = $product['carrier_list'];
} else {
$orderPackage[$id_address][$hotelProduct['id_hotel']]['carrier_list'] = array_intersect($orderPackage[$id_address][$hotelProduct['id_hotel']]['carrier_list'], $product['carrier_list']);
}
if (!isset($orderPackage[$id_address][$hotelProduct['id_hotel']]['warehouse_list'])) {
$orderPackage[$id_address][$hotelProduct['id_hotel']]['warehouse_list'] = $package['warehouse_list'];
}
if (!isset($orderPackage[$id_address][$hotelProduct['id_hotel']]['id_warehouse'])) {
$orderPackage[$id_address][$hotelProduct['id_hotel']]['id_warehouse'] = $package['id_warehouse'];
}
if (isset($package['id_carrier'])) {
if (!isset($orderPackage[$id_address][$hotelProduct['id_hotel']]['id_carrier'])) {
$orderPackage[$id_address][$hotelProduct['id_hotel']]['id_carrier'] = $package['id_carrier'];
if ($array) {
foreach($array as $hotelProduct) {
$serviceProduct = $product;
$serviceProduct['cart_quantity'] = $hotelProduct['quantity'];
$serviceProduct['id_hotel'] = $hotelProduct['id_hotel'];
$serviceProduct['total'] = $hotelProduct['total_price_tax_excl'];
$serviceProduct['total_wt'] = $hotelProduct['total_price_tax_incl'];
$serviceProduct['price'] = $hotelProduct['total_price_tax_excl'] / $hotelProduct['quantity'];
$serviceProduct['price_wt'] = $hotelProduct['total_price_tax_incl'] / $hotelProduct['quantity'];
$serviceProduct['id_room_type'] = $hotelProduct['id_room_type'];
$serviceProduct['id_hotel_cart_booking'] = $hotelProduct['id_hotel_cart_booking'];
// if (!empty($hotelProducts['products'])) {
// foreach($hotelProducts['products'] as $hotelProduct) {
$productinfo = $serviceProduct;
$productinfo['selling_preference_type'] = Product::SELLING_PREFERENCE_HOTEL_STANDALONE;
$orderPackage[$id_address][$hotelProduct['id_hotel']]['product_list'][] = $productinfo;
if (!isset($orderPackage[$id_address][$hotelProduct['id_hotel']]['id_hotel'])) {
$orderPackage[$id_address][$hotelProduct['id_hotel']]['id_hotel'] = $hotelProduct['id_hotel'];
}
if (!isset($orderPackage[$id_address][$hotelProduct['id_hotel']]['carrier_list'])) {
$orderPackage[$id_address][$hotelProduct['id_hotel']]['carrier_list'] = $product['carrier_list'];
} else {
$orderPackage[$id_address][$hotelProduct['id_hotel']]['carrier_list'] = array_intersect($orderPackage[$id_address][$hotelProduct['id_hotel']]['carrier_list'], $product['carrier_list']);
}
if (!isset($orderPackage[$id_address][$hotelProduct['id_hotel']]['warehouse_list'])) {
$orderPackage[$id_address][$hotelProduct['id_hotel']]['warehouse_list'] = $package['warehouse_list'];
}
if (!isset($orderPackage[$id_address][$hotelProduct['id_hotel']]['id_warehouse'])) {
$orderPackage[$id_address][$hotelProduct['id_hotel']]['id_warehouse'] = $package['id_warehouse'];
}
if (isset($package['id_carrier'])) {
if (!isset($orderPackage[$id_address][$hotelProduct['id_hotel']]['id_carrier'])) {
$orderPackage[$id_address][$hotelProduct['id_hotel']]['id_carrier'] = $package['id_carrier'];
}
}
}
}

View File

@@ -652,7 +652,7 @@ class DispatcherCore
if (!isset($this->routes[$id_shop][$id_lang][$route_id])) {
$query = http_build_query($params, '', '&');
$index_link = $this->use_routes ? '' : 'index.php';
return ($route_id == 'index') ? $index_link.(($query) ? '?'.$query : '') : ((trim($route_id) == '') ? '' : 'index.php?controller='.$route_id).(($query) ? '&'.$query : '').$anchor;
return ($route_id == 'index') ? $index_link.(($query) ? '?'.$query : '') : ((!is_null($route_id) ? (trim($route_id) == '') : 1) ? '' : 'index.php?controller='.$route_id).(($query) ? '&'.$query : '').$anchor;
}
$route = $this->routes[$id_shop][$id_lang][$route_id];
// Check required fields

View File

@@ -171,19 +171,22 @@ class ImageCore extends ObjectModel
* @param int $id_product_attribute Product Attribute ID
* @return array Images
*/
public static function getImages($id_lang, $id_product, $id_product_attribute = null)
public static function getImages($id_lang, $id_product, $id_product_attribute = null, $bookingProduct = null)
{
$attribute_filter = ($id_product_attribute ? ' AND ai.`id_product_attribute` = '.(int)$id_product_attribute : '');
$sql = 'SELECT *
FROM `'._DB_PREFIX_.'image` i
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image`)';
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image`)
LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = i.`id_product`)';
if ($id_product_attribute) {
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` ai ON (i.`id_image` = ai.`id_image`)';
}
$sql .= ' WHERE i.`id_product` = '.(int)$id_product.' AND il.`id_lang` = '.(int)$id_lang.$attribute_filter.'
'.(!is_null($bookingProduct) ? ' AND p.`booking_product`='.(int) $bookingProduct : '').'
ORDER BY i.`position` ASC';
return Db::getInstance()->executeS($sql);
}
@@ -215,12 +218,14 @@ class ImageCore extends ObjectModel
*
* @return array Images
*/
public static function getAllImages()
public static function getAllImages($bookingProduct = null)
{
return Db::getInstance()->executeS('
SELECT `id_image`, `id_product`
FROM `'._DB_PREFIX_.'image`
ORDER BY `id_image` ASC');
SELECT img.`id_image`, img.`id_product` FROM `'._DB_PREFIX_.'image` img
LEFT JOIN `'._DB_PREFIX_.'product` p ON p.`id_product` = img.`id_product`
WHERE 1 '.(!is_null($bookingProduct) ? ' AND p.`booking_product`='.(int) $bookingProduct : '').'
ORDER BY `id_image` ASC'
);
}
/**

View File

@@ -621,7 +621,7 @@ abstract class PaymentModuleCore extends Module
$product_list_txt = '';
$product_list_html = '';
if (count($product_var_tpl_list) > 0) {
$product_list_txt = $this->getEmailTemplateContent('order_conf_product_list.txt', Mail::TYPE_TEXT, $product_var_tpl_list);
$product_list_txt = $this->getEmailTemplateContent('order_conf_product_list_text.tpl', Mail::TYPE_TEXT, $product_var_tpl_list);
$product_list_html = $this->getEmailTemplateContent('order_conf_product_list.tpl', Mail::TYPE_HTML, $product_var_tpl_list);
}
@@ -698,7 +698,7 @@ abstract class PaymentModuleCore extends Module
$cart_rules_list_txt = '';
$cart_rules_list_html = '';
if (count($cart_rules_list) > 0) {
$cart_rules_list_txt = $this->getEmailTemplateContent('order_conf_cart_rules.txt', Mail::TYPE_TEXT, $cart_rules_list);
$cart_rules_list_txt = $this->getEmailTemplateContent('order_conf_cart_rules_text.tpl', Mail::TYPE_TEXT, $cart_rules_list);
$cart_rules_list_html = $this->getEmailTemplateContent('order_conf_cart_rules.tpl', Mail::TYPE_HTML, $cart_rules_list);
}
@@ -1342,6 +1342,7 @@ abstract class PaymentModuleCore extends Module
'{products_txt}' => $product_list_txt,
'{discounts}' => $cart_rules_list_html,
'{discounts_txt}' => $cart_rules_list_txt,
'{total_paid}' => Tools::displayPrice($order->total_paid, $this->context->currency, false),
'{total_products}' => Tools::displayPrice($total_products, $this->context->currency, false),
'{total_discounts}' => Tools::displayPrice(-$order->total_discounts, $this->context->currency, false),
'{total_shipping}' => Tools::displayPrice($order->total_shipping, $this->context->currency, false),

View File

@@ -326,9 +326,10 @@ class OrderReturnCore extends ObjectModel
*/
public function getOrderRefundRequestedProducts($idOrder, $idOrderReturn = 0, $onlyIds = 0, $skipReqCompletedNonRefunded = 0)
{
$sql = 'SELECT spod.*, ord.*, orr.`state` as id_return_state FROM `'._DB_PREFIX_.'order_return` orr';
$sql = 'SELECT spod.*, ord.*, orr.`state` as id_return_state, p.`allow_multiple_quantity` FROM `'._DB_PREFIX_.'order_return` orr';
$sql .= ' INNER JOIN `'._DB_PREFIX_.'order_return_detail` ord ON (orr.`id_order_return` = ord.`id_order_return`)';
$sql .= ' INNER JOIN `'._DB_PREFIX_.'service_product_order_detail` spod ON (spod.`id_service_product_order_detail` = ord.`id_service_product_order_detail`)';
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = spod.`id_product`)';
$sql .= ' WHERE orr.`id_order` = '.(int)$idOrder;
if ($idOrderReturn) {
@@ -368,7 +369,7 @@ class OrderReturnCore extends ObjectModel
}
$sql = 'SELECT orr.`id_order`, orr.`state`, orr.`id_order_return`, orr.`payment_mode`, orr.`id_transaction`,
orr.`id_return_type`, orr.`return_type`, ors.`id_cart_rule`, orr.`date_add`, orr.`date_upd`, orr.`refunded_amount`,
hbd.`is_cancelled`, SUM(IF(ord.`id_htl_booking`, 1, 0)) AS total_rooms
hbd.`is_cancelled`, SUM(IF(ord.`id_htl_booking`, 1, 0)) AS total_rooms, SUM(IF(ord.`id_service_product_order_detail`, 1, 0)) AS total_products
FROM `'._DB_PREFIX_.'order_return` orr
LEFT JOIN `'._DB_PREFIX_.'order_return_detail` ord
ON (ord.`id_order_return` = orr.`id_order_return`)

View File

@@ -318,25 +318,31 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
if (Module::isInstalled('hotelreservationsystem')) {
$obj_htl_bk_dtl = new HotelBookingDetail();
$objServiceProductOrderDetail = new ServiceProductOrderDetail();
$objHotelBranchInfo = new HotelBranchInformation((int) HotelBookingDetail::getIdHotelByIdOrder($order_obj->id), $context->language->id);
$invoiceAddressPatternRules['avoid'][] = 'lastname';
if ($idHotelAddress = $objHotelBranchInfo->getHotelIdAddress()) {
$objHotelAddress = new Address((int) $idHotelAddress);
$objHotelAddress->firstname = $objHotelBranchInfo->hotel_name;
$formattedHotelAddress = AddressFormat::generateAddress($objHotelAddress, $invoiceAddressPatternRules, '<br />', ' ');
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($order_obj->id)) {
$objHotelBranchInfo = new HotelBranchInformation((int) $idHotel, $context->language->id);
$invoiceAddressPatternRules['avoid'][] = 'lastname';
if ($idHotelAddress = $objHotelBranchInfo->getHotelIdAddress()) {
$objHotelAddress = new Address((int) $idHotelAddress);
$objHotelAddress->firstname = $objHotelBranchInfo->hotel_name;
$formattedHotelAddress = AddressFormat::generateAddress($objHotelAddress, $invoiceAddressPatternRules, '<br />', ' ');
}
}
$customer = new Customer($this->order->id_customer);
$idCustomer = 0;
if (ValidateCore::isLoadedObject($customer = new Customer($this->order->id_customer))) {
$idCustomer = $customer->id;
}
if (!empty($order_details)) {
$processed_product = array();
$totalDemandsPriceTE = 0;
$totalDemandsPriceTI = 0;
foreach ($order_details as $type_key => $type_value) {
$processProuctKey = $type_value['product_id'].'_'.$type_value['selling_preference_type'].'_'.$type_value['id_order_detail'];
if (isset($processed_product[$processProuctKey])) {
$processProductKey = $type_value['product_id'].'_'.$type_value['selling_preference_type'].'_'.$type_value['id_order_detail'];
if (isset($processed_product[$processProductKey])) {
continue;
}
$processed_product[$processProuctKey] = $type_value['product_id'];
$processed_product[$processProductKey] = $type_value['product_id'];
if ($type_value['is_booking_product']) {
if ($display_product_images) {
@@ -352,14 +358,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$cart_htl_data[$type_key]['cover_img'] = $cover_img;
}
if ($type_value)
if (isset($customer->id)) {
$cart_obj = new Cart($this->order->id_cart);
$order_bk_data = $obj_htl_bk_dtl->getOnlyOrderBookingData($this->order->id, $cart_obj->id_guest, $type_value['product_id'], $customer->id);
} else {
$order_bk_data = $obj_htl_bk_dtl->getOnlyOrderBookingData($this->order->id, $customer->id_guest, $type_value['product_id'], 0);
}
$order_bk_data = $obj_htl_bk_dtl->getOnlyOrderBookingData($this->order->id, 0, $type_value['product_id'], $idCustomer, $type_value['id_order_detail']);
$cart_htl_data[$type_key]['id_product'] = $type_value['product_id'];
$objBookingDemand = new HotelBookingDemands();
foreach ($order_bk_data as $data_k => $data_v) {
@@ -580,10 +579,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
0,
$data_v['id']
)) {
$additionalServices['product_id'] = $type_value['product_id'];
$additionalServices['room_type_name'] = $type_value['product_name'];
$additionalServices['date_from'] = $data_v['date_from'];
$additionalServices['date_to'] = $data_v['date_to'];
$additionalServices[$data_v['id']]['product_id'] = $type_value['product_id'];
$room_additinal_services[] = $additionalServices[$data_v['id']];
}

View File

@@ -542,7 +542,7 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
return array(
array(
'adults' => isset($data['adult']) && $data['adult'] ? $data['adult'] : $roomTypeInfo['adults'],
'adults' => isset($data['adults']) ? $data['adults'] : $roomTypeInfo['adults'],
'children' => isset($data['child']) ? $data['child'] : $roomTypeInfo['children'],
'child_ages' => $child_ages
)
@@ -946,7 +946,9 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
$extraVars,
null,
false,
$this->bookingCustomer->secure_key
$this->bookingCustomer->secure_key,
null,
false
)) {
$this->updateServicesAndDemandsInOrder($objPaymentModule->currentOrder);
if (!empty($this->wsRequestedRooms)) {
@@ -1081,7 +1083,7 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
$objTaxManager = TaxManagerFactory::getManager($objAddress, $this->wsRequestedRooms[$dateRoomJoinKey]['id_tax_rules_group']);
$objTaxCalculator = $objTaxManager->getTaxCalculator();
$priceWithTax = $objTaxCalculator->addTaxes($objHotelBookingDetail->total_price_tax_excl);
} else if (isset($this->wsRequestedRooms[$dateRoomJoinKey]['total_tax'])) {
} else if (!empty($this->wsRequestedRooms[$dateRoomJoinKey]['total_tax'])) {
$priceWithTax = $objHotelBookingDetail->total_price_tax_excl + $this->wsRequestedRooms[$dateRoomJoinKey]['total_tax'];
}
@@ -1216,9 +1218,7 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
$objOrder->total_paid_tax_incl += $priceDiffTaxIncl;
$objOrder->total_paid += $priceDiffTaxIncl;
} else if (isset($this->wsRequestedRoomTypes[$dateRoomJoinKey]['services'][$service['id_product']]['total_tax'])
&& $this->wsRequestedRoomTypes[$dateRoomJoinKey]['services'][$service['id_product']]['total_tax']
) {
} else if (!empty($this->wsRequestedRoomTypes[$dateRoomJoinKey]['services'][$service['id_product']]['total_tax'])) {
$oldPriceTaxIncl = $objServiceProductOrderDetail->total_price_tax_incl;
$objServiceProductOrderDetail->total_price_tax_incl = $objServiceProductOrderDetail->total_price_tax_excl + $this->wsRequestedRoomTypes[$dateRoomJoinKey]['services'][$service['id_product']]['total_tax'];
@@ -1697,7 +1697,7 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
$this->wsRequestedRoomTypes[$dateRoomJoinKey]['room'] = $room;
if (isset($room['id_tax_rules_group']) && Validate::isLoadedObject(new TaxRulesGroup((int) $room['id_tax_rules_group']))) {
$this->wsRequestedRooms[$dateRoomJoinKey]['id_tax_rules_group'] = $room['id_tax_rules_group'];
} else if (isset($room['total_tax'])) {
} else if (!empty($room['total_tax'])) {
$this->wsRequestedRooms[$dateRoomJoinKey]['total_tax'] = $room['total_tax'];
}
@@ -1946,13 +1946,13 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
if (isset($room['id_tax_rules_group']) && Validate::isLoadedObject(new TaxRulesGroup((int) $room['id_tax_rules_group']))) {
$this->wsRequestedRooms[$dateRoomJoinKey]['id_tax_rules_group'] = $room['id_tax_rules_group'];
} else if (isset($room['total_tax'])) {
} else if (!empty($room['total_tax'])) {
$this->wsRequestedRooms[$dateRoomJoinKey]['total_tax'] = $room['total_tax'];
}
$numDays = HotelHelper::getNumberOfDays($dateFrom, $dateTo);
if (isset($room['unit_price_without_tax'])
&& ((float) $room['unit_price_without_tax']) != ((float) $roomsByDate['order'][$roomsKey]['total_price_tax_incl']/$numDays)
&& ((float) $room['unit_price_without_tax']) != ((float) $roomsByDate['order'][$roomsKey]['total_price_tax_excl']/$numDays)
) {
$this->updateRoomPriceInOrder($room, $roomsByDate['order'][$roomsKey]);
$this->wsRequestedRoomTypes[$dateRoomJoinKey]['room'] = $room;
@@ -2314,7 +2314,7 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
$unitPriceTaxIncl = Tools::ps_round($unitPriceTaxIncl, _PS_PRICE_COMPUTE_PRECISION_);
$totalPriceTaxIncl = Tools::ps_round(($unitPriceTaxIncl * $quantity), _PS_PRICE_COMPUTE_PRECISION_);
} else if (isset($this->wsRequestedRoomTypes[$dateRoomJoinKey]['services'][$service['id_product']]['total_tax'])) {
} else if (!empty($this->wsRequestedRoomTypes[$dateRoomJoinKey]['services'][$service['id_product']]['total_tax'])) {
$totalPriceTaxIncl = $totalPriceTaxExcl + $this->wsRequestedRoomTypes[$dateRoomJoinKey]['services'][$service['id_product']]['total_tax'];
$totalPriceTaxIncl = Tools::ps_round(($totalPriceTaxIncl), _PS_PRICE_COMPUTE_PRECISION_);
@@ -2876,7 +2876,7 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
if (isset($room['id_tax_rules_group']) && !Validate::isLoadedObject(new TaxRulesGroup((int) $room['id_tax_rules_group']))) {
$this->error_msg = Tools::displayError('Invalid id_tax_rules_group.');
return false;
} else if (isset($room['total_tax']) && !Validate::isPrice($room['total_tax'])) {
} else if (!empty($room['total_tax']) && !Validate::isPrice($room['total_tax'])) {
$this->error_msg = Tools::displayError('Invalid total tax.');
return false;
}
@@ -3243,7 +3243,7 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
$unitPriceTaxIncl = Tools::ps_round($unitPriceTaxIncl, _PS_PRICE_COMPUTE_PRECISION_);
$totalPriceTaxIncl = Tools::ps_round(($unitPriceTaxIncl * $quantity), _PS_PRICE_COMPUTE_PRECISION_);
} else if (isset($services[$product['id_product']]['total_tax'])) {
} else if (!empty($services[$product['id_product']]['total_tax'])) {
$totalPriceTaxIncl = $totalPriceTaxExcl + $services[$product['id_product']]['total_tax'];
$totalPriceTaxIncl = Tools::ps_round(($totalPriceTaxIncl), _PS_PRICE_COMPUTE_PRECISION_);

View File

@@ -51,7 +51,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
'room_types' => array(),
'hotels' => array(),
'categories' => array(),
'extra_service' => array(),
'services' => array(),
// 'manufacturers' => array(),
// 'suppliers' => array(),
// 'stores' => array(),
@@ -288,7 +288,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
$this->imageType = $this->wsObject->urlSegment[1];
// if image type requested is room_types then process products images
if ($this->imageType == 'room_types'
|| $this->imageType == 'extra_services'
|| $this->imageType == 'services'
) {
$this->imageType = 'products';
}
@@ -305,7 +305,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
case 'stores':
case 'features':
case 'hotels':
case 'extra_services':
case 'services':
case 'room_types':
switch ($this->wsObject->urlSegment[1]) {
case 'categories':
@@ -326,7 +326,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
case 'room_types':
$directory = _PS_PROD_IMG_DIR_;
break;
case 'extra_services':
case 'services':
$directory = _PS_PROD_IMG_DIR_;
break;
case 'hotels':
@@ -511,14 +511,20 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
if ($this->imageType == 'products') {
$ids = array();
$images = Image::getAllImages();
if ($this->wsObject->urlSegment[1] == 'services') {
$resourceType = 'services';
$images = Image::getAllImages(0);
} else {
$resourceType = 'room_types';
$images = Image::getAllImages(1);
}
foreach ($images as $image) {
$ids[] = $image['id_product'];
}
$ids = array_unique($ids, SORT_NUMERIC);
asort($ids);
foreach ($ids as $id) {
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('image', array(), array('id' => $id, 'xlink_resource'=>$this->wsObject->wsUrl.'images/'.'room_types'.'/'.$id), false);
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('image', array(), array('id' => $id, 'xlink_resource'=>$this->wsObject->wsUrl.'images/'.$resourceType.'/'.$id), false);
}
} else if ($this->imageType == 'hotels') {
$ids = array();
@@ -567,10 +573,17 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
if ($this->imageType == 'products') {
// Get available image ids
$available_image_ids = array();
if ($this->wsObject->urlSegment[1] == 'services') {
$resourceType = 'services';
$bookingProduct = 0;
} else {
$bookingProduct = 1;
$resourceType = 'room_types';
}
// New Behavior
foreach (Language::getIDs() as $id_lang) {
foreach (Image::getImages($id_lang, $object_id) as $image) {
foreach (Image::getImages($id_lang, $object_id, null, $bookingProduct) as $image) {
$available_image_ids[] = $image['id_image'];
}
}
@@ -607,7 +620,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
if ($available_image_ids) {
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('image', array(), array('id'=>$object_id));
foreach ($available_image_ids as $available_image_id) {
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('declination', array(), array('id'=>$available_image_id, 'xlink_resource'=>$this->wsObject->wsUrl.'images/'.'room_types'.'/'.$object_id.'/'.$available_image_id), false);
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('declination', array(), array('id'=>$available_image_id, 'xlink_resource'=>$this->wsObject->wsUrl.'images/'.$resourceType.'/'.$object_id.'/'.$available_image_id), false);
}
$this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('image', array());
} else {

View File

@@ -385,7 +385,7 @@ class AdminAddressesControllerCore extends AdminController
{
$this->fields_list = array_merge($this->fields_list, array(
'email' => array('title' => $this->l('Customer Email')),
'phone' => array('title' => $this->l('Phone')),
'phone' => array('title' => $this->l('Phone'), 'filter_key' => 'a!phone'),
'phone_mobile' => array('title' => $this->l('Mobile phone')),
'address1' => array('title' => $this->l('Address (2)')),
'dni' => array('title' => $this->l('Identification Number')),

View File

@@ -935,7 +935,8 @@ class AdminCartsControllerCore extends AdminController
'id_cart' => $id_cart,
'order_message' => $message_content,
'link_order' => $this->context->link->getPageLink(
'order', false,
'order',
null,
(int)$this->context->cart->id_lang,
'step=3&recover_cart='.$id_cart.'&token_cart='.md5(_COOKIE_KEY_.'recover_cart_'.$id_cart)
),
@@ -1320,7 +1321,7 @@ class AdminCartsControllerCore extends AdminController
$idHotelCartBooking = Tools::getValue('id_hotel_cart_booking');
// valiadate services being added
if (Validate::isLoadedObject($objHtlCartBooking = new HotelCartBookingData($idHotelCartBooking))) {
$name = Tools::getValue('new_service_name');
$name = trim(Tools::getValue('new_service_name'));
$price = Tools::getValue('new_service_price');
$priceCalcMethod = Tools::getValue('new_service_price_calc_method');
$priceAdditionType = Tools::getValue('new_service_price_addition_type');
@@ -1541,6 +1542,10 @@ class AdminCartsControllerCore extends AdminController
// Validate selected services
foreach ($selectedServiceProducts as $idServiceProduct => $selected) {
if (Validate::isLoadedObject($objProduct = new Product($idServiceProduct, false, $objCart->id_lang))) {
if (!$objProduct->allow_multiple_quantity) {
$serviceQuantities[$idServiceProduct] = 1;
}
if ($objProduct->allow_multiple_quantity) {
if (!isset($serviceQuantities[$idServiceProduct])) {
$response['hasError'] = true;
@@ -1554,10 +1559,6 @@ class AdminCartsControllerCore extends AdminController
$response['errors'][] = Tools::displayError('Can not order multiple quanitity for service').': '.$objProduct->name;
}
if (!$objProduct->allow_multiple_quantity) {
$serviceQuantities[$idServiceProduct] = 1;
}
if (!isset($serviceUnitPrices[$idServiceProduct])
|| !ValidateCore::isPrice($serviceUnitPrices[$idServiceProduct])
) {

View File

@@ -860,7 +860,12 @@ class AdminCustomerThreadsControllerCore extends AdminController
$product = new Product((int)$mess['id_product'], false, $this->context->language->id);
if (Validate::isLoadedObject($product)) {
$messages[$key]['product_name'] = $product->name;
$messages[$key]['product_link'] = $this->context->link->getAdminLink('AdminProducts').'&updateproduct&id_product='.(int)$product->id;
$messages[$key]['booking_product'] = $product->booking_product;
if ($product->booking_product) {
$messages[$key]['product_link'] = $this->context->link->getAdminLink('AdminProducts').'&updateproduct&id_product='.(int)$product->id;
} else {
$messages[$key]['product_link'] = $this->context->link->getAdminLink('AdminNormalProducts').'&updateproduct&id_product='.(int)$product->id;
}
}
}
}
@@ -981,8 +986,6 @@ class AdminCustomerThreadsControllerCore extends AdminController
$timeline = array();
foreach ($messages as $message) {
$product = new Product((int)$message['id_product'], false, $this->context->language->id);
$link_product = $this->context->link->getAdminLink('AdminOrders').'&vieworder&id_order='.(int)$product->id;
$content = '';
if (!$message['private']) {
$customerName = false;
@@ -1000,7 +1003,13 @@ class AdminCustomerThreadsControllerCore extends AdminController
}
if (Validate::isLoadedObject($product)) {
$content .= $this->l('Room type: ').'<span class="label label-info">'.$product->name.'</span><br/><br/>';
if ($product->booking_product) {
$content .= $this->l('Room type:');
} else {
$content .= $this->l('Product:');
}
$content .= ' <span class="label label-info">'.$product->name.'</span><br/><br/>';
}
$content .= Tools::safeOutput($message['message']);

View File

@@ -145,6 +145,7 @@ class AdminImportControllerCore extends AdminController
'id_state' => array('label' => $this->l('State ID')),
'city' => array('label' => $this->l('City *')),
'postcode' => array('label' => $this->l('Zip Code *')),
'fax' => array('label' => $this->l('Fax')),
'policies' => array('label' => $this->l('Hotel Policies')),
'active_refund' => array('label' => $this->l('Allow Refund (0 = No, 1 = Yes)')),
'refund_ids' => array('label' => $this->l('Refund IDs (x,y,z...)')),
@@ -1200,6 +1201,11 @@ class AdminImportControllerCore extends AdminController
$this->l('Zip code is invalid for (ID: %1$s)'),
(isset($info['id']) && !empty($info['id']))? $info['id'] : 'null'
);
} else if (isset($info['fax']) && !Validate::isGenericName($info['fax'])) {
$this->errors[] = sprintf(
$this->l('Fax is invalid for (ID: %1$s)'),
(isset($info['id']) && !empty($info['id']))? $info['id'] : 'null'
);
} else if ($objCountry->active) {
if ($objCountry->contains_states) {
if (!isset($info['id_state'])
@@ -1254,6 +1260,7 @@ class AdminImportControllerCore extends AdminController
$objAddress->id_state = $info['id_state'];
$objAddress->city = $info['city'];
$objAddress->postcode = $info['postcode'];
$objHotelBranch->fax = $info['fax'];
$hotelName = $objHotelBranch->hotel_name[$idLangDefault];
$objAddress->alias = $hotelName;
$hotelName = trim(preg_replace('/[0-9!<>,;?=+()@#"°{}_$%:]*$/u', '', $hotelName));
@@ -1438,16 +1445,18 @@ class AdminImportControllerCore extends AdminController
$objHotelOrderRestrictDate->use_global_min_booking_offset = true;
if (isset($info['max_checkout_offset'])
&& (Configuration::get('PS_MIN_BOOKING_OFFSET') < $info['max_checkout_offset']
|| isset($info['min_booking_offset']) && $info['min_booking_offset'] < $info['max_checkout_offset'])
&& ((Configuration::get('PS_MIN_BOOKING_OFFSET') < $info['max_checkout_offset'])
|| (isset($info['min_booking_offset']) && ($info['min_booking_offset'] < $info['max_checkout_offset']))
)
) {
$objHotelOrderRestrictDate->use_global_max_checkout_offset = false;
$objHotelOrderRestrictDate->max_checkout_offset = $info['max_checkout_offset'];
}
if (isset($info['min_booking_offset'])
&& (Configuration::get('PS_MAX_CHECKOUT_OFFSET') > $info['min_booking_offset']
|| isset($info['max_checkout_offset']) && $info['max_checkout_offset'] > $info['min_booking_offset'])
&& ((Configuration::get('PS_MAX_CHECKOUT_OFFSET') > $info['min_booking_offset'])
|| (isset($info['max_checkout_offset']) && ($info['max_checkout_offset'] > $info['min_booking_offset']))
)
) {
$objHotelOrderRestrictDate->use_global_min_booking_offset = false;
$objHotelOrderRestrictDate->min_booking_offset = $info['min_booking_offset'];
@@ -2449,39 +2458,41 @@ class AdminImportControllerCore extends AdminController
$idHotel = 0;
$objCustomer = new Customer($info['id_customer']);
$objProduct = new Product($info['id_product']);
if (Validate::isLoadedObject($objCustomer)
&& Validate::isLoadedObject($objProduct)
) {
if (!isset($hotelRoomTypeInfo[$info['id_product']])) {
if ($roomInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($singleRow->id_product)) {
if (Validate::isLoadedObject($objCustomer)) {
if (Validate::isLoadedObject($objProduct) || $objProduct->booking_product) {
if (!isset($hotelRoomTypeInfo[$info['id_product']])) {
if ($roomInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($singleRow->id_product)) {
$singleRow->id_hotel = $roomInfo['id_hotel'];
$idHotel = $roomInfo['id_hotel'];
$singleRow->adults = $roomInfo['adults'];
$singleRow->children = $roomInfo['children'];
$hotelRoomTypeInfo[$info['id_product']] = $roomInfo;
}
} else {
$roomInfo = $hotelRoomTypeInfo[$info['id_product']];
$singleRow->id_hotel = $roomInfo['id_hotel'];
$idHotel = $roomInfo['id_hotel'];
$singleRow->adults = $roomInfo['adults'];
$singleRow->children = $roomInfo['children'];
$hotelRoomTypeInfo[$info['id_product']] = $roomInfo;
}
$ordersRow[$info['id_order']][$singleRow->id_hotel][] = (array) $singleRow;
if (!isset($orderInfo[$info['id_order']])) {
$orderInfo[$info['id_order']]['id_customer'] = $singleRow->id_customer;
if (isset($singleRow->id_order_status)) {
$orderInfo[$info['id_order']]['id_order_status'] = $singleRow->id_order_status;
} else {
$orderInfo[$info['id_order']]['id_order_status'] = Configuration::get('PS_OS_AWAITING_REMOTE_PAYMENT');
}
if (isset($singleRow->id_currency)) {
$orderInfo[$info['id_order']]['id_currency'] = $singleRow->id_currency ;
} else {
$orderInfo[$info['id_order']]['id_currency'] = Configuration::get('PS_CURRENCY_DEFAULT');
}
}
} else {
$roomInfo = $hotelRoomTypeInfo[$info['id_product']];
$singleRow->id_hotel = $roomInfo['id_hotel'];
$idHotel = $roomInfo['id_hotel'];
$singleRow->adults = $roomInfo['adults'];
$singleRow->children = $roomInfo['children'];
}
$ordersRow[$info['id_order']][$singleRow->id_hotel][] = (array) $singleRow;
if (!isset($orderInfo[$info['id_order']])) {
$orderInfo[$info['id_order']]['id_customer'] = $singleRow->id_customer;
if (isset($singleRow->id_order_status)) {
$orderInfo[$info['id_order']]['id_order_status'] = $singleRow->id_order_status;
} else {
$orderInfo[$info['id_order']]['id_order_status'] = Configuration::get('PS_OS_AWAITING_REMOTE_PAYMENT');
}
if (isset($singleRow->id_currency)) {
$orderInfo[$info['id_order']]['id_currency'] = $singleRow->id_currency ;
} else {
$orderInfo[$info['id_order']]['id_currency'] = Configuration::get('PS_CURRENCY_DEFAULT');
}
$this->warnings[] = $this->l('Invalid room type Id: ').$info['id_product'];
}
}
}
@@ -2667,7 +2678,7 @@ class AdminImportControllerCore extends AdminController
null,
false
)) {
$this->errors[] = $this->l('Failed to create order for order reference '.$orderRefKey);
$this->errors[] = $this->l('Failed to create booking for reference').' '.$orderRefKey;
}
foreach ($featurePrices as $idPrice) {

View File

@@ -401,8 +401,20 @@ class AdminLocalizationControllerCore extends AdminController
public function beforeUpdateOptions()
{
$lang = new Language((int)Tools::getValue('PS_LANG_DEFAULT'));
if (!trim(Tools::getValue('PS_WEIGHT_UNIT'))) {
$this->errors[] = sprintf(Tools::displayError('field %s is required.'), $this->l('Weight unit'));
}
if (!trim(Tools::getValue('PS_DISTANCE_UNIT'))) {
$this->errors[] = sprintf(Tools::displayError('field %s is required.'), $this->l('Distance unit'));
}
if (!trim(Tools::getValue('PS_DIMENSION_UNIT'))) {
$this->errors[] = sprintf(Tools::displayError('field %s is required.'), $this->l('Dimension unit'));
}
if (!trim(Tools::getValue('PS_VOLUME_UNIT'))) {
$this->errors[] = sprintf(Tools::displayError('field %s is required.'), $this->l('Volume unit'));
}
$lang = new Language((int)Tools::getValue('PS_LANG_DEFAULT'));
if (!$lang->active) {
$lang->active = 1;
$lang->save();

View File

@@ -88,6 +88,7 @@ class AdminLogsControllerCore extends AdminController
'title' => $this->l('Minimum severity level'),
'hint' => $this->l('Enter "5" if you do not want to receive any emails.').'<br />'.$this->l('Emails will be sent to the website owner.'),
'cast' => 'intval',
'validation' => 'isUnsignedInt',
'type' => 'text'
)
),

View File

@@ -3854,14 +3854,14 @@ class AdminNormalProductsControllerCore extends AdminController
}
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
$selectetRoomTypes = $objRoomTypeServiceProduct->getAssociatedHotelsAndRoomType($product->id, RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE);
$selectetHotels = $objRoomTypeServiceProduct->getAssociatedHotelsAndRoomType($product->id, RoomTypeServiceProduct::WK_ELEMENT_TYPE_HOTEL);
$selectedRoomTypes = $objRoomTypeServiceProduct->getAssociatedHotelsAndRoomType($product->id, RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE);
$selectedHotels = $objRoomTypeServiceProduct->getAssociatedHotelsAndRoomType($product->id, RoomTypeServiceProduct::WK_ELEMENT_TYPE_HOTEL);
$tree = new HelperTree('hotels-room-tree');
$tree->setData(HotelHelper::generateTreeData([
'rootNode' => HotelHelper::NODE_HOTEL,
'leafNode' => HotelHelper::NODE_ROOM_TYPE,
'selectedElements' => $selectetRoomTypes
'selectedElements' => $selectedRoomTypes
]))
->setUseCheckBox(true)
->setAutoSelectChildren(true)
@@ -3873,7 +3873,7 @@ class AdminNormalProductsControllerCore extends AdminController
$tree->setData(HotelHelper::generateTreeData([
'rootNode' => HotelHelper::NODE_HOTEL,
'leafNode' => HotelHelper::NODE_HOTEL,
'selectedElements' => $selectetHotels
'selectedElements' => $selectedHotels
]))
->setUseCheckBox(true)
->setAutoSelectChildren(true)

View File

@@ -189,7 +189,7 @@ class AdminOrderPreferencesControllerCore extends AdminController
'PS_ROOM_PRICE_AUTO_ADD_BREAKDOWN' => array(
'title' => $this->l('Show room price breakdown'),
'hint' => $this->l('Show price breakdown for rooms with auto added services on checkout page.'),
'desc' => $this->l('This room price breakdown will be shown if cart rule for specific room type is applied on that room.'),
'desc' => $this->l('Displays a price breakdown for rooms that have auto-added services during checkout.'),
'cast' => 'intval',
'type' => 'bool'
),
@@ -362,23 +362,24 @@ class AdminOrderPreferencesControllerCore extends AdminController
$countries = Country::getCountries($this->context->language->id);
$this->context->smarty->assign('countries', $countries);
$this->fields_options['standard_product'] = array(
'title' => $this->l('Standard Product'),
'title' => $this->l('Standard Product Address configuration'),
'icon' => 'icon-cogs',
'fields' => array(
'PS_STANDARD_PRODUCT_ORDER_ADDRESS_PREFRENCE' => array(
'title' => $this->l('Standard product address type'),
'title' => $this->l('Address for standard product tax calculation'),
'validation' => 'isInt',
'type' => 'select',
'cast' => 'intval',
'list' => $addressPrefrenceTypes,
'identifier' => 'value',
'js' => "changeStandardProductAddressType()",
'hint' => $this->l('Select Standard product Address type, this will be used to calculate the tax for the standard product price.'),
'desc' => $this->l('The selected address type will be used to calculate tax for the standard product.')
'hint' => $this->l('Select address for standard product tax calculation, this will be used to calculate the tax for the standard product price.'),
'desc' => $this->l('The selected address will be used to calculate tax for standard products. To change the hotel address, update the "Primary Hotel" in the').
'<a href="'.$this->context->link->getAdminLink('AdminHotelGeneralSettings').'"> '.$this->l('Hotel General Configuration.').'</a>'
),
'PS_STANDARD_PRODUCT_ORDER_ADDRESS' => array(
'title' => $this->l('Standard product custom address'),
'hint' => $this->l('Set the Address details'),
'title' => $this->l('Custom address for tax calculation'),
'hint' => $this->l('Set the custom address details for tax calculation'),
'type' => 'html',
),
),
@@ -429,7 +430,7 @@ class AdminOrderPreferencesControllerCore extends AdminController
$postcode = trim(Tools::getValue('service_postcode'));
$serviceAddressPrefrenceType = Tools::getValue('PS_STANDARD_PRODUCT_ORDER_ADDRESS_PREFRENCE');
if ($serviceAddressPrefrenceType == Product::STANDARD_PRODUCT_ADDRESS_PREFERENCE_CUSTOM) {
$addressValidation = Address::getValidationRules('Address');
$addressValidation = Address::getValidationRules('Address')['size'];
if (!$idCountry) {
$this->errors[] = Tools::displayError('Field country is required');
} elseif (!Validate::isLoadedObject($objCountry = new Country($idCountry))) {

View File

@@ -986,14 +986,12 @@ class AdminOrdersControllerCore extends AdminController
}
if ($serviceProducts) {
if ($additionalServices) {
foreach ($serviceProducts as $key => $servProduct) {
$serviceProducts[$key]['price_tax_exc'] = $servProduct['price'];
if (isset($additionalServices[$productLineData['id']])
&& in_array($servProduct['id_product'], array_column($additionalServices[$productLineData['id']]['additional_services'], 'id_product'))
) {
unset($serviceProducts[$key]);
}
foreach ($serviceProducts as $key => $servProduct) {
$serviceProducts[$key]['price_tax_exc'] = $servProduct['price'];
if (isset($additionalServices[$productLineData['id']])
&& in_array($servProduct['id_product'], array_column($additionalServices[$productLineData['id']]['additional_services'], 'id_product'))
) {
unset($serviceProducts[$key]);
}
}
@@ -1017,6 +1015,7 @@ class AdminOrdersControllerCore extends AdminController
$smartyVars['taxRulesGroups'] = $taxRulesGroups;
$smartyVars['invoices_collection'] = $objOrder->getInvoicesCollection();
$smartyVars['customServiceAllowed'] = Configuration::get('PS_ALLOW_CREATE_CUSTOM_SERVICES_IN_BOOKING');
$smartyVars['current_id_lang'] = $this->context->language->id;
$this->context->smarty->assign($smartyVars);
@@ -1124,6 +1123,7 @@ class AdminOrdersControllerCore extends AdminController
$this->context->smarty->assign(
array(
'order' => $objOrder,
'currency' => new Currency($objOrder->id_currency),
'current_index' => self::$currentIndex,
'bookingOrderInfo' => $bookingOrderInfo,
'serviceProducts' => array_merge($hotelProducts, $standaloneProducts)
@@ -1386,13 +1386,12 @@ class AdminOrdersControllerCore extends AdminController
$id_lang_shop = false
){
if ($this->action == 'export' && empty($this->_listsql)) {
$this->_select .= ', c.`email`, cgd.`phone`, a.`total_paid_real`,
$this->_select .= ', c.`email`, c.`phone`, a.`total_paid_real`,
orf.`cancellation_date`, orf.`cancellation_fee`,
cy.`iso_code` AS country, st.`iso_code` as state, ad.`city`,
CONCAT(ad.`address1`, \', \', ad.`postcode`) AS `cus_address`, hbdtl.*';
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'cart_customer_guest_detail` cgd ON cgd.`email` = c.`email` AND cgd.`id_cart` = 0
LEFT JOIN `'._DB_PREFIX_.'address` ad ON a.`id_customer`= ad.`id_customer` AND ad.`id_customer`!=0
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'address` ad ON a.`id_customer`= ad.`id_customer` AND ad.`id_customer`!=0
LEFT JOIN `'._DB_PREFIX_.'country` cy ON cy.`id_country`= ad.`id_country`
LEFT JOIN `'._DB_PREFIX_.'state` st ON st.`id_state`= ad.`id_state`
LEFT JOIN (
@@ -2025,6 +2024,11 @@ class AdminOrdersControllerCore extends AdminController
$this->context->currency = new Currency((int)$objCart->id_currency);
$this->errors = HotelCartBookingData::validateCartBookings(!Configuration::get('PS_ALLOW_ADD_ALL_SERVICES_IN_BOOKING'));
// Remove cart rules and add if any changes
CartRule::autoRemoveFromCart($this->context);
CartRule::autoAddToCart($this->context);
$orderTotal = $objCart->getOrderTotal(true, Cart::BOTH);
if ($objCart->is_advance_payment) {
$advancePaymentAmount = $objCart->getOrderTotal(true, Cart::ADVANCE_PAYMENT);
@@ -2850,10 +2854,36 @@ class AdminOrdersControllerCore extends AdminController
$helper->color = 'color1';
$helper->title = $this->l('Total Rooms');
$helper->tooltip = $this->l('Total rooms is the number of rooms booked in this order.');
$helper->href = '#start_products';
$helper->href = '#start_rooms';
$helper->value = $numRooms;
$this->kpis[] = $helper;
// if order has normal products the add kpi for total products
$objServiceProductOrderDetail = new ServiceProductOrderDetail();
$hotelProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($objOrder->id, 0, 0, Product::SELLING_PREFERENCE_HOTEL_STANDALONE);
$standaloneProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($objOrder->id, 0, 0, Product::SELLING_PREFERENCE_STANDALONE);
if ($hotelProducts || $standaloneProducts) {
$helper = new HelperKpi();
$helper->id = 'box-total-products';
$helper->icon = 'icon-home';
$helper->color = 'color1';
$helper->title = $this->l('Total Products');
$helper->tooltip = $this->l('Total products is the number of product quantities booked in this order.');
$helper->href = '#start_products';
$totalProductQuantity = 0;
if ($hotelProducts) {
$totalProductQuantity += array_sum(array_column($hotelProducts, 'quantity'));
}
if ($standaloneProducts) {
$totalProductQuantity += array_sum(array_column($standaloneProducts, 'quantity'));
}
$helper->value = $totalProductQuantity;
$this->kpis[] = $helper;
}
$helper = new HelperKpi();
if (isset($orderHistory[0]['id_order_state']) && ($orderHistory[0]['id_order_state'] == Configuration::get('PS_OS_PAYMENT_ACCEPTED'))) {
$initialPaymentStatus = $this->l('Full Payment');
@@ -3267,7 +3297,7 @@ class AdminOrdersControllerCore extends AdminController
0,
0,
null,
0,
null,
null,
0,
$value['id']
@@ -6138,6 +6168,9 @@ class AdminOrdersControllerCore extends AdminController
// Save order invoice
if (isset($objOrderInvoice)) {
$objOrderInvoice->total_products_wt -= $diffPriceTaxIncl;
$objOrderInvoice->total_paid_tax_excl += $diffPriceTaxExcl;
$objOrderInvoice->total_paid_tax_incl += $diffPriceTaxIncl;
$result &= $objOrderInvoice->update();
}
@@ -6234,7 +6267,7 @@ class AdminOrdersControllerCore extends AdminController
0,
1,
1,
0,
null, // to get the auto added services.
null,
0,
$idHotelBooking
@@ -6250,7 +6283,7 @@ class AdminOrdersControllerCore extends AdminController
0,
1,
0,
0,
null, // to get the auto added services.
null,
0,
$idHotelBooking
@@ -6266,7 +6299,7 @@ class AdminOrdersControllerCore extends AdminController
0,
0,
null,
0,
null, // to get the auto added services.
null,
0,
$idHotelBooking
@@ -7675,7 +7708,7 @@ class AdminOrdersControllerCore extends AdminController
$objHotelBookingDetail->date_to,
$objHotelBookingDetail->id_room
)) {
$name = Tools::getValue('new_service_name');
$name = trim(Tools::getValue('new_service_name'));
$price = Tools::getValue('new_service_price');
$priceCalcMethod = Tools::getValue('new_service_price_calc_method');
$priceAdditionType = Tools::getValue('new_service_price_addition_type');

View File

@@ -5312,6 +5312,7 @@ class AdminProductsControllerCore extends AdminController
if ($idRooms = Tools::getValue('id_rooms')) {
$rowsToHighlight = array();
$room = array();
$bookedRows = array();
if (trim($floor = Tools::getValue('floor'))) {
$room['floor'] = $floor;
if (!Validate::isGenericName($floor)) {
@@ -5379,7 +5380,8 @@ class AdminProductsControllerCore extends AdminController
}
} else if ($room['id_status'] == HotelRoomInformation::STATUS_TEMPORARY_INACTIVE && $disableDates) {
foreach ($disableDates as $key => $dateRange) {
if ($objHotelBookingDetail->chechRoomBooked($idRoom, $dateRange['date_from'], $dateRange['date_to'])) {
if ($bookingRow = $objHotelBookingDetail->chechRoomBooked($idRoom, $dateRange['date_from'], $dateRange['date_to'])) {
$bookedRows[$bookingRow['id']] = new HotelBookingDetail($bookingRow['id']);
$rowsToHighlight[] = $key;
}
}
@@ -5390,6 +5392,18 @@ class AdminProductsControllerCore extends AdminController
Hook::exec('actionValidateRoomInformation', array('room_information' => $room));
}
if (count($bookedRows)) {
foreach ($bookedRows as $bookedRow) {
$this->context->smarty->assign(array(
'link' => $this->context->link,
'orderDetails' => $bookedRow,
));
$this->errors[] = $this->context->smarty->fetch('controllers/products/booked_room_date_ranges_list.tpl');
}
}
}
if (empty($this->errors)) {
@@ -5476,7 +5490,7 @@ class AdminProductsControllerCore extends AdminController
if (!($roomQuantity = Tools::getValue('qty'))) {
$this->errors[] = Tools::displayError('Number of rooms is required.');
} else if ($roomQuantity < 1) {
} else if (!Validate::isUnsignedInt($roomQuantity) || $roomQuantity < 1) {
$this->errors[] = Tools::displayError('Invalid value for number of rooms.');
}

View File

@@ -285,7 +285,8 @@ class AdminStatusesControllerCore extends AdminController
//init and render the second list
$this->list_skip_actions = array();
$this->_filter = false;
$this->addRowActionSkipList('delete', array(1, 2, 3, 4, 5));
$unremovableOrs = Configuration::getMultiple(array('PS_ORS_PENDING', 'PS_ORS_DENIED', 'PS_ORS_REFUNDED'));
$this->addRowActionSkipList('delete', $unremovableOrs);
$this->initOrdersReturnsList();
$this->checkFilterForOrdersReturnsList();

View File

@@ -420,11 +420,8 @@ class OrderDetailControllerCore extends FrontController
}
$roomTypes[$type_value['id_product']] = $type_value;
}
$redirectTermsLink = $this->context->link->getCMSLink(new CMS(3, $this->context->language->id), null, $this->context->language->id);
}
$objHotelBookingDetail = new HotelBookingDetail();
$htlBookingDetail = $objHotelBookingDetail->getOrderCurrentDataByOrderId($order->id);
$this->context->smarty->assign(
array(

View File

@@ -41,8 +41,28 @@ class OrderFollowControllerCore extends FrontController
parent::initContent();
if (isset($this->context->customer->id) && $this->context->customer->id) {
$ordersReturns = OrderReturn::getOrdersReturn($this->context->customer->id, Tools::getValue('id_order'));
$this->context->smarty->assign('ordersReturns', $ordersReturns);
$hasProductRefunds = 0;
$hasRoomRefunds = 0;
if ($ordersReturns = OrderReturn::getOrdersReturn($this->context->customer->id, Tools::getValue('id_order'))) {
$objOrderReturn = new OrderReturn();
foreach ($ordersReturns as $key => $orderReturn) {
$ordersReturns[$key]['total_rooms_refunds'] = 0;
$ordersReturns[$key]['total_products_refunds'] = 0;
if ($refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($orderReturn['id_order'], $orderReturn['id_order_return'])) {
$hasRoomRefunds = 1;
}
if ($refundReqProducts = $objOrderReturn->getOrderRefundRequestedProducts($orderReturn['id_order'], $orderReturn['id_order_return'])) {
$hasProductRefunds = 1;
}
}
}
$this->context->smarty->assign(array(
'ordersReturns' => $ordersReturns,
'hasRoomRefunds' => $hasRoomRefunds,
'hasProductRefunds' => $hasProductRefunds
));
$this->setTemplate(_PS_THEME_DIR_.'order-follow.tpl');
} else {

View File

@@ -1148,6 +1148,7 @@ class OrderOpcControllerCore extends ParentOrderController
$this->_assignCheckoutValidationVars();
$this->_assignCheckoutVars();
$this->_assignShoppingCart();
$this->_assignSummaryInformations();
$response['success'] = true;
$response['shopping_cart'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'shopping-cart.tpl');
$response['cart_total_block'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'cart-total-block.tpl');

View File

@@ -891,6 +891,14 @@ class ProductControllerCore extends FrontController
$useTax,
$quantity
);
$smartyVars['service_price_without_reduction'] = RoomTypeServiceProductPrice::getPrice(
$this->product->id,
$idHotel,
$idProductOption,
$useTax,
$quantity,
false
);
if ($quantity) {
$smartyVars['quantity'] = $quantity;
}

View File

@@ -1,3 +1,3 @@
Hotel ID;Active(0/1);Hotel Name;Short Description;Description;Mobile Phone;Email;Address;Rating;Check-In;Check-Out;Country ID;State ID;City;Zip Code;Hotel Policies;Allow Refund(0/1);Refund IDs (x,y,z...);Max booking offset;Min booking offset;Image URLs (x,y,z...);Delete Existing Images (0 = No, 1 = Yes)
2;1;The Kings Hotel;The Kings Hotel with king size rooms. visit for a wonderful experience.;The Kings Hotel with king-size rooms. visit for a wonderful experience.;0900000009;kingshotel@demo.com;Greene St, New York, NY 10003, USA;3;12:00;11:00;21;32;New York;10003;1. intelligentsia tattooed pop-up salvia asymmetrical mixtape meggings tousled ramps VHS cred.2. intelligentsia tattooed pop-up salvia asymmetrical mixtape meggings tousled ramps VHS cred.;1;1;2024-01-01;0;http://localhost/hotelcommerce/modules/hotelreservationsystem/views/img/hotel_img/1/1.jpg;0
3;1;The Sunshine Palace Inn;The Sunshine Palace Inn is a beautiful hotel in japan.;The Sunshine Palace Inn is a beautiful hotel in japan.;0900000009;sunshine@demo.com;Shingashi, Itabashi, Tokyo;4;09:00;08:00;11;306;Tokyo;611-0043;1.loremipsertmkjbg ag mixtape meggings tousled ramps VHS cred.;0;0;;3;http://localhost/hotelcommerce/modules/hotelreservationsystem/views/img/hotel_img/1/2.jpg,http://localhost/hotelcommerce/modules/hotelreservationsystem/views/img/hotel_img/1/3.jpg;0
Hotel ID;Active(0/1);Hotel Name;Short Description;Description;Mobile Phone;Email;Address;Rating;Check-In;Check-Out;Country ID;State ID;City;Zip Code;Fax;Hotel Policies;Allow Refund(0/1);Refund IDs (x,y,z...);Maximum checkout offset;Min booking offset;Image URLs (x,y,z...);Delete Existing Images (0 = No, 1 = Yes)
2;1;The Kings Hotel;The Kings Hotel with king size rooms. visit for a wonderful experience.;The Kings Hotel with king-size rooms. visit for a wonderful experience.;0900000009;kingshotel@demo.com;Greene St, New York, NY 10003, USA;3;12:00;11:00;21;32;New York;10003;;1. intelligentsia tattooed pop-up salvia asymmetrical mixtape meggings tousled ramps VHS cred.2. intelligentsia tattooed pop-up salvia asymmetrical mixtape meggings tousled ramps VHS cred.;1;1;4;0;http://localhost/hotelcommerce/modules/hotelreservationsystem/views/img/hotel_img/1/1.jpg;0
3;1;The Sunshine Palace Inn;The Sunshine Palace Inn is a beautiful hotel in japan.;The Sunshine Palace Inn is a beautiful hotel in japan.;0900000009;sunshine@demo.com;Shingashi, Itabashi, Tokyo;4;09:00;08:00;11;306;Tokyo;611-0043;;1.loremipsertmkjbg ag mixtape meggings tousled ramps VHS cred.;0;0;;3;http://localhost/hotelcommerce/modules/hotelreservationsystem/views/img/hotel_img/1/2.jpg,http://localhost/hotelcommerce/modules/hotelreservationsystem/views/img/hotel_img/1/3.jpg;0
1 Hotel ID Active(0/1) Hotel Name Short Description Description Mobile Phone Email Address Rating Check-In Check-Out Country ID State ID City Zip Code Fax Hotel Policies Allow Refund(0/1) Max booking offset Refund IDs (x,y,z...) Maximum checkout offset Min booking offset Image URLs (x,y,z...) Delete Existing Images (0 = No, 1 = Yes)
2 2 1 The Kings Hotel The Kings Hotel with king size rooms. visit for a wonderful experience. The Kings Hotel with king-size rooms. visit for a wonderful experience. 0900000009 kingshotel@demo.com Greene St, New York, NY 10003, USA 3 12:00 11:00 21 32 New York 10003 1. intelligentsia tattooed pop-up salvia asymmetrical mixtape meggings tousled ramps VHS cred.2. intelligentsia tattooed pop-up salvia asymmetrical mixtape meggings tousled ramps VHS cred. 1 2024-01-01 1 4 0 http://localhost/hotelcommerce/modules/hotelreservationsystem/views/img/hotel_img/1/1.jpg 0
3 3 1 The Sunshine Palace Inn The Sunshine Palace Inn is a beautiful hotel in japan. The Sunshine Palace Inn is a beautiful hotel in japan. 0900000009 sunshine@demo.com Shingashi, Itabashi, Tokyo 4 09:00 08:00 11 306 Tokyo 611-0043 1.loremipsertmkjbg ag mixtape meggings tousled ramps VHS cred. 0 0 3 http://localhost/hotelcommerce/modules/hotelreservationsystem/views/img/hotel_img/1/2.jpg,http://localhost/hotelcommerce/modules/hotelreservationsystem/views/img/hotel_img/1/3.jpg 0

View File

@@ -211,6 +211,9 @@ class InstallModelInstall extends InstallAbstractModel
Configuration::updateGlobalValue('PS_LANG_DEFAULT', $id_lang);
Configuration::updateGlobalValue('PS_VERSION_DB', _PS_INSTALL_VERSION_);
Configuration::updateGlobalValue('PS_INSTALL_VERSION', _PS_INSTALL_VERSION_);
Configuration::updateGlobalValue('QLO_VERSION_DB', _QLO_INSTALL_VERSION_);
Configuration::updateGlobalValue('QLO_INSTALL_VERSION', _QLO_INSTALL_VERSION_);
return true;
}
@@ -475,6 +478,7 @@ class InstallModelInstall extends InstallAbstractModel
Configuration::updateGlobalValue('PS_SHOP_DOMAIN', Tools::getHttpHost());
Configuration::updateGlobalValue('PS_SHOP_DOMAIN_SSL', Tools::getHttpHost());
Configuration::updateGlobalValue('PS_INSTALL_VERSION', _PS_INSTALL_VERSION_);
Configuration::updateGlobalValue('QLO_INSTALL_VERSION', _QLO_INSTALL_VERSION_);
Configuration::updateGlobalValue('PS_LOCALE_LANGUAGE', $this->language->getLanguageIso());
Configuration::updateGlobalValue('PS_SHOP_NAME', $data['shop_name']);
Configuration::updateGlobalValue('PS_SHOP_ACTIVITY', $data['shop_activity']);

View File

@@ -434,6 +434,7 @@ if (empty($fail_result)) {
Configuration::updateValue('PS_HIDE_OPTIMIZATION_TIPS', 0);
Configuration::updateValue('PS_NEED_REBUILD_INDEX', 1);
Configuration::updateValue('PS_VERSION_DB', _PS_INSTALL_VERSION_);
Configuration::updateGlobalValue('QLO_VERSION_DB', _QLO_INSTALL_VERSION_);
$result .= $warningExist ? '<action result="fail" error="34">'."\n" : '<action result="ok" error="">'."\n";
$result .= $requests;
$result .= '</action>'."\n";

View File

@@ -38,6 +38,7 @@
{$rm_v['num_rm']}
</td>
<td>
{if !isset($show_full_date)}{assign var="show_full_date" value=0}{/if}
{assign var="is_full_date" value=($show_full_date && ($rm_v['data_form']|date_format:'%D' == $rm_v['data_to']|date_format:'%D'))}
{$rm_v['data_form']|date_format:"%d-%b-%G"}{if $is_full_date} {$rm_v['data_form']|date_format:"%I:%M %p"}{/if}
</td>

View File

@@ -1,3 +0,0 @@
{foreach $list as $cart_rule}
{$cart_rule['voucher_name']} {$cart_rule['voucher_reduction']}
{/foreach}

View File

@@ -1,21 +0,0 @@
{foreach $list as $product}
{$product['reference']}
{$product['name']}
{$product['price']}
{$product['quantity']}
{$product['price']}
{foreach $product['customization'] as $customization}
{$product['name']} {$customization['customization_text']}
{$product['price']}
{$product['customization_quantity']}
{$product['quantity']}
{/foreach}
{/foreach}

View File

@@ -805,7 +805,6 @@ var ajaxCart = {
}
$('.vouchers').show();
}
},
// Update product quantity
@@ -844,7 +843,7 @@ var ajaxCart = {
if (parseInt(this.selling_preference_type) == SELLING_PREFERENCE_HOTEL_STANDALONE
|| parseInt(this.selling_preference_type) == SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE
) {
if (typeof value.hotel_wise_data != 'undefined' && value.hotel_wise_data.length) {
if (typeof value.hotel_wise_data != 'undefined') {
$(value.hotel_wise_data).each(function(i, val) {
ajaxCart.addProductRow(value, val);
});
@@ -887,11 +886,12 @@ var ajaxCart = {
content += '<div class="cart-info-sec rm_product_info_' + productId + '">';
content += '<span class="product_info_label">Price:</span>';
content += '<span class="price product_info_data">&nbsp;';
if (product.booking_product) {
content += formatCurrency(parseFloat(product.bookingData.total_room_type_amount), currency_format, currency_sign, currency_blank);
}else if ((parseInt(product.selling_preference_type) == SELLING_PREFERENCE_HOTEL_STANDALONE
|| parseInt(product.selling_preference_type) == SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE)
&& (typeof(hotel_wise_data) != 'undefined' && hotel_wise_data.length)
&& (typeof(hotel_wise_data) != 'undefined')
) {
content += formatCurrency(parseFloat(hotel_wise_data.amount), currency_format, currency_sign, currency_blank);
} else {
@@ -901,15 +901,19 @@ var ajaxCart = {
content += '</div>';
}
content += '<div class="cart-info-sec rm_product_info_' + productId + '">';
content += '<span class="product_info_label">' + total_qty_txt + ':</span>';
if (product.booking_product || product.allow_multiple_quantity) {
content += '<span class="product_info_label">' + total_qty_txt + ':</span>';
}
content += '<span class="quantity-formated">';
content += '<span class="quantity product_info_data">';
if (product.booking_product) {
content += product.bookingData.total_num_rooms;
} else if (typeof(hotel_wise_data) != 'undefined' && hotel_wise_data.total_qty) {
content += hotel_wise_data.total_qty;
} else {
content += product.cart_quantity;
} else if (product.allow_multiple_quantity) {
if (typeof(hotel_wise_data) != 'undefined' && hotel_wise_data.total_qty) {
content += hotel_wise_data.total_qty;
} else {
content += product.cart_quantity;
}
}
content += '</span>';
content += '</span>';
@@ -1186,6 +1190,7 @@ var ajaxCart = {
product.date_from + ' - ' + product.date_to
);
$('#layer_cart_product_hotel_name').parent().hide();
$('#layer_cart_product_quantity').parent().show();
var product_quantity_text = '';
if(parseInt(product.booking_product)) {
let rooms = 0;
@@ -1202,7 +1207,11 @@ var ajaxCart = {
product_quantity_text = product.occupancy;
}
} else {
product_quantity_text = product.qty;
if (product.allow_multiple_quantity) {
product_quantity_text = product.qty;
} else {
$('#layer_cart_product_quantity').parent().hide();
}
$('#layer_cart_product_unit_price').text(product.unit_price);
if (product.hotel_name) {
$('#layer_cart_product_hotel_name').text(product.hotel_name).parent().show();
@@ -1369,18 +1378,21 @@ function crossselling_serialScroll() {
});
}
function resetRoomtypeServices() {
function resetRoomtypeServices(refresh = true) {
$('.room_demands_container').find('input.id_room_type_demand:checked').prop('checked', false).uniform();
$('#additional_products').empty();
$('#additional_products div')
$('.remove_roomtype_product').text(select_txt).removeClass('btn-danger remove_roomtype_product').addClass('btn-success add_roomtype_product');
BookingForm.refresh();
if (refresh) {
BookingForm.refresh();
}
}
function disableRoomTypeDemands(show) {
if (show) {
$('.room_demands_container_overlay').show();
$('.room_demands_container').find('input:checkbox.id_room_type_demand').prop('checked', false);
$('.room_demand_block').find('.id_room_type_demand').prop('checked', false).parent().removeClass('checked');
$('.room_demands_container').find('input:checkbox.id_room_type_demand').attr('disabled', 'disabled');
} else {
$('.room_demands_container_overlay').hide();
@@ -1391,6 +1403,7 @@ function disableRoomTypeDemands(show) {
function disableRoomTypeServices(disable) {
if (disable) {
resetRoomtypeServices(false);
$('#service_products_cont').find('button.add_roomtype_product').attr('disabled', 'disabled');
$('#service_products_cont').find('.qty_container .qty_direction a').attr('disabled', 'disabled');
} else {
@@ -1472,4 +1485,4 @@ function getBookingOccupancyDetails(bookingform, booking_product)
}
return occupancy;
}
}

View File

@@ -48,11 +48,11 @@
{block name='blockcart_shopping_cart_product_quantity'}
<div class="cart-info-sec rm_product_info_{$product.id_product}">
<span class="product_info_label">{l s='Total Qty.' mod='blockcart'}:</span>
{if $product.allow_multiple_quantity || $product.booking_product}<span class="product_info_label">{l s='Total Qty.' mod='blockcart'}:</span>{/if}
<span class="quantity-formated">
{if $product.booking_product}
<span class="quantity product_info_data">{$product.bookingData['total_num_rooms']}</span>
{else}
{elseif $product.allow_multiple_quantity}
{if $product.selling_preference_type == Product::SELLING_PREFERENCE_HOTEL_STANDALONE || $product.selling_preference_type == Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE}
<span class="quantity product_info_data">{$hotel_wise_data.total_qty}</span>
{elseif $product.selling_preference_type == Product::SELLING_PREFERENCE_STANDALONE}
@@ -65,7 +65,7 @@
</div>
<span class="remove_link">
{if !isset($customizedDatas.$productId.$productAttributeId) && (!isset($product.is_gift) || !$product.is_gift)}
<a class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&token={$static_token}")|escape:'html':'UTF-8'}{if isset($hotel_wise_data) && $hotel_wise_data.id_hotel}&id_hotel={$hotel_wise_data.id_hotel|escape:'html':'UTF-8'}{/if}" rel="nofollow" title="{l s='remove this product from my cart' mod='blockcart'}">&nbsp;</a>
<a class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&token={$static_token}")|escape:'html':'UTF-8'}{if !empty($hotel_wise_data.id_hotel)}&id_hotel={$hotel_wise_data.id_hotel|escape:'html':'UTF-8'}{/if}" rel="nofollow" title="{l s='remove this product from my cart' mod='blockcart'}">&nbsp;</a>
{/if}
</span>
<div style="clear:both"></div>

View File

@@ -257,361 +257,6 @@ class HotelRoomTypeFeaturePricing extends ObjectModel
return $specialDaysCount;
}
/**
* [getHotelRoomTypesRatesByDate returns hotel room types rates accrding to feature price plans]
* @param [int] $id_hotel [id of th hotel]
* @param integer $id_product [id of the product if supplied only rates of this room type will be returned]
* @param [date] $date_from [start date of the date range]
* @param [date] $date_to [end date of the date range]
* @return [array|false] [returns array containing rates of room type of a hotel if found else returns false]
*/
public function getHotelRoomTypesRatesAndInventoryByDate($id_hotel, $id_product, $date_from, $date_to)
{
$hotelRoomType = new HotelRoomType();
$context = Context::getContext();
$roomTypeRatesAndInventory = array();
$objBookingDetail = new HotelBookingDetail();
$incr = 0;
$date_from = date('Y-m-d', strtotime($date_from));
$date_to = date('Y-m-d', strtotime($date_to));
for($date = $date_from; $date < $date_to; $date = date('Y-m-d', strtotime('+1 day', strtotime($date)))) {
$currentDate = date('Y-m-d', strtotime($date));
$nextDayDate = date('Y-m-d', strtotime('+1 day', strtotime($currentDate)));
if ($id_product) {
$bookingParams = array(
'date_from' => $currentDate,
'date_to' => $nextDayDate,
'hotel_id' => $id_hotel,
'id_room_type' => $id_product,
'only_search_data' => 1,
);
$roomTypeAvailabilityInfo = $objBookingDetail->dataForFrontSearch($bookingParams);
if (isset($roomTypeAvailabilityInfo['stats']['num_avail'])) {
$totalAvailableRooms = $roomTypeAvailabilityInfo['stats']['num_avail'];
} else {
$totalAvailableRooms = 0;
}
$roomTypePrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice($id_product, $currentDate, $nextDayDate);
$roomTypeRatesAndInventory[$incr]['date'] = $currentDate;
$roomTypeRatesAndInventory[$incr]['room_types'][0]['id'] = $id_product;
$roomTypeRatesAndInventory[$incr]['room_types'][0]['rates'] = $roomTypePrice;
$roomTypeRatesAndInventory[$incr]['room_types'][0]['available_rooms'] = $totalAvailableRooms;
} else {
$hotelRoomTypes = $hotelRoomType->getRoomTypeByHotelId($id_hotel, $context->language->id);
if ($hotelRoomTypes) {
$roomTypeRatesAndInventory[$incr]['date'] = $currentDate;
foreach ($hotelRoomTypes as $key => $product) {
$roomTypePrice = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
$product['id_product'],
$currentDate,
$nextDayDate
);
$bookingParams = array(
'date_from' => $currentDate,
'date_to' => $nextDayDate,
'hotel_id' => $id_hotel,
'id_room_type' => $product['id_product'],
'only_search_data' => 1,
);
$roomTypeAvailabilityInfo = $objBookingDetail->dataForFrontSearch($bookingParams);
if (isset($roomTypeAvailabilityInfo['stats']['num_avail'])) {
$totalAvailableRooms = $roomTypeAvailabilityInfo['stats']['num_avail'];
} else {
$totalAvailableRooms = 0;
}
$roomTypeRatesAndInventory[$incr]['room_types'][$key]['id'] = $product['id_product'];
$roomTypeRatesAndInventory[$incr]['room_types'][$key]['rates'] = $roomTypePrice;
$roomTypeRatesAndInventory[$incr]['room_types'][$key]['available_rooms'] = $totalAvailableRooms;
}
} else {
return false;
}
}
$incr++;
}
return $roomTypeRatesAndInventory;
}
/**
* [updateRoomTypesFeaturePrices update and creates feature price plans by supplied information]
* @param [array] $featurePricePlans [feature price plans sent from channel manager]
* @return [array] [success if process is finished successfully else fasiled with errors]
* @information [if any feature price plan for the same date_from and date_to(supplied in the $featurePricePlans array) it will be updated otherwise it is added. While adding date range type rate plans if any plan already exist then feature price for all specific dates in the date range will be created (or updated if specific date feature price plan exists)]
*/
public function updateRoomTypesFeaturePricesAvailability($featurePricePlans)
{
$errors = [];
if ($featurePricePlans) {
if (isset($featurePricePlans['data']) && $featurePricePlans['data']) {
foreach ($featurePricePlans['data'] as $roomTypeRatesData) {
$dateFrom = date('Y-m-d', strtotime($roomTypeRatesData['dateFrom']));
$dateTo = date('Y-m-d', strtotime('+1 day', strtotime($roomTypeRatesData['dateTo'])));
if ($roomTypeRatesData['roomType']) {
foreach ($roomTypeRatesData['roomType'] as $key => $roomTypeRates) {
$id_product = $key;
// feature price rates create and updates
if (isset($roomTypeRates['rate'])) {
$productPriceTE = Product::getPriceStatic((int) $id_product, false);
if ($productPriceTE != $roomTypeRates['rate']) {
if ($productPriceTE > $roomTypeRates['rate']) {
$priceImpactWay = 1;
$impactValue = $productPriceTE - $roomTypeRates['rate'];
} else {
$priceImpactWay = 2;
$impactValue = $roomTypeRates['rate'] - $productPriceTE;
}
$params = array();
$params['roomTypeId'] = $id_product;
$params['featurePriceName'] = 'Webservice Feature Price';
$params['dateFrom'] = $dateFrom;
$featurePriceDateTo = date('Y-m-d', (strtotime($dateTo) - _TIME_1_DAY_));
$params['dateTo'] = $featurePriceDateTo;
$params['priceImpactWay'] = $priceImpactWay;
$params['isSpecialDaysExists'] = 0;
$params['jsonSpecialDays'] = null;
$params['priceImpactType'] = 2;
$params['impactValue'] = $impactValue;
$params['enableFeaturePrice'] = 1;
$nextDate = date('Y-m-d', strtotime('+1 day', strtotime($dateFrom)));
if ($nextDate == $dateTo) {
$params['dateSelectionType'] = self::DATE_SELECTION_TYPE_SPECIFIC;
$featurePriceExists = $this->checkRoomTypeFeaturePriceExistance(
$id_product,
$dateFrom,
$featurePriceDateTo,
'specific_date'
);
if ($featurePriceExists) {
if (!$this->saveFeaturePricePlan(2, $params, $featurePriceExists['id'])) {
$errors[] = $this->moduleInstance->l('Some error occured while saving Feature Price Plan Info:: Date From : ', 'HotelRoomTypeFeaturePricing').$params['dateFrom'].$this->moduleInstance->l(' Date To : ', 'HotelRoomTypeFeaturePricing').$params['dateFrom'].$this->moduleInstance->l(' Room Type Id : ', 'HotelRoomTypeFeaturePricing').$params['roomTypeId'];
}
} else {
if (!$this->saveFeaturePricePlan(2, $params, 0)) {
$errors[] = $this->moduleInstance->l('Some error occured while saving Feature Price Plan Info:: Date From : ', 'HotelRoomTypeFeaturePricing').$params['dateFrom'].$this->moduleInstance->l(' Date To : ', 'HotelRoomTypeFeaturePricing').$params['dateFrom'].$this->moduleInstance->l(' Room Type Id : ', 'HotelRoomTypeFeaturePricing').$params['roomTypeId'];
}
}
} else {
$params['dateSelectionType'] = self::DATE_SELECTION_TYPE_RANGE;
if ($featurePriceExists = $this->checkRoomTypeFeaturePriceExistance(
$id_product,
$dateFrom,
$featurePriceDateTo,
'date_range'
)) {
if ($featurePriceExists['date_from'] == $dateFrom
&& $featurePriceExists['date_to'] == $featurePriceDateTo
) {
if (!$this->saveFeaturePricePlan(
1,
$params,
$featurePriceExists['id']
)) {
$errors[] = $this->moduleInstance->l('Some error occured while saving Feature Price Plan Info:: Date From : ', 'HotelRoomTypeFeaturePricing').$params['dateFrom'].$this->moduleInstance->l(' Date To : ', 'HotelRoomTypeFeaturePricing').$params['dateFrom'].$this->moduleInstance->l(' Room Type Id : ', 'HotelRoomTypeFeaturePricing').$params['roomTypeId'];
}
} else {
for($date = $dateFrom; $date < $dateTo; $date = date('Y-m-d', strtotime('+1 day', strtotime($date)))) {
// Creating feature prices day wise, for single days.
$nextDayDate = $currentDate = date('Y-m-d', $date);
$params['dateFrom'] = $currentDate;
$params['dateTo'] = $nextDayDate;
$params['dateSelectionType'] = self::DATE_SELECTION_TYPE_SPECIFIC;
$featurePriceExists = $this->checkRoomTypeFeaturePriceExistance(
$id_product,
$currentDate,
$nextDayDate,
'specific_date'
);
if ($featurePriceExists) {
if (!$this->saveFeaturePricePlan(
2,
$params,
$featurePriceExists['id']
)) {
$errors[] = $this->moduleInstance->l('Some error occured while saving Feature Price Plan Info:: Date From : ', 'HotelRoomTypeFeaturePricing').$params['dateFrom'].$this->moduleInstance->l(' Date To : ', 'HotelRoomTypeFeaturePricing').$params['dateFrom'].$this->moduleInstance->l(' Room Type Id : ', 'HotelRoomTypeFeaturePricing').$params['roomTypeId'];
}
} else {
if (!$this->saveFeaturePricePlan(2, $params, 0)) {
$errors[] = $this->moduleInstance->l('Some error occured while saving Feature Price Plan Info:: Date From : ', 'HotelRoomTypeFeaturePricing').$params['dateFrom'].$this->moduleInstance->l(' Date To : ', 'HotelRoomTypeFeaturePricing').$params['dateFrom'].$this->moduleInstance->l(' Room Type Id : ', 'HotelRoomTypeFeaturePricing').$params['roomTypeId'];
}
}
}
}
} else {
if (!$this->saveFeaturePricePlan(1, $params, 0)) {
$errors[] = $this->moduleInstance->l('Some error occured while saving Feature Price Plan Info:: Date From : ', 'HotelRoomTypeFeaturePricing').$params['dateFrom'].$this->moduleInstance->l(' Date To : ', 'HotelRoomTypeFeaturePricing').$params['dateFrom'].$this->moduleInstance->l(' Room Type Id : ', 'HotelRoomTypeFeaturePricing').$params['roomTypeId'];
}
}
}
}
}
if (isset($roomTypeRates['inventory'])) {
$totalAvailableNotBooked = 0;
$totalAvailableRooms = 0;
$hotelRoomType = new HotelRoomType();
$hotelBookingDetail = new HotelBookingDetail();
$hotelRoomInformation = new HotelRoomInformation();
$roomTypeInfo = $hotelRoomType->getRoomTypeInfoByIdProduct($id_product);
$id_hotel = $roomTypeInfo['id_hotel'];
if ($id_hotel) {
$bookingParams = array(
'date_from' => $dateFrom,
'date_to' => $dateTo,
'hotel_id' => $id_hotel,
'id_room_type' => $id_product,
'only_search_data' => 1,
);
$roomTypeAvailabilityInfo = $hotelBookingDetail->dataForFrontSearch($bookingParams);
$bookedRoomsInfo = $hotelRoomInformation->getRoomTypeBookedRoomsForDateRange(
$id_hotel,
$id_product,
$dateFrom,
$dateTo
);
$countBookedRooms = count($bookedRoomsInfo);
if (isset($roomTypeAvailabilityInfo['stats']['total_rooms'])) {
$totalAvailableNotBooked = $roomTypeAvailabilityInfo['stats']['total_rooms'] - $countBookedRooms;
$totalAvailableRooms = $roomTypeAvailabilityInfo['stats']['num_avail'];
}
if ($roomTypeRates['inventory'] <= $totalAvailableNotBooked) {
if ($roomTypeRates['inventory'] < $totalAvailableRooms) {
$numDisabledRooms = $totalAvailableRooms - $roomTypeRates['inventory'];
$availableRooms = $hotelRoomInformation->getRoomTypeAvailableRoomsForDateRange(
$id_hotel,
$id_product,
$dateFrom,
$dateTo
);
if ($availableRooms) {
foreach ($availableRooms as $room) {
$objRoomDisableDates = new HotelRoomDisableDates();
$params['id_room'] = $room['id'];
$params['date_from'] = $dateFrom;
$params['date_to'] = $dateTo;
if (!($objRoomDisableDates->checkIfRoomAlreadyDisabled($params))) {
if ($numDisabledRooms > 0) {
$hotelRoomInformation = new HotelRoomInformation($room['id']);
if ($hotelRoomInformation->id_status == 3) {
$params['reason'] = $this->moduleInstance->l('Disabled from channel manager.', 'HotelRoomTypeFeaturePricing');
if (!$objRoomDisableDates->updateDisableDateRanges(
$params
)) {
$errors[] = $this->moduleInstance->l('Some error occurred while saving disable dates for '.$dateFrom.' To '.$dateTo.' for room id-'.$room['id'], 'HotelRoomTypeFeaturePricing');
}
} else {
$hotelRoomInformation->id_status = 3;
if ($hotelRoomInformation->save()) {
$objRoomDisableDates = new HotelRoomDisableDates();
$objRoomDisableDates->id_room = $room['id'];
$objRoomDisableDates->date_from = $dateFrom;
$objRoomDisableDates->date_to = $dateTo;
$objRoomDisableDates->reason = $this->moduleInstance->l('Disabled from channel manager.', 'HotelRoomTypeFeaturePricing');
$objRoomDisableDates->save();
}
}
$numDisabledRooms--;
}
}
}
}
} elseif ($roomTypeRates['inventory'] > $totalAvailableRooms) {
$roomsToEnable = $roomTypeRates['inventory'] - $totalAvailableRooms;
$disabledRooms = $hotelRoomInformation->getRoomTypeDisabledRoomsForDateRange(
$id_hotel,
$id_product,
$dateFrom,
$dateTo
);
if ($disabledRooms) {
foreach ($disabledRooms as $disableRoom) {
if ($roomsToEnable > 0) {
$hotelRoomInformation = new HotelRoomInformation($disableRoom['id']);
$objRoomDisableDates = new HotelRoomDisableDates();
$params['id_room'] = $disableRoom['id'];
$params['date_from'] = $dateFrom;
$params['date_to'] = $dateTo;
if (!$objRoomDisableDates->deleteDisabledDatesForDateRange(
$params
)) {
$errors[] = $this->moduleInstance->l('Some error occurred while saving deleting dates for '.$dateFrom.' To '.$dateTo.' for room id-'.$disableRoom['id'], 'HotelRoomTypeFeaturePricing');
}
$disabledDates = $objRoomDisableDates->getRoomDisableDates(
$disableRoom['id']
);
if (!count($disabledDates)) {
$hotelRoomInformation->id_status = 1;
$hotelRoomInformation->disabled_dates = null;
}
$hotelRoomInformation->save();
}
$roomsToEnable--;
}
}
}
}
}
} else {
$errors[] = $this->moduleInstance->l('Requested rooms inventory is not available.', 'HotelRoomTypeFeaturePricing');
}
}
} else {
$errors[] = $this->moduleInstance->l('Room Types for which Feature prices to be updated are not found.', 'HotelRoomTypeFeaturePricing');
}
}
} else {
$errors[] = $this->moduleInstance->l('Update Information not found.', 'HotelRoomTypeFeaturePricing');
}
} else {
$errors[] = $this->moduleInstance->l('Update Information not found.', 'HotelRoomTypeFeaturePricing');
}
$result = array();
if (count($errors)) {
$result['status'] = 'failed';
$result['errors'] = $errors;
} else {
$result['status'] = 'success';
}
return $result;
}
/**
* [saveFeaturePricePlan add or update feature price plan]
* @param [int] $dateSelectionType [date selection type 1 or 2 (date range or specific date)]
* @param [array] $params [Room type rate plan info]
* @param integer $id [id of the feature price plan if 0 means to add else to update the feature price plan]
* @return [bool] [returns true is successfuly added or updated else returns false]
*/
public function saveFeaturePricePlan($dateSelectionType, $params, $id = 0)
{
if ($id) {
$roomTypeFeaturePricing = new HotelRoomTypeFeaturePricing($id);
} else {
$roomTypeFeaturePricing = new HotelRoomTypeFeaturePricing();
}
$roomTypeFeaturePricing->id_product = $params['roomTypeId'];
// lang fields
$languages = Language::getLanguages(false);
foreach ($languages as $language) {
$roomTypeFeaturePricing->feature_price_name[$language['id_lang']] = $params['featurePriceName'];
}
$roomTypeFeaturePricing->date_selection_type = $params['dateSelectionType'];
$roomTypeFeaturePricing->date_from = $params['dateFrom'];
$roomTypeFeaturePricing->date_to = $params['dateTo'];
$roomTypeFeaturePricing->impact_way = $params['priceImpactWay'];
$roomTypeFeaturePricing->is_special_days_exists = $params['isSpecialDaysExists'];
$roomTypeFeaturePricing->special_days = $params['jsonSpecialDays'];
$roomTypeFeaturePricing->impact_type = $params['priceImpactType'];
$roomTypeFeaturePricing->impact_value = $params['impactValue'];
$roomTypeFeaturePricing->active = $params['enableFeaturePrice'];
return $roomTypeFeaturePricing->save();
}
/**
* [getRoomTypeTotalPrice Returns Total price of the room type according to supplied dates].
*

View File

@@ -1,304 +0,0 @@
<?php
/**
* 2010-2020 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through this link for complete license : https://store.webkul.com/license.html
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to 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 <support@webkul.com>
* @copyright 2010-2020 Webkul IN
* @license https://store.webkul.com/license.html
*/
class QloRoomType extends QloWebservice
{
public function getRoomType($idHotel)
{
$objHotelRoomType = new HotelRoomType();
$idLang = $this->context->language->id;
$roomTypes = $objHotelRoomType->getRoomTypeByHotelId((int)$idHotel, $idLang);
$required = ['id', 'name', 'status'];
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('room_types', array());
foreach ($roomTypes as $roomType) {
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('room_type', array());
$roomType['name'] = $roomType['room_type'];
$roomType['id'] = $roomType['id_product'];
$roomType['status'] = $roomType['active'];
foreach ($roomType as $key => $value) {
if (in_array($key, $required)) {
$this->output .= $this->renderField($key, $value);
}
}
$this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('room_type', array());
}
$this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('room_types', array());
return $this->output;
}
public function getRoomRates(array $params)
{
$objRoomTypeFeaturePrice = new HotelRoomTypeFeaturePricing();
$idProd = 0;
if (isset($params['idRoomType'])) {
$idProd = $params['idRoomType'];
}
$rates = $objRoomTypeFeaturePrice->getHotelRoomTypesRatesAndInventoryByDate($params['idHotel'], $idProd, $params['dateFrom'], $params['dateTo']);
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('getRoomRatesApi', array());
foreach ($rates as $datewiseRate) {
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('rate_list', array());
foreach ($datewiseRate as $attr => $value) {
// how to put line written in else before if and no need to use else condition
if ($attr == 'room_types') {
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('room_types', array());
foreach ($value as $roomType) {
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('room_type', array());
foreach ($roomType as $roomTypeAttr => $roomTypeData) {
if ($roomTypeAttr == 'rates') {
$roomTypeData['tax_inc'] = $roomTypeData['total_price_tax_incl'];
$roomTypeData['tax_exc'] = $roomTypeData['total_price_tax_excl'];
unset($roomTypeData['total_price_tax_incl']);
unset($roomTypeData['total_price_tax_excl']);
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('rate', array());
foreach ($roomTypeData as $rateAttr => $rate) {
$this->output .= $this->renderField($rateAttr, $rate);
}
$this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('rate', array());
} else {
$this->output .= $this->renderField($roomTypeAttr, $roomTypeData);
}
}
$this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('room_type', array());
}
$this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('room_types', array());
} else {
$this->output .= $this->renderField($attr, $value);
}
}
$this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('rate_list', array());
}
$this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('getRoomRatesApi', array());
return $this->output;
}
public function updRoomRateAvail($availRateData)
{
$hotelId = $availRateData['Hotel']['id'];
$formatedData = [
'propertyId' => $hotelId,
'data' => [],
];
$rateData = $availRateData['Hotel']['rate_lists']['rate_list'];
foreach ($rateData as $dateWise) {
$formateSubData = array();
$formateSubData['dateFrom'] = $dateWise['date_range']['date_from'];
$formateSubData['dateTo'] = $dateWise['date_range']['date_to'];
if (isset($dateWise['date_range']['RoomTypeLists']['RoomType']['id'])) {
$roomTypeDetail = $dateWise['date_range']['RoomTypeLists']['RoomType'];
$formateSubData['roomType'][$roomTypeDetail['id']]['status'] = $roomTypeDetail['status'];
if (isset($roomTypeDetail['rate'])) {
$formateSubData['roomType'][$roomTypeDetail['id']]['rate'] = $roomTypeDetail['rate'];
}
if (isset($roomTypeDetail['Inventory'])) {
$formateSubData['roomType'][$roomTypeDetail['id']]['inventory'] = $roomTypeDetail['Inventory'];
}
} else {
foreach ($dateWise['date_range']['RoomTypeLists']['RoomType'] as $roomTypeDetail) {
$formateSubData['roomType'][$roomTypeDetail['id']]['status'] = $roomTypeDetail['status'];
if (isset($roomTypeDetail['rate'])) {
$formateSubData['roomType'][$roomTypeDetail['id']]['rate'] = $roomTypeDetail['rate'];
}
if (isset($roomTypeDetail['Inventory'])) {
$formateSubData['roomType'][$roomTypeDetail['id']]['inventory'] = $roomTypeDetail['Inventory'];
}
}
}
$formatedData['data'][] = $formateSubData;
}
$objRoomTypeFeaturePrice = new HotelRoomTypeFeaturePricing();
$objRoomTypeFeaturePrice->updateRoomTypesFeaturePricesAvailability($formatedData);
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('success', array());
$this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('success', array());
return $this->output;
}
// /**
// * Get address details by id_address
// *
// * @api /getaddress
// * @param int $idAddress
// * @return xml output
// */
// public function getaddress($idAddress)
// {
// $address = new Address($idAddress);
// if (!Validate::isLoadedObject($address)) {
// return false;
// }
// // convert object to array
// $address = json_decode(json_encode($address), true);
// $this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('address', array());
// $address['country'] = Country::getNameById($this->id_lang, $address['id_country']);
// $address['state'] = State::getNameById($address['id_state']);
// foreach ($address as $key => $addr) {
// $this->output .= $this->renderField($key, $addr);
// }
// $this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('address', array());
// return $this->output;
// }
// /**
// * [getCustomerAddress description]
// *
// * @api /getcustomeraddress
// * @param int $idCustomer
// * @return xml output
// */
// public function getCustomerAddress($idCustomer)
// {
// $customer = new Customer($idCustomer);
// if (!Validate::isLoadedObject($customer)) {
// return false;
// }
// $required = ['id', 'country', 'state', 'alias', 'company', 'lastname', 'firstname',
// 'address1', 'address2', 'postcode', 'city', 'other', 'other', 'phone_mobile', 'phone', 'deleted'];
// $addresses = $customer->getAddresses($this->id_lang);
// $this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('addresses', array());
// foreach ($addresses as $address) {
// $this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('address', array());
// $address['id'] = $address['id_address'];
// $address['country'] = Country::getNameById($this->id_lang, $address['id_country']);
// $address['state'] = State::getNameById($address['id_state']);
// foreach ($address as $key => $value) {
// if (in_array($key, $required)) {
// $this->output .= $this->renderField($key, $value);
// }
// }
// $this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('address', array());
// }
// $this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('addresses', array());
// return $this->output;
// }
// /**
// * Check is customer have his first address or not
// *
// * @api /checkfirstaddress
// * @param int $idCustomer
// * @return xml message
// */
// public function checkFirstAddressProcess($idCustomer)
// {
// if (Address::getFirstCustomerAddressId($idCustomer)) {
// return $this->getResult($this->mkmodule->l('Address exist for this customer.', 'mkaddress'), '1');
// }
// return $this->getResult($this->mkmodule->l('No address added by this customer yet.', 'mkaddress'), '0');
// }
// /**
// * Get required field in address from configuration
// *
// * @return xml node
// */
// public function addressConfiguration()
// {
// $requiredFields = AddressFormat::getFieldsRequired();
// $this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('required_fields', array());
// $this->output .= $this->renderField('phone_config', Configuration::get('PS_ONE_PHONE_AT_LEAST'));
// foreach ($requiredFields as $field) {
// if ($field !== 'Country:name') {
// $this->output .= $this->renderField($field, 1);
// }
// }
// $this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('required_fields', array());
// }
// /**
// * Get country and state list
// *
// * @api /getcountrieswithstates
// * @return [type] [description]
// */
// public function getCountriesWithStatesProcess()
// {
// $countries = Country::getCountries($this->id_lang, true);
// $this->output .= $this->addressConfiguration();
// $this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('countries', array());
// if ($countries) {
// foreach ($countries as $country) {
// // set if default country
// if ($country['id_country'] == Configuration::get('PS_COUNTRY_DEFAULT')) {
// $country['is_default'] = 1;
// } else {
// $country['is_default'] = 0;
// }
// // check if company field exist
// if ($this->isCompanyFieldAvailable($country['id_country'])) {
// $country['is_company'] = 1;
// } else {
// $country['is_company'] = 0;
// }
// $this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('country', array());
// $country['country_name'] = $country['country'];
// unset($country['country']);
// foreach ($country as $k => $c) {
// if ($k == 'states') {
// $this->output .= $this->objOutput->getObjectRender()->renderNodeHeader($k, array());
// foreach ($c as $s) {
// $this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('state', array());
// foreach ($s as $kkk => $ss) {
// $this->output .= $this->renderField($kkk, $ss);
// }
// $this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('state', array());
// }
// $this->output .= $this->objOutput->getObjectRender()->renderNodeFooter($k, array());
// } else {
// $this->output .= $this->renderField($k, $c);
// }
// }
// $this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('country', array());
// }
// }
// $this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('countries', array());
// return $this->output;
// }
// /**
// * Is 'company' field available while adding address
// *
// * @param int $idCountry
// * @return boolean
// */
// public function isCompanyFieldAvailable($idCountry)
// {
// if (in_array('company', AddressFormat::getOrderedAddressFields($idCountry, true, true))) {
// return true;
// }
// return false;
// }
}

View File

@@ -1,145 +0,0 @@
<?php
/**
* 2010-2020 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through this link for complete license : https://store.webkul.com/license.html
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to 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 <support@webkul.com>
* @copyright 2010-2020 Webkul IN
* @license https://store.webkul.com/license.html
*/
class QloWebservice
{
protected $objOutput;
protected $output;
protected $wsObject;
protected $mobikulGlobal; // Remove this
protected $mkGlobal;
protected $mkmodule;
protected $http;
protected $width;
public function __construct($objOutput = null, $wsObject = null, $output = null)
{
$this->objOutput = $objOutput;
$this->wsObject = $wsObject;
$this->output = $output;
// Need to remove these three settings, this should be handled by context
// $this->id_lang = (int)Configuration::get('PS_LANG_DEFAULT');
// $this->id_currency = (int)Configuration::get('PS_CURRENCY_DEFAULT');
// $this->currency = Currency::getCurrencyInstance((int) Configuration::get('PS_CURRENCY_DEFAULT'));
$this->setContext();
// $this->mkmodule = Module::getInstanceByName('mobikul');
// $this->mobikulGlobal = new MobikulGlobal($this->id_lang, $objOutput, $wsObject, $output); // Remove this
// $this->mkGlobal = new MobikulGlobal($this->id_lang, $objOutput, $wsObject, $output);
}
public function setContext()
{
$this->context = Context::getContext();
// // Set Customer
// if (isset($this->wsObject->urlFragments['id_customer'])) {
// $this->context->customer = new Customer($this->wsObject->urlFragments['id_customer']);
// }
// // Set language
// if (isset($this->wsObject->urlFragments['id_lang'])) {
// $language = new Language($this->wsObject->urlFragments['id_lang']);
// if (!Validate::isLoadedObject($language)) {
// $language = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
// }
// } else {
// $language = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
// }
$language = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
$this->context->language = $language;
// // Set Currency
// if (isset($this->wsObject->urlFragments['id_currency'])) {
// $currency = new Currency($this->wsObject->urlFragments['id_currency']);
// if (!Validate::isLoadedObject($currency)) {
// $language = new Language((int)Configuration::get('PS_CURRENCY_DEFAULT'));
// }
// } else {
// $currency = new Currency((int)Configuration::get('PS_CURRENCY_DEFAULT'));
// }
$currency = new Currency((int)Configuration::get('PS_CURRENCY_DEFAULT'));
$this->context->currency = $currency;
}
public function getResult($message, $status = null, $args = array(), $xml = false)
{
$this->output .= $this->objOutput->getObjectRender()->renderNodeHeader('response', array());
if ($status !== null) {
$this->output .= $this->renderField('status', $status);
}
$this->output .= $this->renderField('message', $message);
if (is_array($args) && !empty($args)) {
foreach ($args as $key => $value) {
$this->output .= $this->renderField($key, $value);
}
}
if ($xml) {
$this->output .= $xml;
}
$this->output .= $this->objOutput->getObjectRender()->renderNodeFooter('response', array());
return $this->output;
}
/**
* Create just like PS renderField function in WebServiceOutputXML class
* @todo :: to be mode functional with attributes and others
* @param [type] $nodeName
* @param [type] $value
* @return [type] xml node
*/
public function renderField($nodeName, $value = null)
{
$node_content = '<![CDATA['.$value.']]>';
return '<'.$nodeName.'>'.$node_content.'</'.$nodeName.'>'."\n";
}
// public function displayPrice($price, $idCurrency = false)
// {
// if ($idCurrency) {
// $this->currency = Currency::getCurrencyInstance($idCurrency);
// } elseif (isset($this->wsObject->urlFragments['id_currency'])) {
// $this->currency = Currency::getCurrencyInstance($this->wsObject->urlFragments['id_currency']);
// } else {
// $this->currency = Currency::getCurrencyInstance((int) Configuration::get('PS_CURRENCY_DEFAULT'));
// }
// $defaultCurrencyInstance = Currency::getCurrencyInstance((int) Configuration::get('PS_CURRENCY_DEFAULT'));
// if (Validate::isLoadedObject($this->currency)) {
// $price = Tools::ps_round((float) $price, (int) $this->currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
// $convertedPrice = Tools::convertPrice($price, $this->currency, $defaultCurrencyInstance);
// return Tools::displayPrice($convertedPrice, $this->currency);
// } else {
// return $price;
// }
// }
// public function getProductPrice($id_product, $tax = true, $id_product_attribute = null, $decimals = 6,
// $divisor = null, $only_reduc = false, $usereduc = true, $quantity = 1, $force_associated_tax = false, $id_customer = null)
// {
// return Product::getPriceStatic((int)$id_product, $tax, $id_product_attribute, $decimals, $divisor, $only_reduc, $usereduc, $quantity, $force_associated_tax, $id_customer);
// }
}

View File

@@ -113,17 +113,18 @@ class RoomTypeServiceProductPrice extends ObjectModel
$idHotel,
$idProductOption = null,
$useTax = null,
$quantity = 1
$quantity = 1,
$useReduc = true
) {
$idHotelAddress = Cart::getIdAddressForTaxCalculation($idProduct, $idHotel);
$price = ProductCore::getPriceStatic(
$price = Product::getPriceStatic(
$idProduct,
$useTax,
$idProductOption,
6,
null,
false,
true,
$useReduc,
$quantity,
false,
null,

View File

@@ -168,7 +168,7 @@ class ServiceProductCartDetail extends ObjectModel
$sql = 'SELECT spc.*, p.`selling_preference_type`, hcbd.`date_from`, spc.`id_cart` as service_id_cart, hcbd.`date_to`, p.`price_calculation_method`, hcbd.`id_product` as `id_product_room_type`';
if (!$getTotalPrice) {
$sql .= ', hbil.`hotel_name` ';
$sql .= ', hbil.`hotel_name`, p.`auto_add_to_cart`, p.`price_addition_type` ';
}
$sql .= ' FROM `'._DB_PREFIX_.'service_product_cart_detail` spc';
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'product` p ON (p.`id_product` = spc.`id_product`)';
@@ -310,6 +310,9 @@ class ServiceProductCartDetail extends ObjectModel
'total_price_tax_excl' => $priceTaxExcl * (int)$product['quantity'] * $numDays,
'cover_img' => $coverImg,
'price_calculation_method' => $product['price_calculation_method'],
'auto_add_to_cart' => $product['auto_add_to_cart'],
'price_addition_type' => $product['price_addition_type'],
'total_price' => ($useTax ? $priceTaxIncl * (int)$product['quantity'] * $numDays : $priceTaxExcl * (int)$product['quantity'] * $numDays),
);
if ($product['htl_cart_booking_id']) {
@@ -426,7 +429,13 @@ class ServiceProductCartDetail extends ObjectModel
$objServiceProductCartDetail->id_product_option = $idProductOption;
}
$objServiceProductCartDetail->quantity += $quantity;
$objProduct = new Product((int) $idProduct);
if ($objProduct->allow_multiple_quantity) {
$objServiceProductCartDetail->quantity += $quantity;
} else {
$objServiceProductCartDetail->quantity = 1;
}
if ($objServiceProductCartDetail->save()) {
$objCart = new Cart($idCart);
return $objCart->updateQty($quantity, $idProduct);
@@ -468,7 +477,7 @@ class ServiceProductCartDetail extends ObjectModel
if ($quantity) {
$removedQuantity = $quantity;
$objServiceProductCartDetail->quantity -= $quantity;
if ($objServiceProductCartDetail->quantity) {
if ($objServiceProductCartDetail->quantity > 1) {
$updateQunatity = $objServiceProductCartDetail->save();
} else {
$updateQunatity = $objServiceProductCartDetail->delete();

View File

@@ -95,11 +95,26 @@ class ServiceProductOrderDetail extends ObjectModel
$sql .= ' AND od.`selling_preference_type` = '.(int)$sellingPreferenceType;
}
$products = Db::getInstance()->executeS($sql);
foreach ($products as $key => $product) {
// Check if this booking as any refund history then enter refund data
if ($refundInfo = OrderReturn::getOrdersReturnDetail($idOrder, 0, 0, $product['id_service_product_order_detail'])) {
$products[$key]['refund_info'] = reset($refundInfo);
if ($products = Db::getInstance()->executeS($sql)) {
$objContext = Context::getContext();
$defaultImageLink = $objContext->link->getImageLink('', $objContext->language->iso_code.'-default', 'small_default');
foreach ($products as $key => $product) {
// Check if this booking as any refund history then enter refund data
if ($refundInfo = OrderReturn::getOrdersReturnDetail($idOrder, 0, 0, $product['id_service_product_order_detail'])) {
$products[$key]['refund_info'] = reset($refundInfo);
}
$products[$key]['cover_image'] = $defaultImageLink;
$products[$key]['allow_multiple_quantity'] = 0;
if (Validate::isLoadedObject($objProduct = new Product((int) $product['id_product'], Configuration::get('PS_LANG_DEFAULT')))) {
$products[$key]['allow_multiple_quantity'] = $objProduct->allow_multiple_quantity;
if ($productCoverImg = Product::getCover($product['id_product'])) {
$products[$key]['cover_image'] = $objContext->link->getImageLink(
$objProduct->link_rewrite[Configuration::get('PS_LANG_DEFAULT')],
$productCoverImg['id_image'], 'small_default'
);
}
}
}
}
@@ -127,13 +142,15 @@ class ServiceProductOrderDetail extends ObjectModel
$sql = 'SELECT spod.*';
if (!$getTotalPrice) {
$sql .= ', hbd.`id_product` as `id_room_type`, od.`product_allow_multiple_quantity`, od.`product_price_calculation_method`, hbd.`id_room`, hbd.`adults`, hbd.`children`, hbd.`id_product`, hbd.`date_from`, hbd.`date_to`, hbd.`room_type_name`, spod.`id_product` as id_product';
$sql .= ', hbd.`id_product` as `id_room_type`, od.`product_price_calculation_method`,
hbd.`id_room`, hbd.`adults`, hbd.`children`, hbd.`date_from`, hbd.`date_to`, hbd.`room_type_name`,
spod.`id_product` as id_product, od.`product_allow_multiple_quantity`, od.`product_price_calculation_method`, od.`product_auto_add`, od.`product_price_addition_type`';
}
$sql .= ' FROM `'._DB_PREFIX_.'htl_booking_detail` hbd
LEFT JOIN `'._DB_PREFIX_.'service_product_order_detail` spod ON(spod.`id_htl_booking_detail` = hbd.`id`)';
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON(od.`id_order_detail` = spod.`id_order_detail`)';
$sql .= ' WHERE 1';
$sql .= ' WHERE spod.`id_htl_booking_detail` IS NOT NULL';
if ($idOrder) {
$sql .= ' AND spod.`id_order` = '.(int)$idOrder;
@@ -210,6 +227,8 @@ class ServiceProductOrderDetail extends ObjectModel
'total_price_tax_incl' => $product['total_price_tax_incl'],
'unit_price_tax_excl' => $product['unit_price_tax_excl'],
'unit_price_tax_incl' => $product['unit_price_tax_incl'],
'product_auto_add' => $product['product_auto_add'],
'product_price_addition_type' => $product['product_price_addition_type'],
);
} else {
$selectedAdditionalServices[$product['id_htl_booking_detail']]['id_order'] = $product['id_order'];
@@ -240,6 +259,8 @@ class ServiceProductOrderDetail extends ObjectModel
'total_price_tax_incl' => $product['total_price_tax_incl'],
'unit_price_tax_excl' => $product['unit_price_tax_excl'],
'unit_price_tax_incl' => $product['unit_price_tax_incl'],
'product_auto_add' => $product['product_auto_add'],
'product_price_addition_type' => $product['product_price_addition_type'],
),
);
}
@@ -319,7 +340,7 @@ class ServiceProductOrderDetail extends ObjectModel
'max_quantity' => $product['max_quantity'],
'product_auto_add' => $product['product_auto_add'],
'product_price_addition_type' => $product['product_price_addition_type'],
'product_price_calculation_method' => $product['product_price_calculation_method'],
'price_calculation_method' => $product['product_price_calculation_method'],
'unit_price_tax_excl' => $product['unit_price_tax_excl'],
'unit_price_tax_incl' => $product['unit_price_tax_incl'],
'total_price_tax_excl' => $product['total_price_tax_excl'],
@@ -346,7 +367,7 @@ class ServiceProductOrderDetail extends ObjectModel
'max_quantity' => $product['max_quantity'],
'product_auto_add' => $product['product_auto_add'],
'product_price_addition_type' => $product['product_price_addition_type'],
'product_price_calculation_method' => $product['product_price_calculation_method'],
'price_calculation_method' => $product['product_price_calculation_method'],
'unit_price_tax_excl' => $product['unit_price_tax_excl'],
'unit_price_tax_incl' => $product['unit_price_tax_incl'],
'total_price_tax_excl' => $product['total_price_tax_excl'],

View File

@@ -1,185 +0,0 @@
<?php
/**
* 2010-2020 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through this link for complete license : https://store.webkul.com/license.html
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to 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 <support@webkul.com>
* @copyright 2010-2020 Webkul IN
* @license https://store.webkul.com/license.html
*/
class WebserviceSpecificManagementQlo implements WebserviceSpecificManagementInterface
{
protected $objOutput;
protected $output;
protected $wsObject;
public $id_lang;
public $id_customer;
public $id_currency;
public $mobikulGlobal;
public function __construct()
{
ini_set('memory_limit', '256M');
$psCurrencyDefault = (int) Configuration::get('PS_CURRENCY_DEFAULT');
$this->context = Context::getContext();
$this->id_lang = Configuration::get('PS_LANG_DEFAULT');
$this->id_currency = $psCurrencyDefault;
$this->currency = Currency::getCurrencyInstance($psCurrencyDefault);
}
public function setObjectOutput(WebserviceOutputBuilderCore $obj)
{
$this->objOutput = $obj;
return $this;
}
public function getObjectOutput()
{
return $this->objOutput;
}
public function setWsObject(WebserviceRequestCore $obj)
{
$this->wsObject = $obj;
return $this;
}
public function getWsObject()
{
return $this->wsObject;
}
// written in alphabatical order
public function manage()
{
$this->wsQloCRUD();
return $this->wsObject->getOutputEnabled();
}
protected $allowedMethods = array(
'getRoomTypes' => array(),
'getRoomRates' => array(),
'updRoomRateAvail' => array(),
);
public function getContent()
{
if ($this->output != '') {
$outputXML = $this->objOutput->getObjectRender()->overrideContent($this->output);
if (isset($this->wsObject->urlFragments['outputformat']) && $this->wsObject->urlFragments['outputformat'] == 'json') {
$outputXML = simplexml_load_string($outputXML, null, LIBXML_NOCDATA);
$json = json_encode($outputXML);
$content = preg_replace_callback("/\\\\u([a-f0-9]{4})/", function ($matches) {
return iconv('UCS-4LE', 'UTF-8', pack('V', hexdec($matches[1])));
}, $json);
header('Content-Type: application/json');
die($content);
} else {
return $outputXML;
}
}
}
protected function wsQloCRUD()
{
$objQloRoomType = new QloRoomType($this->objOutput, $this->wsObject, $this->output);
switch ($this->wsObject->method) {
case 'GET':
switch ($this->wsObject->urlSegment[1]) {
case 'getRoomTypes':
if (!isset($this->wsObject->urlFragments['id_hotel'])) {
throw new WebserviceException('You have to set \'id_hotel\' parameter to get a result', array(100, 400));
}
$this->output .= $objQloRoomType->getRoomType($this->wsObject->urlFragments['id_hotel']);
break;
case 'getRoomRates':
if (!isset($this->wsObject->urlFragments['id_hotel']) ) {
throw new WebserviceException('You have to set \'id_hotel\', \'date_from\' and \'date_to\'parameters to get a result', array(100, 400));
}
$dateFrom = isset($this->wsObject->urlFragments['date_from']) ? $this->wsObject->urlFragments['date_from'] : date('Y-m-d');
$dateTo = isset($this->wsObject->urlFragments['date_to']) ? $this->wsObject->urlFragments['date_to'] : date('Y-m-d', strtotime($dateFrom.' + 1 day'));
$kwargs = array(
'idHotel' => $this->wsObject->urlFragments['id_hotel'],
'dateFrom' => $dateFrom,
'dateTo' => $dateTo,
'idRoomType' => isset($this->wsObject->urlFragments['id_room_type']) ? $this->wsObject->urlFragments['id_room_type'] : 0,
);
$this->output .= $objQloRoomType->getRoomRates($kwargs);
break;
default:
$exception = new WebserviceException(sprintf('Method with name "%s" does not exist in Qlo Library,', $this->wsObject->urlSegment[1]), array(48, 400));
throw $exception->setDidYouMean($this->wsObject->urlSegment[1], array_keys($this->allowedMethods));
}
break;
case 'POST':
switch ($this->wsObject->urlSegment[1]) {
case 'updRoomRateAvail':
$fields = $this->getXMLFields('updRoomRateAvail');
if (!isset($fields)) {
throw new WebserviceException('Send XML formated data', array(100, 400));
}
$this->output .= $objQloRoomType->updRoomRateAvail($fields);
break;
}
break;
default :
throw new WebserviceException('This HTTP method is not allowed', array(67, 405));
}
}
public function getXMLFields($head = false)
{
$putresource = fopen('php://input', 'r');
$inputXML = '';
while ($putData = fread($putresource, 1024)) {
$inputXML .= $putData;
}
fclose($putresource);
// If xml
if (simplexml_load_string($inputXML)) {
if (isset($inputXML) && strncmp($inputXML, 'xml=', 4) == 0) {
$inputXML = Tools::substr($inputXML, 4);
}
} else {
// If input type is json
$array = json_decode($inputXML, true);
if (isset($array['json']) && $array['json'] && isset($array[$head])) {
return ($head ? $array[$head] : $array);
} else {
WebserviceRequest::getInstance()->setError(500, 'Invalid json.', 127);
return;
}
}
try {
$xml = new SimpleXMLElement($inputXML);
} catch (Exception $error) {
WebserviceRequest::getInstance()->setError(500, 'XML error : '.$error->getMessage()."\n".'XML length : '.Tools::strlen($inputXML)."\n".'Original XML : '.$inputXML, 127);
return;
}
$xmlEntities = $xml->children();
// Convert multi-dimention xml into an array
$array = json_decode(json_encode($xmlEntities), true);
return ($head ? $array[$head] : $array);
}
}

View File

@@ -143,12 +143,25 @@ class AdminHotelBedTypesController extends ModuleAdminController
return;
}
if (!trim(Tools::getValue('width'))) {
$this->errors[] = $this->l('Field Width is required');
$defaultLangId = Configuration::get('PS_LANG_DEFAULT');
$objDefaultLanguage = Language::getLanguage((int) $defaultLangId);
$languages = Language::getLanguages(false);
if (!trim(Tools::getValue('name_'.$defaultLangId))) {
$this->errors[] = $this->l('Bed type name is required at least in ').$objDefaultLanguage['name'];
} else {
foreach ($languages as $lang) {
if (trim(Tools::getValue('name_'.$lang['id_lang'])) && !Validate::isGenericName(Tools::getValue('name_'.$lang['id_lang']))) {
$this->errors[] = $this->l('Invalid bed type name in ').$lang['name'];
}
}
}
if (!trim(Tools::getValue('length'))) {
$this->errors[] = $this->l('Field Length is required');
if (!(float) Tools::getValue('width')) {
$this->errors[] = $this->l('The width field is required');
}
if (!(float) Tools::getValue('length')) {
$this->errors[] = $this->l('The length field is required');
}
return parent::processSave();

View File

@@ -36,7 +36,7 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
$this->allow_export = true;
$this->_new_list_header_design = true;
if ($idOrder = Tools::getValue('id_order')) {
$this->_select .= ', orsl.`name` as `status_name`, ors.`color`, COUNT(ordrd.`id_order_return_detail`) as num_rooms';
$this->_select .= ', orsl.`name` as `status_name`, ors.`color`, SUM(IF((ordrd.id_htl_booking != 0) , 1, 0)) as num_rooms, SUM(IF((ordrd.id_service_product_order_detail != 0) , 1, 0)) as num_products';
$this->_join .= 'LEFT JOIN '._DB_PREFIX_.'order_return_state ors ON (ors.`id_order_return_state` = a.`state`)';
$this->_join .= 'LEFT JOIN '._DB_PREFIX_.'order_return_state_lang orsl ON (orsl.`id_order_return_state` = a.`state` AND orsl.`id_lang` = '.(int)$this->context->language->id.')';
$this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'order_return_detail` ordrd ON (a.`id_order_return` = ordrd.`id_order_return`)';
@@ -60,6 +60,11 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
if ($idOrder = Tools::getValue('id_order')) {
$refundStatuses = OrderReturnStateCore::getOrderReturnStates($this->context->language->id);
// to set columns for products and rooms count in render list
$objOrderReturn = new OrderReturn();
$refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($idOrder);
$refundReqProducts = $objOrderReturn->getOrderRefundRequestedProducts($idOrder);
$retStatuses = array();
foreach ($refundStatuses as $status) {
$retStatuses[$status['id_order_return_state']] = $status['name'];
@@ -82,11 +87,21 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
'havingFilter' => true,
'callback' => 'setCustomerLink',
);
$this->fields_list['num_rooms'] = array(
'title' => $this->l('Total Rooms'),
'align' => 'center',
'havingFilter' => true,
);
if ($refundReqBookings) {
$this->fields_list['num_rooms'] = array(
'title' => $this->l('Total Rooms'),
'align' => 'center',
'havingFilter' => true,
);
}
if ($refundReqProducts) {
$this->fields_list['num_products'] = array(
'title' => $this->l('Total Products'),
'align' => 'center',
'havingFilter' => true,
);
}
$this->fields_list['refunded_amount'] = array(
'title' => $this->l('Refunded Amount'),
'align' => 'center',
@@ -299,9 +314,7 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
}
}
if ($refundReqProducts = $objOrderReturn->getOrderRefundRequestedProducts($objOrderReturn->id_order, $objOrderReturn->id)){
}
$refundReqProducts = $objOrderReturn->getOrderRefundRequestedProducts($objOrderReturn->id_order, $objOrderReturn->id);
$paymentMethods = array();
foreach (PaymentModule::getInstalledPaymentModules() as $payment) {

View File

@@ -41,8 +41,6 @@ require_once 'classes/HotelRoomTypeDemandPrice.php';
require_once 'classes/HotelRoomTypeDemand.php';
require_once 'classes/HotelRoomTypeRestrictionDateRange.php';
require_once 'classes/QloWebservice.php';
require_once 'classes/QloRoomType.php';
require_once 'classes/HotelRoomDisableDates.php';
require_once 'classes/HotelBranchRefundRules.php';
require_once 'classes/HotelBedType.php';
@@ -60,5 +58,4 @@ require_once 'classes/HotelSettingsLink.php';
require_once 'classes/HotelBookingDocument.php';
// Web services classes
require_once 'classes/WebserviceSpecificManagementQlo.php';
require_once 'classes/WebserviceSpecificManagementHotelAri.php';

View File

@@ -54,10 +54,8 @@ class HotelReservationSystem extends Module
'room_bookings' => array('description' => 'Room bookings', 'class' => 'HotelBookingDetail'),
'booking_extra_demands' => array('description' => 'Booking extra demands', 'class' => 'HotelBookingDemands'),
'extra_demands' => array('description' => 'Extra demands', 'class' => 'HotelRoomTypeGlobalDemand'),
'extra_services' => array('description' => 'Extra services', 'class' => 'Product', 'parameters_attribute' => 'webserviceRoomTypeServicesParameters'),
'demand_advance_options' => array('description' => 'Extra demand advance options', 'class' => 'HotelRoomTypeGlobalDemandAdvanceOption'),
'hotel_ari' => array('description' => 'Search availability, rates and inventory', 'specific_management' => true),
'qlo' => array('description' => 'qlo API', 'specific_management' => true),
);
return $resources;
@@ -510,6 +508,7 @@ class HotelReservationSystem extends Module
'htl_room_type_global_demand_advance_option',
'htl_order_refund_rules',
'htl_settings_link',
'htl_bed_type'
);
//If Admin update new language when we do entry in module all lang tables.
HotelHelper::updateLangTables($newIdLang, $langTables);

View File

@@ -81,14 +81,26 @@
{displayPrice price=$orderTotalPaid currency=$orderInfo['id_currency']}
</div>
</div>
<div class="form-group row">
<div class="col-sm-3">
<strong>{l s='Total rooms' mod='hotelreservationsystem'} :</strong>
</div>
<div class="col-sm-9">
{$refundReqBookings|count}
</div>
</div>
{if isset($refundReqBookings) && $refundReqBookings}
<div class="form-group row">
<div class="col-sm-3">
<strong>{l s='Total rooms' mod='hotelreservationsystem'} :</strong>
</div>
<div class="col-sm-9">
{$refundReqBookings|count}
</div>
</div>
{/if}
{if isset($refundReqProducts) && $refundReqProducts}
<div class="form-group row">
<div class="col-sm-3">
<strong>{l s='Total products' mod='hotelreservationsystem'} :</strong>
</div>
<div class="col-sm-9">
{$refundReqProducts|count}
</div>
</div>
{/if}
<div class="form-group row">
<div class="col-sm-3">
<strong>{l s='Way of payment' mod='hotelreservationsystem'} :</strong>
@@ -263,7 +275,7 @@
<td><input type="checkbox" name="id_order_return_detail[]" value="{$product['id_order_return_detail']|escape:'html':'UTF-8'}" checked/></td>
{/if}
<td>{$product['name']|escape:'htmlall':'UTF-8'}{if isset($product['option_name']) && $product['option_name']} : {$product['option_name']|escape:'htmlall':'UTF-8'}{/if}</td>
<td>{$product['quantity']|escape:'htmlall':'UTF-8'}</td>
<td>{if $product['allow_multiple_quantity']}{$product['quantity']|escape:'htmlall':'UTF-8'}{else}--{/if}</td>
<td>{displayPrice price=$product['total_price_tax_incl'] currency=$orderCurrency['id']}</td>
<td>{displayPrice price=$product['paid_amount'] currency=$orderCurrency['id']}</td>
{if $hasOrderDiscountOrPayment || $isRefundCompleted}

View File

@@ -41,8 +41,8 @@ $(document).ready(function()
$("#filter_price_silder").slider("values", [min_price, max_price]);
var slider_price_cont = filter_wrapper.find("div.price_filter_subcont");
slider_price_cont.find("span#filter_price_from").html(min_price);
slider_price_cont.find("span#filter_price_to").html(max_price);
slider_price_cont.find("span#filter_price_from").html(formatCurrency(min_price, currencyFormat, currencySign, currencyBlank));
slider_price_cont.find("span#filter_price_to").html(formatCurrency(max_price, currencyFormat, currencySign, currencyBlank));
/* -------NOTICE------- */
//triggerFilter();

View File

@@ -192,7 +192,7 @@ class wkhotelfilterblock extends Module
if (!($date_to = Tools::getValue('date_to'))) {
$date_to = date('Y-m-d H:i:s', strtotime($date_from) + 86400);
} else {
$urlData['date_from'] = $date_to;
$urlData['date_to'] = $date_to;
}
if ($occupancy = Tools::getValue('occupancy')) {

View File

@@ -192,8 +192,6 @@ class WkRoomSearchHelper
$searchedData['order_date_restrict'] = true;
}
}
$smartyVars['search_data'] = $searchedData;
}
if ($occupancyEnabled) {

View File

@@ -388,10 +388,11 @@ $(document).ready(function() {
start_date.setHours(0, 0, 0, 0);
}
let selectedDateFrom = new Date(Date.parse(dateFrom));
let selectedDateTo = new Date(Date.parse(dateTo));
// Using the Date object will also add extra hours according to the timezone.
let selectedDateFrom = $.datepicker.parseDate('yy-mm-dd', dateFrom);
let selectedDateTo = $.datepicker.parseDate('yy-mm-dd', dateTo);
if (max_order_date) {
max_order_date = $.datepicker.parseDate('yy-mm-dd', max_order_date );
max_order_date = $.datepicker.parseDate('yy-mm-dd', max_order_date);
} else {
max_order_date = false;
}

View File

@@ -32,8 +32,8 @@
{/if}
</td> -->
<td width="33%">
<span class="bold">{l s='Hotel Detail' pdf='true'}</span><br/><br/>
{if $hotel_address}
{if !empty($hotel_address)}
<span class="bold">{l s='Hotel Detail' pdf='true'}</span><br/><br/>
{$hotel_address}
{/if}
</td>

View File

@@ -24,7 +24,7 @@
*}
{if isset($cart_htl_data) && $cart_htl_data}
<table class="product" class="bordered-table" width="100%" cellpadding="4" cellspacing="0">
<table class="bordered-table" width="100%" cellpadding="4" cellspacing="0">
<thead>
<tr>
<th colspan="{if $display_product_images}8{else}7{/if}" class="header">{l s='Rooms Details' pdf='true'}</th>
@@ -50,7 +50,7 @@
{foreach from=$cart_htl_data key=data_k item=data_v}
{foreach from=$data_v['date_diff'] key=rm_k item=rm_v}
{cycle values=["color_line_even", "color_line_odd"] assign=bgcolor_class}
<tr class="product {$bgcolor_class}">
<tr class="{$bgcolor_class}">
{if $display_product_images}
<td class="cart_product">
<img src="{$data_v['cover_img']}" class="thumbnail" />

View File

@@ -42,11 +42,11 @@
<tbody>
{foreach $service_product_data as $product}
{cycle values=["color_line_even", "color_line_odd"] assign=bgcolor_class}
<tr class="product {$bgcolor_class}">
<tr class="{$bgcolor_class}">
{if $display_product_images}
<td class="product center">
{if isset($product.image) && $product.image->id}
{$product.image_tag}
<td class="cart_product">
{if isset($product['cover_image']) && $product['cover_image']}
<img src="{$product['cover_image']}" class="thumbnail" />
{/if}
</td>
{/if}

View File

@@ -27,7 +27,7 @@
<table class="bordered-table" width="100%" cellpadding="4" cellspacing="0">
<thead>
<tr>
<th colspan="4" class="header">{l s='Room Bookings Detail' pdf='true'}</th>
<th colspan="5" class="header">{l s='Room Bookings Detail' pdf='true'}</th>
</tr>
<tr>
<th class="product header">{l s='Room Type / Reference' pdf='true'}</th>

View File

@@ -280,12 +280,12 @@
<div class="total_price_block col-xs-7 form-group">
<label class="control-label">{l s='Price'}</label>
<p>
{if $service_price && $service_price_without_reduction > $service_price}
<span class="room_type_old_price">
{convertPrice price=$service_price_without_reduction|floatval}
</span>
{/if}
{convertPrice price=$service_price}
{* {if !$priceDisplay || $priceDisplay == 2}
{convertPrice price=$product->getPrice(true, $smarty.const.NULL, 6)|floatval}
{elseif $priceDisplay == 1}
{convertPrice price=$product->getPrice(false, $smarty.const.NULL, 6)|floatval}
{/if} *}
</p>
</div>
{/block}

View File

@@ -52,12 +52,14 @@
<div class="description-list">
<dl class="">
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Quantity'}</dt>
<dd class="col-xs-7">{$product.quantity}</dd>
{if $product.allow_multiple_quantity}
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Quantity'}</dt>
<dd class="col-xs-7">{$product.quantity}</dd>
</div>
</div>
</div>
{/if}
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Unit Price'}</dt>
@@ -72,8 +74,10 @@
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
</div>
{if $product.allow_multiple_quantity}
<div class="col-xs-12 col-md-6">
</div>
{/if}
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Total Pricing'}</dt>

View File

@@ -23,7 +23,15 @@
<div class="col-sm-6">
<strong>
{if $message.id_employee}
{$obj_hotel_branch_information->hotel_name|escape:'html':'UTF-8'}
{if isset($obj_hotel_branch_information->hotel_name) && $obj_hotel_branch_information->hotel_name}
{$obj_hotel_branch_information->hotel_name|escape:'html':'UTF-8'}
{elseif isset($message.elastname) && $message.elastname}
{$message.efirstname|escape:'html':'UTF-8'} {$message.elastname|escape:'html':'UTF-8'}
{elseif $message.clastname}
{$message.cfirstname|escape:'html':'UTF-8'} {$message.clastname|escape:'html':'UTF-8'}
{else}
{$shop_name|escape:'html':'UTF-8'}
{/if}
{else}
{$message.cfirstname|escape:'html':'UTF-8'} {$message.clastname|escape:'html':'UTF-8'}
{/if}

View File

@@ -52,12 +52,14 @@
<div class="description-list">
<dl class="">
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Quantity'}</dt>
<dd class="col-xs-7">{$product.quantity}</dd>
{if $product.allow_multiple_quantity}
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Quantity'}</dt>
<dd class="col-xs-7">{$product.quantity}</dd>
</div>
</div>
</div>
{/if}
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Unit Price'}</dt>
@@ -72,8 +74,10 @@
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
</div>
{if $product.allow_multiple_quantity}
<div class="col-xs-12 col-md-6">
</div>
{/if}
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Total Pricing'}</dt>

View File

@@ -20,9 +20,9 @@
{block name='displayRoomTypeListBefore'}
{hook h='displayRoomTypeListBefore'}
{/block}
{if isset($booking_data['stats']) && $booking_data['stats']['num_avail'] || isset($display_all_room_types) && $display_all_room_types && isset($booking_data['rm_data'])}
{if !empty($booking_data['rm_data']) && (isset($booking_data['stats']) && $booking_data['stats']['num_avail'] || !empty($display_all_room_types))}
{foreach from=$booking_data['rm_data'] key=room_k item=room_v}
{if $room_v['data']['available']|count || isset($display_all_room_types) && $display_all_room_types }
{if $room_v['data']['available']|count || !empty($display_all_room_types) }
<div class="col-sm-12 room_cont" data-id-product="{$room_v['id_product']|escape:'htmlall':'UTF-8'}">
<div class="row">
{block name='room_type_list_room_image'}
@@ -41,7 +41,7 @@
<div class="row">
<p class="rm_heading col-sm-12 col-md-7">{$room_v['name']|escape:'htmlall':'UTF-8'}</p>
{if !isset($restricted_country_mode) && !$PS_CATALOG_MODE && !$order_date_restrict}
<p class="rm_left col-sm-12 col-md-5" {if isset($display_all_room_types) && $display_all_room_types || $room_v['room_left'] > $warning_num} style="display:none"{/if}>
<p class="rm_left col-sm-12 col-md-5" {if !empty($display_all_room_types) || $room_v['room_left'] > $warning_num} style="display:none"{/if}>
{l s='Hurry!'} <span class="remain_rm_qty">{$room_v['room_left']|escape:'htmlall':'UTF-8'}</span> {l s='rooms left'}
</p>
{/if}

View File

@@ -901,15 +901,19 @@ var ajaxCart = {
content += '</div>';
}
content += '<div class="cart-info-sec rm_product_info_' + productId + '">';
content += '<span class="product_info_label">' + total_qty_txt + ':</span>';
if (product.booking_product || product.allow_multiple_quantity) {
content += '<span class="product_info_label">' + total_qty_txt + ':</span>';
}
content += '<span class="quantity-formated">';
content += '<span class="quantity product_info_data">';
if (product.booking_product) {
content += product.bookingData.total_num_rooms;
} else if (typeof(hotel_wise_data) != 'undefined' && hotel_wise_data.total_qty) {
content += hotel_wise_data.total_qty;
} else {
content += product.cart_quantity;
} else if (product.allow_multiple_quantity) {
if (typeof(hotel_wise_data) != 'undefined' && hotel_wise_data.total_qty) {
content += hotel_wise_data.total_qty;
} else {
content += product.cart_quantity;
}
}
content += '</span>';
content += '</span>';
@@ -1186,6 +1190,7 @@ var ajaxCart = {
product.date_from + ' - ' + product.date_to
);
$('#layer_cart_product_hotel_name').parent().hide();
$('#layer_cart_product_quantity').parent().show();
var product_quantity_text = '';
if(parseInt(product.booking_product)) {
let rooms = 0;
@@ -1202,7 +1207,11 @@ var ajaxCart = {
product_quantity_text = product.occupancy;
}
} else {
product_quantity_text = product.qty;
if (product.allow_multiple_quantity) {
product_quantity_text = product.qty;
} else {
$('#layer_cart_product_quantity').parent().hide();
}
$('#layer_cart_product_unit_price').text(product.unit_price);
if (product.hotel_name) {
$('#layer_cart_product_hotel_name').text(product.hotel_name).parent().show();

View File

@@ -118,14 +118,12 @@ $(document).ready(function()
validateCustomerGuestDetailForm();
}
$(document).on('click', '.submit-guest-details', function(e) {
e.preventDefault();
if ($('#customer_guest_detail').prop('checked')) {
validateCustomerGuestDetailForm();
e.preventDefault();
if ($('#customer_guest_detail_form').find('.form-error').length == 0) {
$('#customer_guest_detail_form').get(0).submit();
}
} else {
$('#customer_guest_detail_form').get(0).submit();
}
});

View File

@@ -48,11 +48,11 @@
{block name='blockcart_shopping_cart_product_quantity'}
<div class="cart-info-sec rm_product_info_{$product.id_product}">
<span class="product_info_label">{l s='Total Qty.' mod='blockcart'}:</span>
{if $product.allow_multiple_quantity || $product.booking_product}<span class="product_info_label">{l s='Total Qty.' mod='blockcart'}:</span>{/if}
<span class="quantity-formated">
{if $product.booking_product}
<span class="quantity product_info_data">{$product.bookingData['total_num_rooms']}</span>
{else}
{elseif $product.allow_multiple_quantity}
{if $product.selling_preference_type == Product::SELLING_PREFERENCE_HOTEL_STANDALONE || $product.selling_preference_type == Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE}
<span class="quantity product_info_data">{$hotel_wise_data.total_qty}</span>
{elseif $product.selling_preference_type == Product::SELLING_PREFERENCE_STANDALONE}
@@ -65,7 +65,7 @@
</div>
<span class="remove_link">
{if !isset($customizedDatas.$productId.$productAttributeId) && (!isset($product.is_gift) || !$product.is_gift)}
<a class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&token={$static_token}")|escape:'html':'UTF-8'}{if isset($hotel_wise_data) && $hotel_wise_data.id_hotel}&id_hotel={$hotel_wise_data.id_hotel|escape:'html':'UTF-8'}{/if}" rel="nofollow" title="{l s='remove this product from my cart' mod='blockcart'}">&nbsp;</a>
<a class="ajax_cart_block_remove_link" href="{$link->getPageLink('cart', true, NULL, "delete=1&id_product={$product.id_product|intval}&ipa={$product.id_product_attribute|intval}&id_address_delivery={$product.id_address_delivery|intval}&token={$static_token}")|escape:'html':'UTF-8'}{if !empty($hotel_wise_data.id_hotel)}&id_hotel={$hotel_wise_data.id_hotel|escape:'html':'UTF-8'}{/if}" rel="nofollow" title="{l s='remove this product from my cart' mod='blockcart'}">&nbsp;</a>
{/if}
</span>
<div style="clear:both"></div>

View File

@@ -241,12 +241,14 @@
<div class="description-list">
<dl class="">
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Quantity'}</dt>
<dd class="col-xs-7">{$product.product_quantity}</dd>
{if $product.allow_multiple_quantity}
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Quantity'}</dt>
<dd class="col-xs-7">{$product.product_quantity}</dd>
</div>
</div>
</div>
{/if}
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Unit Price'}</dt>
@@ -261,8 +263,10 @@
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
</div>
{if $product.allow_multiple_quantity}
<div class="col-xs-12 col-md-6">
</div>
{/if}
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Total Pricing'}</dt>
@@ -311,12 +315,14 @@
<div class="description-list">
<dl class="">
<div class="row">
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Quantity'}</dt>
<dd class="col-xs-7">{$product.product_quantity}</dd>
{if $product.allow_multiple_quantity}
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Quantity'}</dt>
<dd class="col-xs-7">{$product.product_quantity}</dd>
</div>
</div>
</div>
{/if}
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Unit Price'}</dt>
@@ -331,8 +337,10 @@
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-6">
</div>
{if $product.allow_multiple_quantity}
<div class="col-xs-12 col-md-6">
</div>
{/if}
<div class="col-xs-12 col-md-6">
<div class="row">
<dt class="col-xs-5">{l s='Total Pricing'}</dt>
@@ -414,46 +422,32 @@
<table class="table table-sm table-responsive table-summary">
<tbody>
{if isset($cart_htl_data)}
{if $priceDisplay && $use_tax}
<tr class="item">
<td>
<strong>{l s='Total Rooms Cost (tax excl.)'}</strong>
</td>
<td class="text-right">
<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>
</td>
<td class="text-right">
{if $priceDisplay && $use_tax}
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_rooms_te'] + $orderTotalInfo['total_services_te'] + $orderTotalInfo['total_auto_add_services_te'] + $orderTotalInfo['total_demands_price_te']) currency=$objOrderCurrency}</span>
</td>
</tr>
{else}
<tr class="item">
<td>
<strong>{l s='Total Rooms Cost'} {if $use_tax}{l s='(tax incl.)'}{/if} </strong>
</td>
<td class="text-right">
{else}
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_rooms_ti'] + $orderTotalInfo['total_services_ti'] + $orderTotalInfo['total_auto_add_services_ti'] + $orderTotalInfo['total_demands_price_ti']) currency=$objOrderCurrency}</span>
</td>
</tr>
{/if}
{/if}
</td>
</tr>
{/if}
{if (isset($cart_standalone_service_products) && $cart_standalone_service_products) || (isset($cart_hotel_service_products) && $cart_hotel_service_products)}
{if $priceDisplay && $use_tax}
<tr class="item">
<td>
<strong>{l s='Total products cost (tax excl.)'}</strong>
</td>
<td class="text-right">
<tr class="item">
<td>
<strong>{l s='Total products 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}
<span>{displayWtPriceWithCurrency price=$orderTotalInfo['total_standalone_products_te'] currency=$objOrderCurrency}</span>
</td>
</tr>
{else}
<tr class="item">
<td>
<strong>{l s='Total products cost'} {if $use_tax}{l s='(tax incl.)'}{/if} </strong>
</td>
<td class="text-right">
{else}
<span>{displayWtPriceWithCurrency price=$orderTotalInfo['total_standalone_products_ti'] currency=$objOrderCurrency}</span>
</td>
</tr>
{/if}
{/if}
</td>
</tr>
{/if}
{if $order->total_wrapping > 0}
<tr class="item">
@@ -465,22 +459,17 @@
</td>
</tr>
{/if}
{if $priceDisplay && $use_tax && $orderTotalInfo['total_convenience_fee_te']}
{if $orderTotalInfo['total_convenience_fee_te'] || $orderTotalInfo['total_convenience_fee_ti']}
<tr class="item">
<td>
<strong>{l s='Total Convenience Fees (tax excl.)'}</strong>
<strong>{l s='Total Convenience Fees'} {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">
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_convenience_fee_te']) currency=$objOrderCurrency}</span>
</td>
</tr>
{else if $orderTotalInfo['total_convenience_fee_ti']}
<tr class="item">
<td>
<strong>{l s='Total Convenience Fees'} {if $use_tax}{l s='(tax incl.)'}{/if} </strong>
</td>
<td class="text-right">
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_convenience_fee_ti']) currency=$objOrderCurrency}</span>
{if $priceDisplay && $use_tax}
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_convenience_fee_te']) currency=$objOrderCurrency}</span>
{else}
<span>{displayWtPriceWithCurrency price=($orderTotalInfo['total_convenience_fee_ti']) currency=$objOrderCurrency}</span>
{/if}
</td>
</tr>
{/if}

View File

@@ -326,57 +326,39 @@
{assign var=total_standard_products_tax_incl value=($order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_STANDALONE) + $order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_HOTEL_STANDALONE))}
{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}
{if $priceDisplay && $use_tax && $room_price_tax_excl}
<tr>
<td>{l s='Total rooms cost (tax excl.)'}</td>
<td class="text-right">
<span class="price">{displayWtPriceWithCurrency price=($room_price_tax_excl + $room_services_price_tax_excl - $total_convenience_fee_te) currency=$currency}</span>
</td>
</tr>
{else}
<tr>
<td>{l s='Total Rooms Cost'} {if $use_tax}{l s='(tax incl.)'}{/if} </td>
<td class="text-right">
<span class="price">{displayWtPriceWithCurrency price=($room_price_tax_incl + $room_services_price_tax_incl - $total_convenience_fee_ti) currency=$currency}</span>
</td>
</tr>
{/if}
{/if}
{if (isset($hotel_service_products) && $hotel_service_products) || (isset($standalone_service_products) && $standalone_service_products)}
{if $priceDisplay && $use_tax}
<tr class="item">
<td>
<strong>{l s='Total products cost (tax excl.)'}</strong>
</td>
<td class="text-right">
<span>{displayWtPriceWithCurrency price=$total_standard_products_tax_excl currency=$currency}</span>
</td>
</tr>
{else}
<tr class="item">
<td>
<strong>{l s='Total products cost'} {if $use_tax}{l s='(tax incl.)'}{/if} </strong>
</td>
<td class="text-right">
<span>{displayWtPriceWithCurrency price=$total_standard_products_tax_incl currency=$currency}</span>
</td>
</tr>
{/if}
{/if}
{if $priceDisplay && $use_tax && $total_convenience_fee_te}
<tr>
<td>{l s='Total Convenience Fees (tax excl.)'}</td>
<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 class="text-right">
<span class="price">{displayWtPriceWithCurrency price=$total_convenience_fee_te currency=$currency}</span>
{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>
{else}
<span class="price">{displayWtPriceWithCurrency price=($room_price_tax_incl + $room_services_price_tax_incl - $total_convenience_fee_ti) currency=$currency}</span>
{/if}
</td>
</tr>
{else if $total_convenience_fee_ti}
<tr>
<td>{l s='Total Convenience Fees (tax incl.)'}</td>
{/if}
{if (isset($hotel_service_products) && $hotel_service_products) || (isset($standalone_service_products) && $standalone_service_products)}
<tr class="item">
<td>{l s='Total products 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">
<span class="price">{displayWtPriceWithCurrency price=$total_convenience_fee_ti currency=$currency}</span>
{if $priceDisplay && $use_tax}
<span>{displayWtPriceWithCurrency price=$total_standard_products_tax_excl currency=$currency}</span>
{else}
<span>{displayWtPriceWithCurrency price=$total_standard_products_tax_incl currency=$currency}</span>
{/if}
</td>
</tr>
{/if}
{if $total_convenience_fee_te || $total_convenience_fee_te}
<tr class="item">
<td>{l s='Total Convenience Fees'} {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=$total_convenience_fee_te currency=$currency}</span>
{else}
<span class="price">{displayWtPriceWithCurrency price=$total_convenience_fee_ti currency=$currency}</span>
{/if}
</td>
</tr>
{/if}
@@ -595,18 +577,28 @@
{block name='order_detail_add_order_messages_form'}
<form action="{$link->getPageLink('order-detail', true)|escape:'html':'UTF-8'}" method="post" class="std" id="sendOrderMessage">
<div class="form-group select-room-type">
<label for="id_product">{l s='Room Type'}</label>
<label for="id_product">{l s='Room Type'}{if $service_products_formatted}/{l s='Product'}{/if}</label>
<p class="card-subheader text-muted">
{l s='To add a comment about a room type, please select one first.'}
{if $service_products_formatted}
{l s='To add a comment about a room type/product, please select one first.'}
{else}
{l s='To add a comment about a room type, please select one first.'}
{/if}
</p>
<select name="id_product" class="form-control">
<option value="0">{l s='-- Choose --'}</option>
{foreach from=$roomTypes item=product}
{if $product.is_booking_product}
<option value="{$product.product_id}">{$product.product_name|escape:'html':'UTF-8'}</option>
{/if}
{/foreach}
{if $roomTypes}
{foreach from=$roomTypes item=product}
{if $product.is_booking_product}
<option value="{$product.product_id}">{$product.product_name|escape:'html':'UTF-8'}</option>
{/if}
{/foreach}
{/if}
{if $service_products_formatted}
{foreach from=$service_products_formatted item=product}
<option value="{$product.id_product}">{$product.name|escape:'html':'UTF-8'}</option>
{/foreach}
{/if}
</select>
</div>
@@ -743,57 +735,39 @@
{assign var=total_tax_without_discount value=(($room_price_tax_incl - $room_price_tax_excl) + ($room_services_price_tax_incl - $room_services_price_tax_excl) + ($total_standard_products_tax_incl - $total_standard_products_tax_excl))}
{if isset($cart_htl_data) && $cart_htl_data}
{if $priceDisplay && $use_tax && $room_price_tax_excl}
<tr>
<td>{l s='Total rooms cost (tax excl.)'}</td>
<td class="text-right">
<span class="price">{displayWtPriceWithCurrency price=($room_price_tax_excl + $room_services_price_tax_excl - $total_convenience_fee_te) currency=$currency}</span>
</td>
</tr>
{else}
<tr>
<td>{l s='Total Rooms Cost'} {if $use_tax}{l s='(tax incl.)'}{/if} </td>
<td class="text-right">
<span class="price">{displayWtPriceWithCurrency price=($room_price_tax_incl + $room_services_price_tax_incl - $total_convenience_fee_ti) currency=$currency}</span>
</td>
</tr>
{/if}
{/if}
{if (isset($hotel_service_products) && $hotel_service_products) || (isset($standalone_service_products) && $standalone_service_products)}
{if $priceDisplay && $use_tax}
<tr class="item">
<td>
<strong>{l s='Total products cost (tax excl.)'}</strong>
</td>
<td class="text-right">
<span>{displayWtPriceWithCurrency price=$total_standard_products_tax_excl currency=$currency}</span>
</td>
</tr>
{else}
<tr class="item">
<td>
<strong>{l s='Total products cost'} {if $use_tax}{l s='(tax incl.)'}{/if} </strong>
</td>
<td class="text-right">
<span>{displayWtPriceWithCurrency price=$total_standard_products_tax_incl currency=$currency}</span>
</td>
</tr>
{/if}
{/if}
{if $priceDisplay && $use_tax && $total_convenience_fee_te}
<tr>
<td>{l s='Total Convenience Fees (tax excl.)'}</td>
<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 class="text-right">
<span class="price">{displayWtPriceWithCurrency price=$total_convenience_fee_te currency=$currency}</span>
{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>
{else}
<span class="price">{displayWtPriceWithCurrency price=($room_price_tax_incl + $room_services_price_tax_incl - $total_convenience_fee_ti) currency=$currency}</span>
{/if}
</td>
</tr>
{else if $total_convenience_fee_ti}
<tr>
<td>{l s='Total Convenience Fees (tax incl.)'}</td>
{/if}
{if (isset($hotel_service_products) && $hotel_service_products) || (isset($standalone_service_products) && $standalone_service_products)}
<tr class="item">
<td>{l s='Total products 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">
<span class="price">{displayWtPriceWithCurrency price=$total_convenience_fee_ti currency=$currency}</span>
{if $priceDisplay && $use_tax}
<span>{displayWtPriceWithCurrency price=$total_standard_products_tax_excl currency=$currency}</span>
{else}
<span>{displayWtPriceWithCurrency price=$total_standard_products_tax_incl currency=$currency}</span>
{/if}
</td>
</tr>
{/if}
{if $total_convenience_fee_te || $total_convenience_fee_te}
<tr class="item">
<td>{l s='Total Convenience Fees'} {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=$total_convenience_fee_te currency=$currency}</span>
{else}
<span class="price">{displayWtPriceWithCurrency price=$total_convenience_fee_ti currency=$currency}</span>
{/if}
</td>
</tr>
{/if}
@@ -1065,9 +1039,11 @@
</label>
{if $product_option.is_cancelled}<span class="badge badge-danger badge-cancelled">{l s='Cancelled'}</span>{else if $product_option.is_refunded}<span class="badge badge-danger badge-cancelled">{l s='Refunded'}</span>{else if isset($product_option.refund_denied) && $product_option.refund_denied}<span class="badge badge-danger badge-cancelled">{l s='Refund denied'}</span> <i class="icon-info-circle refund-denied-info" data-refund_denied_info="{l s='Refund for this product is denied. Please contact admin for more detail.'}"></i></span>{/if}
</div>
<div class="quantity-wrap clearfix">
<span>{l s='Quantity'} : {$product_option.quantity}</span>
</div>
{if $product_option.allow_multiple_quantity}
<div class="quantity-wrap clearfix">
<span>{l s='Quantity'} : {$product_option.quantity}</span>
</div>
{/if}
</div>
{/foreach}
</div>

View File

@@ -47,7 +47,12 @@
<thead>
<tr>
<th>{l s='Order'}</th>
<th>{l s='Total rooms'}</th>
{if isset($hasRoomRefunds) && $hasRoomRefunds}
<th>{l s='Total rooms'}</th>
{/if}
{if isset($hasProductRefunds) && $hasProductRefunds}
<th>{l s='Total products'}</th>
{/if}
<th>{l s='Refund status'}</th>
<th>{l s='Date requested'}</th>
<th>{l s='Actions'}</th>
@@ -59,9 +64,16 @@
<td>
#{$return.reference|escape:'html':'UTF-8'}
</td>
<td>
{$return.total_rooms|escape:'html':'UTF-8'}
</td>
{if isset($hasRoomRefunds) && $hasRoomRefunds}
<td>
{$return.total_rooms|escape:'html':'UTF-8'}
</td>
{/if}
{if isset($hasProductRefunds) && $hasProductRefunds}
<td>
{$return.total_products|escape:'html':'UTF-8'}
</td>
{/if}
<td>
<span class="badge wk-badge" style="background-color:{$return.state_color|escape:'html':'UTF-8'}">{$return.state_name|escape:'html':'UTF-8'}
</td>

View File

@@ -53,6 +53,9 @@
{/block}
{block name='order_return_detail'}
{if $refundReqBookings}
{if isset($refundReqProducts) && $refundReqProducts}
<h1 class="page-subheading">{l s='Rooms refund requests'}</h1>
{/if}
<div class="table-responsive wk-datatable-wrapper">
<table class="table table-bordered">
<tr>
@@ -97,12 +100,13 @@
</div>
{/if}
{if $refundReqProducts}
<h1 class="page-subheading">{l s='Products refund requests'}</h1>
<div class="table-responsive wk-datatable-wrapper">
<table class="table table-bordered">
<tr>
<th>{l s='Name'}</th>
<th>{l s='Product name'}</th>
<th>{l s='Quantity'}</th>
<th>{l s='Total rooms price (tax incl.)'}</th>
<th>{l s='Total price (tax incl.)'}</th>
{if $isRefundCompleted}
<th>{l s='Refund amount'}</th>
<th>{l s='Refund Status'}</th>
@@ -111,7 +115,7 @@
{foreach from=$refundReqProducts item=$product name=refundRequest}
<tr>
<td>{$product['name']|escape:'htmlall':'UTF-8'}{if isset($product['option_name']) && $product['option_name']} : {$product['option_name']}{/if}</td>
<td>{$product['quantity']|escape:'htmlall':'UTF-8'}</td>
<td>{if $product['allow_multiple_quantity']}{$product['quantity']|escape:'htmlall':'UTF-8'}{else}--{/if}</td>
<td>{displayPrice price=$product['total_price_tax_incl'] currency=$orderCurrency['id']}</td>
{if $isRefundCompleted}
<td>

View File

@@ -217,7 +217,7 @@
{if isset($id_hotel) && $id_hotel}
<li><a href="#refund_policies_tab" class="idTabHrefShort" data-toggle="tab">{l s='Refund Policies'}</a></li>
{/if}
{if $display_google_maps && ($hotel_latitude|floatval != 0 && $hotel_longitude|floatval != 0)}
{if $display_google_maps && !empty($hotel_latitude) && !empty($hotel_longitude) && ($hotel_latitude|floatval != 0 && $hotel_longitude|floatval != 0)}
<li><a href="#room_type_map_tab" class="idTabHrefShort" data-toggle="tab">{l s='View on Map'}</a></li>
{/if}
{block name='displayProductTab'}
@@ -399,7 +399,7 @@
{/if}
{/block}
{block name='product_map_tab_content'}
{if $display_google_maps && ($hotel_latitude|floatval != 0 && $hotel_longitude|floatval != 0)}
{if $display_google_maps && !empty($hotel_latitude) && !empty($hotel_longitude) && ($hotel_latitude|floatval != 0 && $hotel_longitude|floatval != 0)}
<div id="room_type_map_tab" class="tab-pane card">
<div class="map-wrap"></div>
<div id="room-info-map-ui-content" style="display: none;">

View File

@@ -240,8 +240,8 @@
</div>
</div>
<div class="row product_price_detail_block">
<div class="col-sm-4 col-xs-7">
<div class="price_block">
<div class="col-sm-7">
<div class="price_block col-xs-7">
<p class="total_price">
<span>
{if $priceDisplay}{displayPrice price=($product['unit_price_tax_excl'])}{else}{displayPrice price=($product['unit_price_tax_incl'])}{/if}
@@ -251,35 +251,26 @@
{l s='Unit price'} {if $display_tax_label}{if $priceDisplay} {l s='(Excl.'} {else}{l s='(Incl.)'}{/if} {l s='all taxes.)'}{/if}
</p>
</div>
</div>
<div class="col-sm-3 col-xs-5">
<div class="quantity_cont">
<input type="hidden" value="{$product.quantity}" name="quantity_{$product.id_product}_{if $product.id_product_option}{$product.id_product_option}{else}0{/if}_{if $product.id_hotel}{$product.id_hotel}{else}0{/if}_hidden" />
<input size="2" type="text" autocomplete="off" class="cart_quantity_input grey" value="{$product.quantity}" name="quantity_{$product.id_product}_{if $product.id_product_option}{$product.id_product_option}{else}0{/if}_{if $product.id_hotel}{$product.id_hotel}{else}0{/if}" />
<div class="cart_quantity_button">
<a rel="nofollow" class="cart_quantity_up btn btn-default" id="cart_quantity_up_{$product.id_product}_{if $product.id_product_option}{$product.id_product_option}{else}0{/if}_{if $product.id_hotel}{$product.id_hotel}{else}0{/if}" href="{$link->getPageLink('cart', true, NULL, "add=1&amp;id_product={$product.id_product|intval}&amp;ipa={$product.id_product_attribute|intval}&amp;id_address_delivery=0&amp;token={$token_cart}")|escape:'html':'UTF-8'}" title="{l s='Add'}"><span><i class="icon-plus"></i></span></a>
{if $product.minimal_quantity < ($product.quantity)}
<a rel="nofollow" class="cart_quantity_down btn btn-default" id="cart_quantity_down_{$product.id_product}_{if $product.id_product_option}{$product.id_product_option}{else}0{/if}_{if $product.id_hotel}{$product.id_hotel}{else}0{/if}" href="{$link->getPageLink('cart', true, NULL, "add=1&amp;id_product={$product.id_product|intval}&amp;ipa={$product.id_product_attribute|intval}&amp;id_address_delivery=0&amp;op=down&amp;token={$token_cart}")|escape:'html':'UTF-8'}" title="{l s='Subtract'}">
<span><i class="icon-minus"></i></span>
</a>
{else}
<a class="cart_quantity_down btn btn-default disabled" href="#" id="cart_quantity_down_{$product.id_product}_{if $product.id_product_option}{$product.id_product_option}{else}0{/if}_{if $product.id_hotel}{$product.id_hotel}{else}0{/if}" title="{l s='You must purchase a minimum of %d of this product.' sprintf=1}">
<span><i class="icon-minus"></i></span>
</a>
{/if}
{if $product.allow_multiple_quantity}
<div class="col-xs-5">
<div class="quantity_cont">
<input type="hidden" value="{$product.quantity}" name="quantity_{$product.id_product}_{if $product.id_product_option}{$product.id_product_option}{else}0{/if}_{if $product.id_hotel}{$product.id_hotel}{else}0{/if}_hidden" />
<input size="2" type="text" autocomplete="off" class="cart_quantity_input grey" value="{$product.quantity}" name="quantity_{$product.id_product}_{if $product.id_product_option}{$product.id_product_option}{else}0{/if}_{if $product.id_hotel}{$product.id_hotel}{else}0{/if}" />
<div class="cart_quantity_button">
<a rel="nofollow" class="cart_quantity_up btn btn-default" id="cart_quantity_up_{$product.id_product}_{if $product.id_product_option}{$product.id_product_option}{else}0{/if}_{if $product.id_hotel}{$product.id_hotel}{else}0{/if}" href="{$link->getPageLink('cart', true, NULL, "add=1&amp;id_product={$product.id_product|intval}&amp;ipa={$product.id_product_attribute|intval}&amp;id_address_delivery=0&amp;token={$token_cart}")|escape:'html':'UTF-8'}" title="{l s='Add'}"><span><i class="icon-plus"></i></span></a>
{if $product.minimal_quantity < ($product.quantity)}
<a rel="nofollow" class="cart_quantity_down btn btn-default" id="cart_quantity_down_{$product.id_product}_{if $product.id_product_option}{$product.id_product_option}{else}0{/if}_{if $product.id_hotel}{$product.id_hotel}{else}0{/if}" href="{$link->getPageLink('cart', true, NULL, "add=1&amp;id_product={$product.id_product|intval}&amp;ipa={$product.id_product_attribute|intval}&amp;id_address_delivery=0&amp;op=down&amp;token={$token_cart}")|escape:'html':'UTF-8'}" title="{l s='Subtract'}">
<span><i class="icon-minus"></i></span>
</a>
{else}
<a class="cart_quantity_down btn btn-default disabled" href="#" id="cart_quantity_down_{$product.id_product}_{if $product.id_product_option}{$product.id_product_option}{else}0{/if}_{if $product.id_hotel}{$product.id_hotel}{else}0{/if}" title="{l s='You must purchase a minimum of %d of this product.' sprintf=1}">
<span><i class="icon-minus"></i></span>
</a>
{/if}
</div>
</div>
</div>
</div>
{* <div class="product_quantity_block">
<p class="">
<span>
{if $product['quantity'] <= 9}0{$product['quantity']}{else}{$product['quantity']}{/if}
</span>
</p>
<p class="product_quantity_detial">
{l s='Total Qty'}
</p>
</div> *}
{/if}
</div>
<div class="col-sm-5">
<div class="total_price_block col-xs-12">
@@ -370,17 +361,6 @@
</div>
</div>
{* <div class="product_quantity_block">
<p class="">
<span>
{if $product['quantity'] <= 9}0{$product['quantity']}{else}{$product['quantity']}{/if}
</span>
</p>
<p class="product_quantity_detial">
{l s='Total Qty'}
</p>
</div> *}
</div>
{/if}
</div>