Merge branch 'webkul:develop' into gli-1094

This commit is contained in:
Sumit Panwar
2023-04-11 12:58:41 +05:30
committed by GitHub
67 changed files with 538 additions and 316 deletions

View File

@@ -203,9 +203,9 @@ $(document).ready(function () {
{if isset($pack) && $pack->isPack($product->id)}<p class="col-lg-9 col-lg-offset-3 help-block">{l s='The sum of prices of the products in the pack is %s%s%s' sprintf=[$currency->prefix,{toolsConvertPrice price=$pack->noPackPrice($product->id)|string_format:$priceDisplayPrecisionFormat},$currency->suffix]}</p>{/if}
</div>
<div class="form-group">
<label class="control-label col-lg-3" for="service_product_type">
<label class="control-label col-lg-3" for="price_calculation_method">
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select whether price for this service will be added for each day of the booking or price will be added to the entire date range of the booking'}">
{l s='Per calculation method'}
{l s='Price calculation method'}
<span>
</label>
<div class="col-lg-4">

View File

@@ -1179,7 +1179,12 @@
$('#id_lang option').removeAttr('selected');
$('#id_lang option[value="'+id_lang+'"]').attr('selected', true);
$('#send_email_to_customer').attr('rel', jsonSummary.link_order);
$('#go_order_process').attr('href', jsonSummary.link_order);
if (!jsonSummary.is_backdate_order) {
$('#go_order_process').show();
$('#go_order_process').attr('href', jsonSummary.link_order);
} else {
$('#go_order_process').hide();
}
$('#order_message').val(jsonSummary.order_message);
resetBind();
}

View File

@@ -81,7 +81,7 @@
<input type="text" name="option_price_{$option['id']|escape:'html':'UTF-8'}" value="{if isset($selectedDemands[$demand['id_global_demand']]['adv_option'][$option['id']]['price'])}{Tools::ps_round($selectedDemands[$demand['id_global_demand']]['adv_option'][$option['id']]['price'], 2)|escape:'html':'UTF-8'}{else}{Tools::ps_round($option['price'], 2)|escape:'html':'UTF-8'}{/if}"/>
</div>
<div class="price_display" {if isset($selectedDemands[$demand['id_global_demand']])}style="display:none"{/if}>
{displayPrice price={$option['price']|escape:'html':'UTF-8'} currency=$module->id_currency}
{displayPrice price={$option['price']|escape:'html':'UTF-8'} currency=$idDefaultcurrency}
</div>
</td>
@@ -115,7 +115,7 @@
value="{if isset($selectedDemands[$demand['id_global_demand']]['price'])}{Tools::ps_round($selectedDemands[$demand['id_global_demand']]['price'], 2)|escape:'html':'UTF-8'}{elseif isset($demand['price'])}{Tools::ps_round($demand['price'], 2)|escape:'html':'UTF-8'}{/if}"/>
</div>
<div class="price_display" {if isset($selectedDemands[$demand['id_global_demand']])}style="display:none"{/if}>
{displayPrice price={$demand['price']|escape:'html':'UTF-8'} currency=$module->id_currency}
{displayPrice price={$demand['price']|escape:'html':'UTF-8'} currency=$idDefaultcurrency}
</div>
</td>
<td>

View File

@@ -15,7 +15,7 @@
<span>{l s='name'}</span>
</th>
<th class="">
<span>{l s='Category'}</span>
<span>{l s='Auto add to cart'}</span>
</th>
<th>
<span>{l s='Position'}</span>
@@ -45,19 +45,19 @@
</div>
</td>
<td>
<span class="field-view service-product-price-text">{if isset($service_product.custom_price) && $service_product.custom_price}{displayPrice price=$service_product.custom_price currency=$id_currency}{else}{displayPrice price=$service_product.default_price currency=$id_currency}{/if}</span>
<span class="field-view service-product-price-text">{if isset($service_product.custom_price) && $service_product.custom_price}{displayPrice price=$service_product.custom_price currency=$currency->id}{else}{displayPrice price=$service_product.default_price currency=$currency->id}{/if}</span>
<div class="field-edit" style="display:none">
<div class="input-group">
<input type="text" value="{if isset($service_product.custom_price) && $service_product.custom_price}{$service_product.custom_price|escape:'html':'UTF-8'}{else}{$service_product.default_price|escape:'html':'UTF-8'}{/if}" class="service-product-price" data-id_product="{$service_product.id_product|escape:'html':'UTF-8'}">
<span class="input-group-addon">{$currency->prefix}{$currency->suffix}</span>
</div>
</div>
<div class="help-block">{l s='Default price: %s' sprintf={displayPrice price=$service_product.default_price currency=$id_currency}}
<div class="help-block">{l s='Default price: %s' sprintf={displayPrice price=$service_product.default_price currency=$currency->id}}
</td>
<td>
<span class="field-view service_product_tax_text">{if isset($service_product.tax_rules_group_name) && $service_product.tax_rules_group_name}{$service_product.tax_rules_group_name}{else}{$service_product.default_tax_rules_group_name}{/if}</span>
<div class="field-edit" style="display:none">
<select class="service_product_id_tax_rules_group"{if $tax_exclude_taxe_option}disabled="disabled"{/if}>
<select class="service_product_id_tax_rules_group">
<option value="0">{l s='No Tax'}</option>
{foreach from=$tax_rules_groups item=tax_rules_group}
<option value="{$tax_rules_group.id_tax_rules_group}" {if $service_product.id_tax_rules_group == $tax_rules_group.id_tax_rules_group}selected="selected"{/if} >
@@ -71,7 +71,7 @@
<td class="text-right">
<a href="#" class="btn btn-default button-edit-price field-view"><i class="icon-pencil"></i></a>
<span class="field-edit" style="display:none">
<a href="#" class="btn btn-default btn-save" data-roomtype_url="{$link->getAdminLink('AdminProducts', true)|addslashes}" data-id_product="{$service_product.id_product|escape:'html':'UTF-8'}" data-id_room_type_service_product_price="{$service_product.id_room_type_service_product_price|escape:'html':'UTF-8'}"><i class="icon-save"></i> {l s='save'}</a>
<a href="#" class="btn btn-default btn-save" data-roomtype_url="{$link->getAdminLink('AdminProducts', true)|addslashes}" data-id_product="{$service_product.id_product|escape:'html':'UTF-8'}"><i class="icon-save"></i> {l s='save'}</a>
<a href="#" class="btn btn-default btn-cancel"><i class="icon-times"></i></a>
</span>
</td>

View File

@@ -47,7 +47,10 @@ class DateRangeCore extends ObjectModel
SELECT `id_date_range`, `time_end`
FROM `'._DB_PREFIX_.'date_range`
WHERE `time_end` = (SELECT MAX(`time_end`) FROM `'._DB_PREFIX_.'date_range`)');
if (!$result['id_date_range'] || strtotime($result['time_end']) < strtotime(date('Y-m-d H:i:s'))) {
if (!$result
|| !$result['id_date_range']
|| strtotime($result['time_end']) < strtotime(date('Y-m-d H:i:s'))
) {
// The default range is set to 1 day less 1 second (in seconds)
$rangeSize = 86399;
$dateRange = new DateRange();

View File

@@ -957,7 +957,7 @@ class ToolsCore
* @param string $string Error message
* @param bool $htmlentities By default at true for parsing error message with htmlentities
*/
public static function displayError($string = 'Fatal error', $htmlentities = true, Context $context = null)
public static function displayError($string = 'Fatal error', $htmlentities = true, Context $context = null, $addslashes = false)
{
global $_ERRORS;
@@ -975,6 +975,9 @@ class ToolsCore
}
$key = md5(str_replace('\'', '\\\'', $string));
$str = (isset($_ERRORS) && is_array($_ERRORS) && array_key_exists($key, $_ERRORS)) ? $_ERRORS[$key] : $string;
if ($addslashes) {
$str = addslashes($str);
}
return $htmlentities ? Tools::htmlentitiesUTF8(stripslashes($str)) : $str;
}

View File

@@ -126,7 +126,7 @@ class TranslateCore
* @param string $source
* @return string
*/
public static function getModuleTranslation($module, $string, $source, $sprintf = null, $js = false, $language = null)
public static function getModuleTranslation($module, $string, $source, $sprintf = null, $addslashes = false, $language = null)
{
global $_MODULES, $_MODULE, $_LANGADM;
@@ -171,7 +171,7 @@ class TranslateCore
$string = preg_replace("/\\\*'/", "\'", $string);
$key = md5($string);
$cache_key = $name.'|'.$string.'|'.$source.'|'.(int)$js;
$cache_key = $name.'|'.$string.'|'.$source.'|'.(int)$addslashes;
if (!isset($lang_cache[$cache_key])) {
if ($_MODULES == null) {
@@ -210,10 +210,10 @@ class TranslateCore
$ret = Translate::checkAndReplaceArgs($ret, $sprintf);
}
if ($js) {
$ret = htmlspecialchars($ret, ENT_COMPAT, 'UTF-8');
if ($addslashes) {
$ret = addslashes($ret);
} else {
$ret = htmlspecialchars($ret, ENT_COMPAT, 'UTF-8');
}
if ($sprintf === null) {

View File

@@ -706,6 +706,46 @@ class ValidateCore
return $id === null || Validate::isUnsignedId($id);
}
public static function isOccupancy($occupancy)
{
if (is_array($occupancy)) {
if (count(array_filter(array_keys($occupancy), 'is_string'))) {
$occupancy = array($occupancy);
}
$response = true;
foreach ($occupancy as $key => $roomOccupancy) {
if (is_array($roomOccupancy)) {
if (!isset($roomOccupancy['adults']) || !$roomOccupancy['adults'] || !Validate::isUnsignedInt($roomOccupancy['adults'])) {
$response = $response && false;
}
if (isset($roomOccupancy['children'])) {
if (!Validate::isUnsignedInt($roomOccupancy['children'])) {
$response = $response && false;
}
if ($roomOccupancy['children'] > 0) {
if (!isset($roomOccupancy['child_ages']) || ($roomOccupancy['children'] != count($roomOccupancy['child_ages'])) || !is_array($roomOccupancy['child_ages'])) {
$response = $response && false;
} else {
if (is_array($roomOccupancy['child_ages'])) {
foreach($roomOccupancy['child_ages'] as $childAge) {
if (!Validate::isUnsignedInt($childAge)) {
$response = $response && false;
}
}
}
}
}
}
$response = $response && true;
} else {
$response = $response && false;
}
}
return $response;
}
return false;
}
/**
* Check object validity
*

View File

@@ -24,7 +24,7 @@
* International Registered Trademark & Property of PrestaShop SA
*/
abstract class AbstractCheckoutStep implements CheckoutStepInterface
abstract class AbstractCheckoutStepCore implements CheckoutStepInterface
{
public $step_is_reachable = 0;
public $step_is_complete = 0;

View File

@@ -18,7 +18,7 @@
* @license https://store.webkul.com/license.html
*/
class CheckoutCartSummaryStep extends AbstractCheckoutStep
class CheckoutCartSummaryStepCore extends AbstractCheckoutStepCore
{
public function __construct()
{

View File

@@ -18,7 +18,7 @@
* @license https://store.webkul.com/license.html
*/
class CheckoutCustomerDetailsStep extends AbstractCheckoutStep
class CheckoutCustomerDetailsStepCore extends AbstractCheckoutStepCore
{
public function __construct()
{

View File

@@ -18,7 +18,7 @@
* @license https://store.webkul.com/license.html
*/
class CheckoutPaymentStep extends AbstractCheckoutStep
class CheckoutPaymentStepCore extends AbstractCheckoutStepCore
{
public function __construct() {
parent::__construct();

View File

@@ -18,7 +18,7 @@
* @license https://store.webkul.com/license.html
*/
class CheckoutProcess
class CheckoutProcessCore
{
public $steps = array();

View File

@@ -1628,14 +1628,6 @@ class AdminControllerCore extends Controller
$this->context->smarty->assign('help_link', 'http://help.prestashop.com/'.Language::getIsoById($this->context->employee->id_lang).'/doc/'
.Tools::getValue('controller').'?version='._PS_VERSION_.'&country='.Language::getIsoById($this->context->employee->id_lang));
$this->context->smarty->assign(array(
'show_page_header_toolbar' => $this->show_page_header_toolbar,
'page_header_toolbar_title' => $this->page_header_toolbar_title,
'title' => $this->page_header_toolbar_title,
'toolbar_btn' => $this->page_header_toolbar_btn,
'page_header_toolbar_btn' => $this->page_header_toolbar_btn,
));
}
/**
@@ -2138,11 +2130,9 @@ class AdminControllerCore extends Controller
$this->initPageHeaderToolbar();
if ($this->display == 'edit' || $this->display == 'add') {
if (!$this->loadObject(true)) {
return;
if ($this->loadObject(true)) {
$this->content .= $this->renderForm();
}
$this->content .= $this->renderForm();
} elseif ($this->display == 'view') {
// Some controllers use the view action without an object
if ($this->className) {
@@ -2168,6 +2158,11 @@ class AdminControllerCore extends Controller
'content' => $this->content,
'lite_display' => $this->lite_display,
'url_post' => self::$currentIndex.'&token='.$this->token,
'show_page_header_toolbar' => $this->show_page_header_toolbar,
'page_header_toolbar_title' => $this->page_header_toolbar_title,
'title' => $this->page_header_toolbar_title,
'toolbar_btn' => $this->page_header_toolbar_btn,
'page_header_toolbar_btn' => $this->page_header_toolbar_btn,
));
}

View File

@@ -2124,13 +2124,13 @@ abstract class ModuleCore
* @param bool|string $specific filename to use in translation key
* @return string Translation
*/
public function l($string, $specific = false)
public function l($string, $specific = false, $addslashes = false)
{
if (self::$_generate_config_xml_mode) {
return $string;
}
return Translate::getModuleTranslation($this, $string, ($specific) ? $specific : $this->name);
return Translate::getModuleTranslation($this, $string, ($specific) ? $specific : $this->name, null, $addslashes);
}
/*

View File

@@ -358,7 +358,6 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$rm_dtl = $obj_rm_type->getRoomTypeInfoByIdProduct($type_value['product_id']);
$cart_htl_data[$type_key]['id_product'] = $type_value['product_id'];
$cart_htl_data[$type_key]['cover_img'] = $cover_img;
$cart_htl_data[$type_key]['hotel_name'] = $rm_dtl['hotel_name'];
$objBookingDemand = new HotelBookingDemands();
foreach ($order_bk_data as $data_k => $data_v) {
@@ -579,13 +578,14 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$totalDemandsPriceTE += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_te'];
$totalDemandsPriceTI += $cart_htl_data[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'];
}
if ($extraDemands = array_shift($objBookingDemand->getRoomTypeBookingExtraDemands(
if ($extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
$order_obj->id,
$type_value['product_id'],
$data_v['id_room'],
$data_v['date_from'],
$data_v['date_to']
))) {
)) {
$extraDemands = array_shift($extraDemands);
$extraDemands['product_id'] = $type_value['product_id'];
$extraDemands['room_type_name'] = $type_value['product_name'];
$extraDemands['date_from'] = $data_v['date_from'];
@@ -593,7 +593,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$room_extra_demands[] = $extraDemands;
}
if ($additionalServices = array_shift($objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order_obj->id,
0,
0,
@@ -601,8 +601,8 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room']
))) {
)) {
$additionalServices = array_shift($additionalServices);
$additionalServices['product_id'] = $type_value['product_id'];
$additionalServices['room_type_name'] = $type_value['product_name'];
$additionalServices['date_from'] = $data_v['date_from'];
@@ -610,7 +610,6 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
$room_additinal_services[] = $additionalServices;
}
// Set tax_code
if ($taxes = OrderDetail::getTaxListStatic($data_v['id_order_detail'])) {
$tax_temp = array();

View File

@@ -78,7 +78,7 @@ function displayFatalError()
$error = error_get_last();
}
if ($error !== null && in_array($error['type'], array(E_ERROR, E_PARSE, E_COMPILE_ERROR ))) {
echo '[PrestaShop] Fatal error in module file :'.$error['file'].':<br />'.$error['message'];
echo '[QloApps] Fatal error in module file :'.$error['file'].':<br />'.$error['message'];
}
}

View File

@@ -844,6 +844,15 @@ class AdminCartsControllerCore extends AdminController
}
}
$cart_detail_data_obj = new HotelCartBookingData();
$cart_detail_data = $cart_detail_data_obj->getCartFormatedBookinInfoByIdCart((int) $id_cart);
$is_backdate_order = false;
$currentDate = strtotime(date('Y-m-d'));
foreach ($cart_detail_data as $cartRoom) {
if (strtotime($cartRoom['date_from']) < $currentDate) {
$is_backdate_order = true;
}
}
$addresses = $this->context->customer->getAddresses((int)$this->context->cart->id_lang);
foreach ($addresses as &$data) {
@@ -853,6 +862,8 @@ class AdminCartsControllerCore extends AdminController
return array(
'summary' => $this->getCartSummary(),
'cart_detail_data' => $cart_detail_data,
'is_backdate_order' => $is_backdate_order,
'delivery_option_list' => $this->getDeliveryOptionList(),
'cart' => $this->context->cart,
'currency' => new Currency($this->context->cart->id_currency),

View File

@@ -175,6 +175,8 @@ class AdminEmployeesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
parent::initPageHeaderToolbar();
if (empty($this->display)) {
$this->page_header_toolbar_btn['new_employee'] = array(
'href' => self::$currentIndex.'&addemployee&token='.$this->token,
@@ -193,8 +195,6 @@ class AdminEmployeesControllerCore extends AdminController
$this->toolbar_title);
}
}
parent::initPageHeaderToolbar();
}
public function renderList()

View File

@@ -2110,7 +2110,7 @@ class AdminImportControllerCore extends AdminController
Tools::displayError('%s cannot be saved'),
(isset($image->id_product) ? ' ('.$image->id_product.')' : '')
);
$this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : '').Db::getInstance()->getMsgError()();
$this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : '').Db::getInstance()->getMsgError();
}
}
}

View File

@@ -1836,7 +1836,9 @@ class AdminModulesControllerCore extends AdminController
$this->errors[] = $this->l('Module not found!');
}
} else {
$this->errors[] = $this->l('There was some error while updating the module');
$response['success'] = true;
$response['msg'] = $this->l('Module files updated successfully');
$response['data']['redirect'] = $this->context->link->getAdminLink('AdminModules').'&conf=29&anchor='.$module->name;
}
} else {
$this->errors[] = $this->l('Module not installed, install module before updating.');

View File

@@ -1590,7 +1590,7 @@ class AdminNormalProductsControllerCore extends AdminController
if ($res) {
$this->jsonConfirmation($this->_conf[7]);
} else {
$this->jsonError(Tools::displayError('An error occurred while attempting to delete the room type image.'));
$this->jsonError(Tools::displayError('An error occurred while attempting to delete the product image.'));
}
}
@@ -2154,11 +2154,11 @@ class AdminNormalProductsControllerCore extends AdminController
// Categories
if ($this->isProductFieldUpdated('id_category_default') && (!Tools::isSubmit('categoryBox') || !count(Tools::getValue('categoryBox')))) {
$this->errors[] = $this->l('This room type must be in at least one category.');
$this->errors[] = $this->l('This product must be in at least one category.');
}
if ($this->isProductFieldUpdated('id_category_default') && (!is_array(Tools::getValue('categoryBox')) || !in_array(Tools::getValue('id_category_default'), Tools::getValue('categoryBox')))) {
$this->errors[] = $this->l('This room type must be in the default category.');
$this->errors[] = $this->l('This product must be in the default category.');
}
// Tags
@@ -3472,7 +3472,7 @@ class AdminNormalProductsControllerCore extends AdminController
if (!Validate::isLoadedObject($product)) {
$files = array();
$files[0]['error'] = Tools::displayError('Cannot add image because room type creation failed.');
$files[0]['error'] = Tools::displayError('Cannot add image because product creation failed.');
}
$image_uploader = new HelperImageUploader('file');
@@ -3663,10 +3663,10 @@ class AdminNormalProductsControllerCore extends AdminController
$data->assign('imageType', ImageType::getFormatedName('small'));
}
} else {
$this->displayWarning($this->l('You must save the room type in this shop before adding images.'));
$this->displayWarning($this->l('You must save the product in this shop before adding images.'));
}
} else {
$this->displayWarning($this->l('You must save this room type before adding images.'));
$this->displayWarning($this->l('You must save this product before adding images.'));
}
$this->tpl_form_vars['custom_form'] = $data->fetch();
@@ -3957,7 +3957,7 @@ class AdminNormalProductsControllerCore extends AdminController
echo '{"hasError" : true, "errors" : "Can not update product '.(int)$id_product.' to position '.(int)$position.' "}';
}
} else {
echo '{"hasError" : true, "errors" : "This room type ('.(int)$id_product.') can t be loaded"}';
echo '{"hasError" : true, "errors" : "This product ('.(int)$id_product.') can t be loaded"}';
}
break;

View File

@@ -1638,7 +1638,8 @@ class AdminOrdersControllerCore extends AdminController
1,
0
);
$order_detail_data[$key]['total_room_price_ti'] += $totalConvenienceFeeTI += $order_detail_data[$key]['convenience_fee_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order_detail_data[$key]['convenience_fee_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
@@ -1651,7 +1652,10 @@ class AdminOrdersControllerCore extends AdminController
1,
Product::PRICE_ADDITION_TYPE_INDEPENDENT
);
$order_detail_data[$key]['total_room_price_te'] += $totalConvenienceFeeTE += $order_detail_data[$key]['convenience_fee_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order_detail_data[$key]['total_room_price_ti'] += $order_detail_data[$key]['convenience_fee_ti'];
$totalConvenienceFeeTI += $order_detail_data[$key]['convenience_fee_ti'];
$order_detail_data[$key]['convenience_fee_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
@@ -1664,7 +1668,11 @@ class AdminOrdersControllerCore extends AdminController
1,
Product::PRICE_ADDITION_TYPE_INDEPENDENT
);
$order_detail_data[$key]['total_room_price_ti'] += $order_detail_data[$key]['additional_services_price_auto_add_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order_detail_data[$key]['total_room_price_te'] += $order_detail_data[$key]['convenience_fee_te'];
$totalConvenienceFeeTE += $order_detail_data[$key]['convenience_fee_te'];
$order_detail_data[$key]['additional_services_price_auto_add_ti'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
@@ -1677,7 +1685,9 @@ class AdminOrdersControllerCore extends AdminController
1,
Product::PRICE_ADDITION_TYPE_WITH_ROOM
);
$order_detail_data[$key]['total_room_price_te'] += $order_detail_data[$key]['additional_services_price_auto_add_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order_detail_data[$key]['total_room_price_ti'] += $order_detail_data[$key]['additional_services_price_auto_add_ti'];
$order_detail_data[$key]['additional_services_price_auto_add_te'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$order->id,
0,
0,
@@ -1690,6 +1700,8 @@ class AdminOrdersControllerCore extends AdminController
1,
Product::PRICE_ADDITION_TYPE_WITH_ROOM
);
$order_detail_data[$key]['total_room_price_te'] += $order_detail_data[$key]['additional_services_price_auto_add_te'];
$cust_obj = new Customer($value['id_customer']);
if ($cust_obj->firstname) {
$order_detail_data[$key]['alloted_cust_name'] = $cust_obj->firstname.' '.$cust_obj->lastname;
@@ -3132,7 +3144,8 @@ class AdminOrdersControllerCore extends AdminController
Group::getCurrent()->id,
$this->context->cart->id,
$this->context->cookie->id_guest,
$objCartBookingData->id_room
$objCartBookingData->id_room,
0
);
$objBookingDetail->total_price_tax_excl = $total_price['total_price_tax_excl'];
$objBookingDetail->total_price_tax_incl = $total_price['total_price_tax_incl'];
@@ -4093,7 +4106,7 @@ class AdminOrdersControllerCore extends AdminController
// Update Order
// values changes as values are calculated accoding to the quantity of the product by webkul
$order->total_paid -= ($diff_products_tax_incl + $roomExtraDemandTI);
$order->total_paid -= ($diff_products_tax_incl + $roomExtraDemandTI + $additionlServicesTI);
$order->total_paid_tax_incl -= ($diff_products_tax_incl + $roomExtraDemandTI + $additionlServicesTI);
$order->total_paid_tax_excl -= ($diff_products_tax_excl + $roomExtraDemandTE + $additionlServicesTE);
$order->total_products -= ($diff_products_tax_excl + $additionlServicesTE);
@@ -4750,9 +4763,11 @@ class AdminOrdersControllerCore extends AdminController
// get room type additional demands
$objRoomTypeServiceProduct = new RoomTypeServiceProduct();
if ($roomTypeServiceProducts = $objRoomTypeServiceProduct->getServiceProductsData($idProduct, 1, 0, false, 2, null)) {
foreach ($roomTypeServiceProducts as $key => $product) {
if (in_array($product['id_product'], array_column($additionalServices['additional_services'], 'id_product'))) {
unset($roomTypeServiceProducts[$key]);
if ($additionalServices) {
foreach ($roomTypeServiceProducts as $key => $product) {
if (in_array($product['id_product'], array_column($additionalServices['additional_services'], 'id_product'))) {
unset($roomTypeServiceProducts[$key]);
}
}
}
$smartyVars['roomTypeServiceProducts'] = $roomTypeServiceProducts;
@@ -4957,7 +4972,7 @@ class AdminOrdersControllerCore extends AdminController
$order->total_paid_tax_excl -= $priceTaxExcl;
$order->total_paid_tax_incl -= $priceTaxIncl;
$order->total_paid += $priceTaxIncl;
$order->total_paid -= $priceTaxIncl;
$res &= $order->update();
}

View File

@@ -1123,7 +1123,6 @@ class AdminProductsControllerCore extends AdminController
// process price update
$idProduct = Tools::getValue('id_product');
$idServiceProduct = Tools::getValue('service_product_id');
$idProductRoomtypePrice = Tools::getValue('id_room_type_service_product_price');
$price = Tools::getValue('price');
$id_tax_rules_group = Tools::getValue('id_tax_rules_group');
@@ -3298,6 +3297,7 @@ class AdminProductsControllerCore extends AdminController
'selectedDemands' => $selectedDemands,
'allDemands' => $allDemands,
'defaultcurrencySign' => $objCurrency->sign,
'idDefaultcurrency' => $objCurrency->id,
));
} else {
$this->displayWarning($this->l('You must save this room type before managing additional facilities.'));

View File

@@ -1107,7 +1107,7 @@ class AdminStatsControllerCore extends AdminStatsTabController
);
if ($numAllOrders != 0) {
return $numCancelledOrders / $numAllOrders * 100;
return $numCancelledOrders / $numAllOrders;
} else {
return 0;
}
@@ -1693,7 +1693,7 @@ class AdminStatsControllerCore extends AdminStatsTabController
$totalRevenue = (float) self::getRevenue($dateFrom, $dateTo, $idHotel);
return $totalRevenue ? ($directRevenue / $totalRevenue) * 100 : 0;
return $totalRevenue ? ($directRevenue / $totalRevenue) : 0;
}
public static function getOperatingExpensesForDiscreteDates($dateFrom, $dateTo = null, $idHotel = null, $useCache = true)

View File

@@ -716,6 +716,8 @@ class AdminThemesControllerCore extends AdminController
public function initPageHeaderToolbar()
{
parent::initPageHeaderToolbar();
if (empty($this->display)) {
$this->page_header_toolbar_btn['import_theme'] = array(
'href' => self::$currentIndex.'&action=importtheme&token='.$this->token,
@@ -744,8 +746,6 @@ class AdminThemesControllerCore extends AdminController
$title = implode(' '.Configuration::get('PS_NAVIGATION_PIPE').' ', $this->toolbar_title);
$this->page_header_toolbar_title = $title;
parent::initPageHeaderToolbar();
}
private function checkParentClass($name)

View File

@@ -159,7 +159,9 @@ class CategoryControllerCore extends FrontController
// get occupancy of the search
$occupancy = Tools::getValue('occupancy');
if (!Validate::isOccupancy($occupancy)) {
$occupancy = array();
}
$currency = new Currency($this->context->currency->id);
if ($id_hotel = HotelBranchInformation::getHotelIdByIdCategory($id_category)) {
@@ -267,7 +269,9 @@ class CategoryControllerCore extends FrontController
// occupancy of the search
$occupancy = Tools::getValue('occupancy');
if (!Validate::isOccupancy($occupancy)) {
$occupancy = array();
}
$sort_by = Tools::getValue('sort_by');
$sort_value = Tools::getValue('sort_value');
$filter_data = Tools::getValue('filter_data');

View File

@@ -115,6 +115,7 @@ class GuestTrackingControllerCore extends FrontController
$method = Tools::getValue('method');
if ($method == 'getRoomTypeBookingDemands') {
$response = array('reload' => false);
$extraDemandsTpl = '';
if (($idProduct = Tools::getValue('id_product'))
&& ($idOrder = Tools::getValue('id_order'))
@@ -122,7 +123,6 @@ class GuestTrackingControllerCore extends FrontController
&& ($dateTo = Tools::getValue('date_to'))
) {
$objBookingDemand = new HotelBookingDemands();
$order = new Order($idOrder);
$customer = new Customer((int)$order->id_customer);
$useTax = 0;
if (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC) {
@@ -144,10 +144,27 @@ class GuestTrackingControllerCore extends FrontController
'extraDemands' => $extraDemands,
)
);
$extraDemandsTpl .= $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order_booking_demands.tpl');
}
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$idProduct,
$dateFrom,
$dateTo,
0,
0,
$useTax
)) {
$this->context->smarty->assign(array(
'useTax' => $useTax,
'additionalServices' => $additionalServices,
));
}
$response['extra_demands'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order_booking_demands.tpl');
}
die($extraDemandsTpl);
$this->ajaxDie(json_encode($response));
}
/* Handle brute force attacks */
@@ -285,6 +302,13 @@ class GuestTrackingControllerCore extends FrontController
if ($data_v['is_back_order']) {
$anyBackOrder = 1;
}
if ($data_v['is_refunded']) {
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] += 1;
}
if ($data_v['is_cancelled']) {
$cartHotelData[$type_key]['date_diff'][$date_join]['count_cancelled'] += 1;
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] -= 1;
}
} else {
$num_days = $objBookingDetail->getNumberOfDays($data_v['date_from'], $data_v['date_to']);
$cartHotelData[$type_key]['date_diff'][$date_join]['num_rm'] = 1;
@@ -304,8 +328,19 @@ class GuestTrackingControllerCore extends FrontController
if ($data_v['is_back_order']) {
$anyBackOrder = 1;
}
$cartHotelData[$type_key]['date_diff'][$date_join]['count_cancelled'] = 0;
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] = 0;
if ($data_v['is_refunded']) {
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] += 1;
}
if ($data_v['is_cancelled']) {
$cartHotelData[$type_key]['date_diff'][$date_join]['count_cancelled'] += 1;
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] -= 1;
}
}
$cartHotelData[$type_key]['date_diff'][$date_join]['is_refunded'] = $data_v['is_refunded'];
$cartHotelData[$type_key]['date_diff'][$date_join]['ids_htl_booking_detail'][] = $data_v['id'];
$cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
@@ -390,6 +425,39 @@ class GuestTrackingControllerCore extends FrontController
1,
0
);
// get auto added price to be displayed with room price
if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'])) {
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] = 0;
}
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] += $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
1,
1,
Product::PRICE_ADDITION_TYPE_WITH_ROOM
);
if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'])) {
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'] = 0;
}
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'] += $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
0,
1,
Product::PRICE_ADDITION_TYPE_WITH_ROOM
);
}
// get auto added price to be displayed with room price
if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'])) {

View File

@@ -408,7 +408,11 @@ class ProductControllerCore extends FrontController
)
);
$this->assignBookingFormVars($this->product->id, $date_from, $date_to);
$occupancy_value = array();
if (Configuration::get('PS_FRONT_ROOM_UNIT_SELECTION_TYPE') == HotelBookingDetail::PS_ROOM_UNIT_SELECTION_TYPE_QUANTITY) {
$occupancy_value = 1;
}
$this->assignBookingFormVars($this->product->id, $date_from, $date_to, $occupancy_value);
$this->assignServiceProductVars();
// product price after imposing feature prices...
@@ -1218,14 +1222,15 @@ class ProductControllerCore extends FrontController
$dateFrom = Tools::getValue('date_from');
$dateTo = Tools::getValue('date_to');
$occupancy = Tools::getValue('occupancy');
if (!Validate::isOccupancy($occupancy)) {
$occupancy = array();
}
$roomTypeDemands = Tools::getValue('room_type_demands');
$roomServiceProducts = Tools::getValue('room_service_products');
$dateFrom = date('Y-m-d', strtotime($dateFrom));
$dateTo = date('Y-m-d', strtotime($dateTo));
if ($occupancy == false) {
$occupancy = array();
}
$this->assignServiceProductVars();
if ($this->assignBookingFormVars(
$idProduct,

View File

@@ -509,7 +509,6 @@ product_tabs['ServiceProduct'] = new function(){
data: {
id_product: id_product,
service_product_id : $(this).data('id_product'),
id_room_type_service_product_price : $(this).data('id_room_type_service_product_price'),
price: price,
id_tax_rules_group: id_tax_rules_group,
action: 'updatedServiceProductPrice',

View File

@@ -912,7 +912,7 @@ var ajaxCart = {
content += '<tr class="rooms_remove_container">';
content += '<td>' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_form)) + '&nbsp;-&nbsp;' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_to)) + '</td>';
content += '<td class="num_rooms_in_date">' + date_diff_v.num_rm + '</td>';
content += '<td>' + formatCurrency(parseFloat(date_diff_v.amount), currency_format, currency_sign, currency_blank) + '</td>';
content += '<td>' + formatCurrency(parseFloat(date_diff_v.amount) + parseFloat(date_diff_v.demand_price), currency_format, currency_sign, currency_blank) + '</td>';
content += '<td>';
content += '<a class="remove_rooms_from_cart_link" href="#" rm_price=' + date_diff_v.amount + ' id_product=' + productId + ' date_from=' + date_diff_v.data_form + ' date_to=' + date_diff_v.data_to + ' num_rooms=' + date_diff_v.num_rm + ' title="' + remove_rm_title + '"></a>';
content += '</td>';
@@ -949,7 +949,7 @@ var ajaxCart = {
booking_dates_content += '<tr class="rooms_remove_container">';
booking_dates_content += '<td>' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_form)) + '&nbsp;-&nbsp;' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_to)) + '</td>';
booking_dates_content += '<td class="num_rooms_in_date">' + date_diff_v1.num_rm + '</td>';
booking_dates_content += '<td>' + formatCurrency(parseFloat(date_diff_v1.amount), currency_format, currency_sign, currency_blank) + '</td>';
booking_dates_content += '<td>' + formatCurrency(parseFloat(date_diff_v1.amount) + parseFloat(date_diff_v1.demand_price), currency_format, currency_sign, currency_blank) + '</td>';
booking_dates_content += '<td>';
booking_dates_content += '<a class="remove_rooms_from_cart_link" href="#" rm_price=' + date_diff_v1.amount + ' id_product=' + productId + ' date_from=' + date_diff_v1.data_form + ' date_to=' + date_diff_v1.data_to + ' num_rooms=' + date_diff_v1.num_rm + ' title="' + remove_rm_title + '"></a>';
booking_dates_content += '</td>';
@@ -1154,16 +1154,20 @@ var ajaxCart = {
if (hasDeliveryAddress)
$('.ajax_cart_shipping_cost').parent().find('.unvisible').show();
$('.ajax_cart_tax_cost').text(jsonData.taxCost);
$('.ajax_cart_tax_cost').text(jsonData.tax_cost);
$('.cart_block_wrapping_cost').text(jsonData.wrapping_cost);
$('.ajax_block_cart_total').text(jsonData.total);
$('.ajax_block_cart_total').attr('total_cart_price', jsonData.totalToPay);
$('.ajax_block_products_total').text(jsonData.product_total);
$('.ajax_block_room_total').text(jsonData.roomTotal);
$('.ajax_block_room_total').text(jsonData.room_total);
$('.ajax_block_nornal_products_total').text(jsonData.normalProductsTotal);
$('.ajax_cart_extra_demands_cost').text(jsonData.total_extra_services_format);
$('.ajax_cart_convenience_fee').text(jsonData.total_convenience_fee_format);
if (jsonData.total_convenience_fee) {
$('.ajax_cart_convenience_fee').parent().show();
} else {
$('.ajax_cart_convenience_fee').parent().hide();
}
$('.ajax_total_price_wt').text(jsonData.total_price_wt);
if (parseFloat(jsonData.free_shipping_float) > 0) {
@@ -1255,6 +1259,16 @@ function disableRoomTypeDemands(show) {
}
}
function disableRoomTypeServices(disable) {
if (disable) {
$('#service_products_cont').find('button.add_roomtype_product').attr('disabled', 'disabled');
$('#service_products_cont').find('.qty_container .qty_direction a').attr('disabled', 'disabled');
} else {
$('#service_products_cont').find('button.add_roomtype_product').removeAttr('disabled');
$('#service_products_cont').find('.qty_container .qty_direction a').removeAttr('disabled');
}
}
function getRoomsExtraDemands()
{
var roomDemands = [];

View File

@@ -1,39 +1,38 @@
/*******************************************************************
Cart Block Styles
********************************************************************/
#header .shopping_cart {
position: relative;
float: right;
/*margin-bottom: 20px;*/
/*padding-top: 5px;*/ }
#header .shopping_cart > a:first-child:after {
content: "\f0d7";
font-family: "FontAwesome";
display: inline-block;
float: right;
font-size: 11px;
color: #FFFFFF;
padding: 6px 0 0 0; }
#header .shopping_cart > a:first-child:hover:after {
content: "\f0d8";
padding: 4px 0px 0px 0px; }
/**
* 2010-2022 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* 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 CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2022 Webkul IN
* @license LICENSE.txt
*/
.shopping_cart {
width: 34px; }
@media (max-width: 480px) {
/*.shopping_cart {
padding-top: 20px; }*/ }
@media (max-width: 1200px) {
.shopping_cart {
margin: 0 auto;
float: none;} }
#header .shopping_cart > a:first-child:after {
content: "\f0d7";
font-family: "FontAwesome";
font-size: 12px;
padding: 0 2px;
position: relative;
top: -1px;
color: #fff; }
#header .shopping_cart > a:first-child:hover::after {
content: "\f0d8";
top: -2px; }
.shopping_cart > a:first-child {
/*padding: 7px 10px;*/
padding-top: 7px;
/*background-color: #BF9958;*/
display: block;
font-weight: bold;
color: #777777;
font-size: 20px;
color: #777;
text-shadow: 1px 1px rgba(0, 0, 0, 0.2);
overflow: hidden; }
@media (min-width: 768px) and (max-width: 991px) {
@@ -49,15 +48,8 @@
.shopping_cart > a:first-child:before {
content: "\f07a";
font-family: "FontAwesome";
display: inline-block;
font-size: 20px;
line-height: 23px;
color: #fff;
top: 9px;
left: 0px;
z-index: 100;
position: absolute;
padding-right: 5px; }
z-index: 100; }
.shopping_cart .ajax_cart_total {
display: none !important; }
.shopping_cart .block_cart_expand:after, .shopping_cart .block_cart_collapse:after {
@@ -234,7 +226,7 @@
.cart_block .cart_block_tax_cost,
.cart_block .cart_block_total,
.cart_block .cart_block_wrapping_cost,
.cart_block .cart_block_additional_facilities_cost {
.cart_block .cart_block_convenience_fee {
float: right; }
.cart_block table.vouchers {
@@ -487,11 +479,10 @@
.remove_rooms_from_cart_link:hover {
color: #515151; }
.badge_style
{
.badge_style {
left: 13px;
position: absolute;
top: 2px;
top: -8px;
z-index: 200;
}
@@ -547,4 +538,4 @@
{
border: none;
}
}
}

View File

@@ -267,7 +267,10 @@ class Blockcart extends Module
unset($this->context->cookie->currentAddedProduct);
}
$totalAdditionalServicesPrice = $this->context->cart->getOrderTotal(false, Cart::ONLY_ROOM_SERVICES_WITHOUT_AUTO_ADD);
$totalAdditionalServicesWithoutAutoAddPrice = $params['cart']->getOrderTotal($useTax, Cart::ONLY_ROOM_SERVICES_WITHOUT_AUTO_ADD);
$totalAdditionalServicesWithAutoAddPrice = $params['cart']->getOrderTotal($useTax, Cart::ONLY_ROOM_SERVICES);
$totalConvenienceFee = $params['cart']->getOrderTotal($useTax, Cart::ONLY_CONVENIENCE_FEE);
$totalRoomsPrice = $params['cart']->getOrderTotal($useTax, Cart::ONLY_ROOMS);
$response = array(
'products' => $products,
@@ -285,11 +288,10 @@ class Blockcart extends Module
'tax_cost' => $tax_cost,
'wrapping_cost' => Tools::displayPrice($wrappingCost, $currency),
'product_total' => Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::ONLY_PRODUCTS), $currency),
'room_total' => Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::ONLY_ROOMS), $currency),
// 'normal_products_total' => Tools::displayPrice($params['cart']->getOrderTotal($useTax, Cart::ONLY_NORMAL_PRODUCTS), $currency),
'room_total' => Tools::displayPrice($totalRoomsPrice + $totalDemandsPrice + $totalAdditionalServicesWithAutoAddPrice - $totalConvenienceFee),
'totalToPay' => $totalToPay,
'total_extra_services' => $totalDemandsPrice + $totalAdditionalServicesPrice,
'total_extra_services_format' => Tools::displayPrice(($totalDemandsPrice + $totalAdditionalServicesPrice), $currency),
'total_convenience_fee' => $totalConvenienceFee,
'total_convenience_fee_format' => Tools::displayPrice(($totalConvenienceFee), $currency),
'total' => Tools::displayPrice($totalToPay, $currency),
'order_process' => $orderProcess,
'ajax_allowed' => (int) (Configuration::get('PS_BLOCK_CART_AJAX')) == 1 ? true : false,

View File

@@ -124,7 +124,7 @@
{$data_v['data_form']|date_format:"%d-%m-%Y"}&nbsp;-&nbsp;{$data_v['data_to']|date_format:"%d-%m-%Y"}
</td>
<td class="num_rooms_in_date">{$data_v['num_rm']}</td>
<td>{convertPrice price=$data_v['amount']}</td>
<td>{convertPrice price=($data_v['amount'] + $data_v['demand_price'])}</td>
<td><a class="remove_rooms_from_cart_link" href="#" rm_price="{$data_v['amount']}" id_product="{$product.id_product|intval}" date_from="{$data_v['data_form']}" date_to="{$data_v['data_to']}" num_rooms="{$data_v['num_rm']}" title="{l s='remove this room from my cart' mod='blockcart'}"></a></td>
</tr>
{/foreach}
@@ -222,10 +222,10 @@
<span>{l s='Tax' mod='blockcart'}</span>
</div>
{/if}
{if isset($total_extra_services)}
{if isset($total_convenience_fee)}
<div class="cart-prices-line">
<span class="price cart_block_additional_facilities_cost ajax_cart_extra_demands_cost">{convertPrice price=$total_extra_services}</span>
<span class="price">{l s='Extra Services Cost' mod='blockcart'}</strong>
<span class="price cart_block_convenience_fee ajax_cart_convenience_fee">{convertPrice price=$total_convenience_fee}</span>
<span class="price">{l s='Convenience Fees' mod='blockcart'}</strong>
</div>
{/if}
<div class="cart-prices-line last-line">
@@ -314,7 +314,7 @@
{/if}
{/if}
</strong>
<span class="ajax_block_products_total">
<span class="ajax_block_room_total pull-right">
{if $cart_qties > 0}
{convertPrice price=$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS)}
{/if}
@@ -354,16 +354,16 @@
{/if}
</span>
</div> -->
{if isset($total_extra_services)}
{if isset($total_convenience_fee)}
<div class="layer_cart_row">
<strong class="dark">{l s='Total Extra Services Cost' mod='blockcart'}</strong>
<span class="price ajax_cart_extra_demands_cost">{convertPrice price=$total_extra_services}</span>
<strong class="dark">{l s='Convenience Fees' mod='blockcart'}</strong>
<span class="price ajax_cart_convenience_fee pull-right">{convertPrice price=$total_convenience_fee}</span>
</div>
{/if}
{if $show_tax && $use_tax}
<div class="layer_cart_row">
<strong class="dark">{l s='Tax' mod='blockcart'}</strong>
<span class="price cart_block_tax_cost ajax_cart_tax_cost">{$tax_cost}</span>
<span class="price cart_block_tax_cost ajax_cart_tax_cost pull-right">{$tax_cost}</span>
</div>
{/if}
<div class="layer_cart_row">
@@ -377,7 +377,7 @@
{/if}
{/if}
</strong>
<span class="ajax_block_cart_total">
<span class="ajax_block_cart_total pull-right">
{if $cart_qties > 0}
{if $priceDisplay == 1}
{convertPrice price=$cart->getOrderTotal(false)}

View File

@@ -223,7 +223,7 @@ class DashInsights extends Module
unset($idsHotel[$key]);
}
if (count($idsHotel) > 2) { // display average series only if other hotels are available
if (count($idsHotel) > 0) { // display average series only if other hotels are available
$averageRoomNightsData = AdminStatsController::getRoomNightsData($dateFrom, $dateTo, $idsHotel, true, true);
$averageSeriesInfo = array(
'data' => $averageRoomNightsData,
@@ -332,7 +332,7 @@ class DashInsights extends Module
unset($idsHotel[$key]);
}
if (count($idsHotel) > 1) { // display average series only if other hotels are available
if (count($idsHotel) > 0) { // display average series only if other hotels are available
$averageDaysOfTheWeekData = AdminStatsController::getOccupiedRoomsForDaysOfTheWeek($dateFrom, $dateTo, $idsHotel, true, true);
$averageSeriesInfo = array(
'data' => $averageDaysOfTheWeekData,
@@ -465,7 +465,7 @@ class DashInsights extends Module
unset($idsHotel[$key]);
}
if (count($idsHotel) > 1) { // display average series only if other hotels are available
if (count($idsHotel) > 0) { // display average series only if other hotels are available
$averageLengthOfStayData = AdminStatsController::getLengthOfStayPercentages($day, $dateFrom, $dateTo, $idsHotel, true, true);
$averageSeriesInfo = array(
'data' => $averageLengthOfStayData,

View File

@@ -20,7 +20,6 @@
function line_chart_dashinsights(widget_name, chart_details) {
nv.addGraph(function () {
var chart = nv.models.lineChart()
.interpolate('basis')
.useInteractiveGuideline(true)
.x(function (d) { return (d !== undefined ? d[0] : 0); })
.y(function (d) { return (d !== undefined ? d[1] : 0); })
@@ -88,12 +87,30 @@ function multibar_chart_los_dashinsights(widget_name, chart_details) {
chart.yAxis.tickFormat(d3.format(chart_details['y_format']));
chart.dispatch.stateChange = function () {
setTimeout(function () {
positionXAxisLabel();
}, 10);
}
d3.select('#dashinsights_length_of_stay svg')
.datum(chart_details.data)
.call(chart);
nv.utils.windowResize(chart.update);
positionXAxisLabel();
nv.utils.windowResize(function() {
chart.update();
positionXAxisLabel();
});
return chart;
});
function positionXAxisLabel() {
d3.select('#dashinsights_length_of_stay .nv-x .nv-axislabel').attr(
'transform',
d3.transform('rotate(-90) translate(-130, 40)').toString()
);
}
}

View File

@@ -88,7 +88,7 @@ class DashPerformance extends Module
$params['date_from'],
$params['date_to'],
$params['id_hotel']
)).'%';
) * 100).'%';
$data['dp_revenue_per_available_room'] = Tools::displayPrice(AdminStatsController::getRevenuePerAvailableRoom(
$params['date_from'],
$params['date_to'],
@@ -108,12 +108,12 @@ class DashPerformance extends Module
$params['date_from'],
$params['date_to'],
$params['id_hotel']
)).'%';
) * 100).'%';
$data['dp_cancellation_rate'] = sprintf('%0.2f', AdminStatsController::getCancellationRate(
$params['date_from'],
$params['date_to'],
$params['id_hotel']
)).'%';
) * 100).'%';
}
return array('data_value' => $data);

View File

@@ -24,17 +24,17 @@ class HotelHelper
{
$objModule = new HotelreservationSystem();
$jsVars = array(
'display_name' => $objModule->l('Display', 'HotelHelper'),
'records_name' => $objModule->l('records per page', 'HotelHelper'),
'no_product' => $objModule->l('No records found', 'HotelHelper'),
'show_page' => $objModule->l('Showing page', 'HotelHelper'),
'show_of' => $objModule->l('of', 'HotelHelper'),
'no_record' => $objModule->l('No records available', 'HotelHelper'),
'filter_from' => $objModule->l('filtered from', 'HotelHelper'),
't_record' => $objModule->l('total records', 'HotelHelper'),
'search_item' => $objModule->l('Search', 'HotelHelper'),
'p_page' => $objModule->l('Previous', 'HotelHelper'),
'n_page' => $objModule->l('Next', 'HotelHelper'),
'display_name' => $objModule->l('Display', 'HotelHelper', fasle, true),
'records_name' => $objModule->l('records per page', 'HotelHelper', fasle, true),
'no_product' => $objModule->l('No records found', 'HotelHelper', fasle, true),
'show_page' => $objModule->l('Showing page', 'HotelHelper', fasle, true),
'show_of' => $objModule->l('of', 'HotelHelper', fasle, true),
'no_record' => $objModule->l('No records available', 'HotelHelper', fasle, true),
'filter_from' => $objModule->l('filtered from', 'HotelHelper', fasle, true),
't_record' => $objModule->l('total records', 'HotelHelper', fasle, true),
'search_item' => $objModule->l('Search', 'HotelHelper', fasle, true),
'p_page' => $objModule->l('Previous', 'HotelHelper', fasle, true),
'n_page' => $objModule->l('Next', 'HotelHelper', fasle, true),
);
Media::addJsDef($jsVars);

View File

@@ -99,7 +99,7 @@ class RoomTypeServiceProduct extends ObjectModel
public function getProductsForRoomType($idProductRoomType)
{
$sql .= 'SELECT `id_room_type_service_product`, `id_product`, `position` FROM `'._DB_PREFIX_.'htl_room_type_service_product`
$sql = 'SELECT `id_room_type_service_product`, `id_product`, `position` FROM `'._DB_PREFIX_.'htl_room_type_service_product`
WHERE `element_type` = '.self::WK_ELEMENT_TYPE_ROOM_TYPE.' AND `id_element` = '.(int)$idProductRoomType.'
ORDER BY `position` ASC';

View File

@@ -724,11 +724,11 @@ class AdminAddHotelController extends ModuleAdminController
Media::addJsDef(
array(
'filesizeError' => $this->l('File exceeds maximum size.'),
'filesizeError' => $this->l('File exceeds maximum size.', null, true),
'maxSizeAllowed' => Tools::getMaxUploadSize(),
'sortRowsUrl' => $this->context->link->getAdminLink('AdminAddHotel'),
'primaryHotelId' => Configuration::get('WK_PRIMARY_HOTEL'),
'disableHotelMsg' => $this->l('Primary hotel for website will be updated to first available active hotel.'),
'disableHotelMsg' => $this->l('Primary hotel for website will be updated to first available active hotel.', null, true),
)
);
// GOOGLE MAP

View File

@@ -419,7 +419,7 @@ class AdminHotelGeneralSettingsController extends ModuleAdminController
parent::setMedia();
Media::addJsDef(
array(
'filesizeError' => $this->l('File exceeds maximum size.'),
'filesizeError' => $this->l('File exceeds maximum size.', null, true),
'maxSizeAllowed' => Tools::getMaxUploadSize(),
)
);

View File

@@ -122,9 +122,8 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
$id_room_type = 0;
}
if (Tools::getValue('occupancy')) {
$occupancy = Tools::getValue('occupancy');
} else {
$occupancy = Tools::getValue('occupancy');
if (!Validate::isOccupancy($occupancy)) {
$occupancy = array();
}
@@ -616,6 +615,9 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
$date_from = Tools::getValue('date_from');
$date_to = Tools::getValue('date_to');
$occupancy = Tools::getValue('occupancy');
if (!Validate::isOccupancy($occupancy)) {
$occupancy = array();
}
$date_from = date("Y-m-d", strtotime($date_from));
$date_to = date("Y-m-d", strtotime($date_to));
@@ -807,33 +809,33 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'),
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
'rooms_booking_url' => $this->context->link->getAdminLink('AdminHotelRoomsBooking'),
'opt_select_all' => $this->l('All Types'),
'slt_another_htl' => $this->l('Select Another Hotel'),
'product_type_cond' => $this->l('Product type is required'),
'from_date_cond' => $this->l('From date is required'),
'to_date_cond' => $this->l('To date is required'),
'hotel_name_cond' => $this->l('Hotel Name is required'),
'num_rooms_cond' => $this->l('Number of Rooms is required'),
'add_to_cart' => $this->l('Add To Cart'),
'remove' => $this->l('Remove'),
'noRoomTypeAvlTxt' => $this->l('No room type available.'),
'no_rm_avail_txt' => $this->l('No rooms available.'),
'slct_rm_err' => $this->l('Please select a room first.'),
'product_added_cart_txt' => $this->l('Product added in cart'),
'opt_select_all' => $this->l('All Types', null, true),
'slt_another_htl' => $this->l('Select Another Hotel', null, true),
'product_type_cond' => $this->l('Product type is required', null, true),
'from_date_cond' => $this->l('From date is required', null, true),
'to_date_cond' => $this->l('To date is required', null, true),
'hotel_name_cond' => $this->l('Hotel Name is required', null, true),
'num_rooms_cond' => $this->l('Number of Rooms is required', null, true),
'add_to_cart' => $this->l('Add To Cart', null, true),
'remove' => $this->l('Remove', null, true),
'noRoomTypeAvlTxt' => $this->l('No room type available.', null, true),
'no_rm_avail_txt' => $this->l('No rooms available.', null, true),
'slct_rm_err' => $this->l('Please select a room first.', null, true),
'product_added_cart_txt' => $this->l('Product added in cart', null, true),
'info_icon_path' => _MODULE_DIR_.$this->module->name.'/views/img/Slices/info-icon.svg',
'select_age_txt' => 'Select age',
'under_1_age' => 'Under 1',
'room_txt' => 'Room',
'rooms_txt' => 'Rooms',
'remove_txt' => 'Remove',
'adult_txt' => 'Adults',
'adults_txt' => 'Adults',
'child_txt' => 'Child',
'children_txt' => 'Children',
'below_txt' => 'Below',
'years_txt' => 'years',
'all_children_txt' => 'All Children',
'invalid_occupancy_txt' => 'Invalid occupancy(adults/children) found.',
'select_age_txt' => $this->l('Select age', null, true),
'under_1_age' => $this->l('Under 1', null, true),
'room_txt' => $this->l('Room', null, true),
'rooms_txt' => $this->l('Rooms', null, true),
'remove_txt' => $this->l('Remove', null, true),
'adult_txt' => $this->l('Adults', null, true),
'adults_txt' => $this->l('Adults', null, true),
'child_txt' => $this->l('Child', null, true),
'children_txt' => $this->l('Children', null, true),
'below_txt' => $this->l('Below', null, true),
'years_txt' => $this->l('years', null, true),
'all_children_txt' => $this->l('All Children', null, true),
'invalid_occupancy_txt' => $this->l('Invalid occupancy(adults/children) found.', null, true),
// 'check_calender_var' => $check_calender_var,
);
if (Configuration::get('PS_BACKOFFICE_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS ) {

View File

@@ -73,23 +73,25 @@ class HotelReservationSystem extends Module
date('d-m-Y', strtotime(date('Y-m-d', time()).' + 1 year'))
);
}
/*To remove room from cart before todays date*/
if (isset($this->context->cart->id) && $this->context->cart->id) {
$htlCart = new HotelCartBookingData();
if ($cartBookingData = $htlCart->getCartBookingDetailsByIdCartIdGuest(
$this->context->cart->id,
$this->context->cart->id_guest,
$this->context->language->id
)) {
foreach ($cartBookingData as $cartRoom) {
if (strtotime($cartRoom['date_from']) < strtotime(date('Y-m-d'))) {
$htlCart->deleteRoomDataFromOrderLine(
$cartRoom['id_cart'],
$cartRoom['id_guest'],
$cartRoom['id_product'],
$cartRoom['date_from'],
$cartRoom['date_to']
);
if (!Configuration::get('PS_CATALOG_MODE')) {
/*To remove room from cart before todays date*/
if (isset($this->context->cart->id) && $this->context->cart->id) {
$htlCart = new HotelCartBookingData();
if ($cartBookingData = $htlCart->getCartBookingDetailsByIdCartIdGuest(
$this->context->cart->id,
$this->context->cart->id_guest,
$this->context->language->id
)) {
foreach ($cartBookingData as $cartRoom) {
if (strtotime($cartRoom['date_from']) < strtotime(date('Y-m-d'))) {
$htlCart->deleteRoomDataFromOrderLine(
$cartRoom['id_cart'],
$cartRoom['id_guest'],
$cartRoom['id_product'],
$cartRoom['date_from'],
$cartRoom['date_to']
);
}
}
}
}

View File

@@ -714,7 +714,7 @@ $(document).ready(function() {
occupancy_block += '<input type="number" class="form-control num_occupancy num_adults" name="occupancy['+roomBlockIndex+'][adults]" value="1" min="1">';
occupancy_block += '</div>';
occupancy_block += '<div class="form-group col-xs-6 occupancy_count_block">';
occupancy_block += '<label>' + child_txt + '<span class="label-desc-txt"></span></label>';
occupancy_block += '<label>' + children_txt + '<span class="label-desc-txt"></span></label>';
occupancy_block += '<input type="number" class="form-control num_occupancy num_children" name="occupancy['+roomBlockIndex+'][children]" value="0" min="0" max="'+max_child_in_room+'">(' + below_txt + ' ' + max_child_age + ' ' + years_txt + ')';
occupancy_block += '</div>';
occupancy_block += '</div>';

View File

@@ -41,8 +41,8 @@ class QloBlockContact extends Module
public function install()
{
if (!parent::install()
|| !Configuration::updateValue('QBC_PHONE', '')
|| !Configuration::updateValue('QBC_EMAIL', '')
|| !Configuration::updateValue('QBC_PHONE', Configuration::get('WK_HOTEL_GLOBAL_CONTACT_NUMBER'))
|| !Configuration::updateValue('QBC_EMAIL', Configuration::get('WK_HOTEL_GLOBAL_CONTACT_EMAIL'))
|| !$this->registerHook('actionFrontControllerSetMedia')
|| !$this->registerHook('displayNav')
|| !$this->registerHook('displayExternalNavigationHook')

View File

@@ -204,11 +204,19 @@ class QloCleaner extends Module
switch ($case) {
case 'catalog':
$id_home = Configuration::getMultiShopValues('PS_HOME_CATEGORY');
$id_root = Configuration::getMultiShopValues('PS_ROOT_CATEGORY');
$db->execute('DELETE FROM `'._DB_PREFIX_.'category` WHERE id_category NOT IN ('.implode(',', array_map('intval', $id_home)).', '.implode(',', array_map('intval', $id_root)).')');
$db->execute('DELETE FROM `'._DB_PREFIX_.'category_lang` WHERE id_category NOT IN ('.implode(',', array_map('intval', $id_home)).', '.implode(',', array_map('intval', $id_root)).')');
$db->execute('DELETE FROM `'._DB_PREFIX_.'category_shop` WHERE id_category NOT IN ('.implode(',', array_map('intval', $id_home)).', '.implode(',', array_map('intval', $id_root)).')');
$id_home = Configuration::getMultiShopValues('PS_HOME_CATEGORY');
$id_locations = Configuration::getMultiShopValues('PS_LOCATIONS_CATEGORY');
$id_services = Configuration::getMultiShopValues('PS_SERVICE_CATEGORY');
$not_in = implode(',', array_map('intval', $id_root)).','.
implode(',', array_map('intval', $id_home)).','.
implode(',', array_map('intval', $id_locations)).','.
implode(',', array_map('intval', $id_services));
$db->execute('DELETE FROM `'._DB_PREFIX_.'category` WHERE id_category NOT IN ('.$not_in.')');
$db->execute('DELETE FROM `'._DB_PREFIX_.'category_lang` WHERE id_category NOT IN ('.$not_in.')');
$db->execute('DELETE FROM `'._DB_PREFIX_.'category_shop` WHERE id_category NOT IN ('.$not_in.')');
foreach (scandir(_PS_CAT_IMG_DIR_) as $dir) {
if (preg_match('/^[0-9]+(\-(.*))?\.jpg$/', $dir)) {
unlink(_PS_CAT_IMG_DIR_.$dir);
@@ -646,18 +654,17 @@ class QloCleaner extends Module
array('htl_features_block_data_lang', 'id_features_block', 'htl_features_block_data', 'id_features_block'),
array('cart_rule', 'id_customer', 'customer', 'id_customer'),
array('htl_testimonials_block_data_lang', 'id_testimonial_block', 'htl_testimonials_block_data', 'id_testimonial_block'),
array('htl_room_type_global_demand', 'id_tax_rules_group', 'tax_rules_group', 'id_tax_rules_group'),
array('htl_room_type_global_demand_advance_option', 'id_global_demand', 'htl_room_type_global_demand', 'id_global_demand'),
array('htl_room_type_global_demand_advance_option_lang', 'id_lang', 'lang', 'id_lang'),
array('htl_room_type_global_demand_advance_option_lang', 'id_option', 'htl_room_type_global_demand_advance_option', 'id_option'),
array('htl_room_type_global_demand_lang', 'id_global_demand', 'htl_room_type_global_demand', 'id_global_demand'),
array('htl_branch_info_lang', 'id_lang', 'lang', 'id_lang'),
array('htl_branch_info_lang', 'id', 'htl_branch_info', 'id'),
array('htl_features_lang', 'id_lang', 'lang', 'id_lang'),
array('htl_features_lang', 'id', 'htl_features', 'id'),
array('htl_room_type_demand', 'id_global_demand', 'htl_room_type_global_demand', 'id_global_demand'),
array('htl_room_type_demand', 'id_product', 'product', 'id_product'),
array('htl_room_type_demand_price', 'id_product', 'product', 'id_product'),
array('htl_room_type_global_demand_advance_option_lang', 'id_lang', 'lang', 'id_lang'),
array('htl_room_type_global_demand_advance_option_lang', 'id_option', 'htl_room_type_global_demand_advance_option', 'id_option'),
array('htl_room_type_feature_pricing_group', 'id_group', 'group', 'id_group'),
array('htl_booking_demands_tax', 'id_tax', 'tax', 'id_tax'),
array('htl_booking_detail', 'id_product', 'product', 'id_product'),

View File

@@ -171,7 +171,7 @@ class QloHotelReview extends Module
'admin_approval_enabled' => (int) Configuration::get('QHR_ADMIN_APPROVAL_ENABLED'),
'texts' => array(
'num_files' => sprintf(
$this->l('You can upload a maximum of %d images.'),
$this->l('You can upload a maximum of %d images.', false, true),
(int) Configuration::get('QHR_MAX_IMAGES_PER_REVIEW')
),
),

View File

@@ -152,6 +152,9 @@ class StatsBestCategories extends ModuleGrid
$date_between = $this->getDate();
$date_from = date('Y-m-d', strtotime($this->_employee->stats_date_from));
$date_to = date('Y-m-d', strtotime($this->_employee->stats_date_to));
if ($date_from == $date_to) {
$date_to = date('Y-m-d', strtotime('+1 day', strtotime($date_to)));
}
$id_lang = $this->getLang();
//If column 'order_detail.original_wholesale_price' does not exist, create it

View File

@@ -154,6 +154,9 @@ class StatsBestProducts extends ModuleGrid
$date_between = $this->getDate();
$date_from = date('Y-m-d', strtotime($this->_employee->stats_date_from));
$date_to = date('Y-m-d', strtotime($this->_employee->stats_date_to));
if ($date_from == $date_to) {
$date_to = date('Y-m-d', strtotime('+1 day', strtotime($date_to)));
}
$array_date_between = explode(' AND ', $date_between);
$id_lang = $this->getLang();

View File

@@ -397,7 +397,7 @@ class AdminAboutHotelBlockSettingController extends ModuleAdminController
parent::setMedia();
Media::addJsDef(
array(
'filesizeError' => $this->l('File exceeds maximum size.'),
'filesizeError' => $this->l('File exceeds maximum size.', null, true),
'maxSizeAllowed' => Tools::getMaxUploadSize(),
)
);

View File

@@ -40,6 +40,8 @@
}
.interiorboxInner img {
width: 100%;
height: 100%;
object-fit: cover;
}
.htlInterior-owlCarousel .owl-prev, .htlInterior-owlCarousel .owl-next{
font-size: 40px;

View File

@@ -428,7 +428,7 @@ class AdminFeaturesModuleSettingController extends ModuleAdminController
parent::setMedia();
Media::addJsDef(
array(
'filesizeError' => $this->l('File exceeds maximum size.'),
'filesizeError' => $this->l('File exceeds maximum size.', null, true),
'maxSizeAllowed' => Tools::getMaxUploadSize(),
)
);

View File

@@ -66,7 +66,7 @@ class wkhotelfilterblock extends Module
$htl_id_category = Tools::getValue('id_category');
if (Validate::isLoadedObject($objCategory = new Category((int) $htl_id_category))) {
if ($objCategory->hasParent(Configuration::get('PS_LOCATIONS_CATEGORY'))) {
Media::addJsDef(array('noRoomAvailTxt' => $this->l('No room available')));
Media::addJsDef(array('noRoomAvailTxt' => $this->l('No room available', false, true)));
$this->context->controller->addJS($this->_path.'/views/js/wkhotelfilterblock.js');
$this->context->controller->addCSS($this->_path.'/views/css/wkhotelfilterblock.css');

View File

@@ -183,16 +183,20 @@ class WkRoomSearchHelper
if ($occupancyEnabled) {
// send occupancy information searched by the user
if ($searchedData['occupancies'] = Tools::getvalue('occupancy')) {
$searchedData['occupancy_adults'] = array_sum(
array_column($searchedData['occupancies'], 'adults')
);
$searchedData['occupancy_children'] = array_sum(
array_column($searchedData['occupancies'], 'children')
);
$searchedData['occupancy_child_ages'] = array_sum(
array_column($searchedData['occupancies'], 'child_ages')
);
if ($occupancies = Tools::getvalue('occupancy')) {
if (Validate::isOccupancy($occupancies)) {
if ($searchedData['occupancies'] = $occupancies) {
$searchedData['occupancy_adults'] = array_sum(
array_column($searchedData['occupancies'], 'adults')
);
$searchedData['occupancy_children'] = array_sum(
array_column($searchedData['occupancies'], 'children')
);
$searchedData['occupancy_child_ages'] = array_sum(
array_column($searchedData['occupancies'], 'child_ages')
);
}
}
}
}
$smartyVars['search_data'] = $searchedData;

View File

@@ -172,7 +172,8 @@
.header-rmsearch-wrapper .label-desc-txt {
font-size: 12px;
color: #777777;}
color: #777777;
margin: 0;}
.header-rmsearch-wrapper .btn {
font-weight: 600;}
.header-rmsearch-wrapper .btn-primary {

View File

@@ -367,7 +367,7 @@ $(document).ready(function() {
occupancy_block += '</div>';
occupancy_block += '</div>';
occupancy_block += '<div class="form-group occupancy_count_block">';
occupancy_block += '<label>' + child_txt + '<span class="label-desc-txt"> (' + below_txt + ' ' + max_child_age + ' ' + years_txt + ')</span></label>';
occupancy_block += '<label>' + children_txt + '<p class="label-desc-txt"> (' + below_txt + ' ' + max_child_age + ' ' + years_txt + ')</p></label>';
occupancy_block += '<div>';
occupancy_block += '<input type="hidden" class="num_occupancy num_children room_occupancies" name="occupancy['+roomBlockIndex+'][children]" value="0">';
occupancy_block += '<div class="occupancy_count pull-left">';

View File

@@ -93,7 +93,7 @@
</div>
</div>
<div class="form-group occupancy_count_block">
<label>{l s='Child' mod='wkroomsearchblock'}<span class="label-desc-txt"> ({l s='Below' mod='wkroomsearchblock'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years' mod='wkroomsearchblock'})</span></label>
<label>{l s='Children' mod='wkroomsearchblock'}<span class="label-desc-txt"> ({l s='Below' mod='wkroomsearchblock'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years' mod='wkroomsearchblock'})</span></label>
<div>
<input type="hidden" class="num_occupancy num_children room_occupancies" name="occupancy[{$key|escape:'htmlall':'UTF-8'}][children]" value="{$occupancy['children']|escape:'htmlall':'UTF-8'}">
<div class="occupancy_count pull-left">
@@ -158,7 +158,7 @@
</div>
</div>
<div class="form-group occupancy_count_block">
<label>{l s='Child' mod='wkroomsearchblock'} <span class="label-desc-txt">({l s='Below' mod='wkroomsearchblock'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years' mod='wkroomsearchblock'})</span></label>
<label>{l s='Children' mod='wkroomsearchblock'} <p class="label-desc-txt">({l s='Below' mod='wkroomsearchblock'} {$max_child_age|escape:'htmlall':'UTF-8'} {l s='years' mod='wkroomsearchblock'})</p></label>
<div>
<input type="hidden" class="num_occupancy num_children room_occupancies" name="occupancy[0][children]" value="0">
<div class="occupancy_count pull-left">

View File

@@ -61,26 +61,26 @@ class WkRoomSearchBlock extends Module
'wkroomsearchblock',
'autocompletesearch'
),
'no_results_found_cond' => $this->l('No results found for this search'),
'hotel_name_cond' => $this->l('Please select a hotel name'),
'check_in_time_cond' => $this->l('Please enter Check In time'),
'check_out_time_cond' => $this->l('Please enter Check Out time'),
'less_checkin_date' => $this->l('Check In date can not be before current date.'),
'more_checkout_date' => $this->l('Check Out date must be greater than Check In date.'),
'select_htl_txt' => $this->l('Select Hotel'),
'select_age_txt' => $this->l('Select age'),
'under_1_age' => $this->l('Under 1'),
'room_txt' => $this->l('Room'),
'rooms_txt' => $this->l('Rooms'),
'remove_txt' => $this->l('Remove'),
'adult_txt' => $this->l('Adult'),
'adults_txt' => $this->l('Adults'),
'child_txt' => $this->l('Child'),
'children_txt' => $this->l('Children'),
'below_txt' => $this->l('Below'),
'years_txt' => $this->l('years'),
'all_children_txt' => $this->l('All Children'),
'invalid_occupancy_txt' => $this->l('Invalid occupancy(adults/children) found.'),
'no_results_found_cond' => $this->l('No results found for this search', false, true),
'hotel_name_cond' => $this->l('Please select a hotel name', false, true),
'check_in_time_cond' => $this->l('Please enter Check In time', false, true),
'check_out_time_cond' => $this->l('Please enter Check Out time', false, true),
'less_checkin_date' => $this->l('Check In date can not be before current date.', false, true),
'more_checkout_date' => $this->l('Check Out date must be greater than Check In date.', false, true),
'select_htl_txt' => $this->l('Select Hotel', false, true),
'select_age_txt' => $this->l('Select age', false, true),
'under_1_age' => $this->l('Under 1', false, true),
'room_txt' => $this->l('Room', false, true),
'rooms_txt' => $this->l('Rooms', false, true),
'remove_txt' => $this->l('Remove', false, true),
'adult_txt' => $this->l('Adult', false, true),
'adults_txt' => $this->l('Adults', false, true),
'child_txt' => $this->l('Child', false, true),
'children_txt' => $this->l('Children', false, true),
'below_txt' => $this->l('Below', false, true),
'years_txt' => $this->l('years', false, true),
'all_children_txt' => $this->l('All Children', false, true),
'invalid_occupancy_txt' => $this->l('Invalid occupancy(adults/children) found.', false, true),
)
);
}

View File

@@ -406,7 +406,7 @@ class AdminTestimonialsModuleSettingController extends ModuleAdminController
parent::setMedia();
Media::addJsDef(
array(
'filesizeError' => $this->l('File exceeds maximum size.'),
'filesizeError' => $this->l('File exceeds maximum size.', null, true),
'maxSizeAllowed' => Tools::getMaxUploadSize(),
)
);

View File

@@ -251,10 +251,10 @@ p.capa_txt {
.booking_guest_occupancy_conatiner {
display: flex;
}
.booking_guest_occupancy_conatiner .booking_occupancy_wrapper {
left: unset;
}
@media (min-width: 992px) {
.booking_guest_occupancy_conatiner .booking_occupancy_wrapper {
left: unset;
}
.room_features_cont > div {
display: flex;
flex-wrap: wrap;

View File

@@ -226,7 +226,7 @@
.cart_block .cart_block_tax_cost,
.cart_block .cart_block_total,
.cart_block .cart_block_wrapping_cost,
.cart_block .cart_block_additional_facilities_cost {
.cart_block .cart_block_convenience_fee {
float: right; }
.cart_block table.vouchers {

View File

@@ -912,7 +912,7 @@ var ajaxCart = {
content += '<tr class="rooms_remove_container">';
content += '<td>' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_form)) + '&nbsp;-&nbsp;' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v.data_to)) + '</td>';
content += '<td class="num_rooms_in_date">' + date_diff_v.num_rm + '</td>';
content += '<td>' + formatCurrency(parseFloat(date_diff_v.amount), currency_format, currency_sign, currency_blank) + '</td>';
content += '<td>' + formatCurrency(parseFloat(date_diff_v.amount) + parseFloat(date_diff_v.demand_price), currency_format, currency_sign, currency_blank) + '</td>';
content += '<td>';
content += '<a class="remove_rooms_from_cart_link" href="#" rm_price=' + date_diff_v.amount + ' id_product=' + productId + ' date_from=' + date_diff_v.data_form + ' date_to=' + date_diff_v.data_to + ' num_rooms=' + date_diff_v.num_rm + ' title="' + remove_rm_title + '"></a>';
content += '</td>';
@@ -949,7 +949,7 @@ var ajaxCart = {
booking_dates_content += '<tr class="rooms_remove_container">';
booking_dates_content += '<td>' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_form)) + '&nbsp;-&nbsp;' + $.datepicker.formatDate(ajaxCart.dateFormat, new Date(date_diff_v1.data_to)) + '</td>';
booking_dates_content += '<td class="num_rooms_in_date">' + date_diff_v1.num_rm + '</td>';
booking_dates_content += '<td>' + formatCurrency(parseFloat(date_diff_v1.amount), currency_format, currency_sign, currency_blank) + '</td>';
booking_dates_content += '<td>' + formatCurrency(parseFloat(date_diff_v1.amount) + parseFloat(date_diff_v1.demand_price), currency_format, currency_sign, currency_blank) + '</td>';
booking_dates_content += '<td>';
booking_dates_content += '<a class="remove_rooms_from_cart_link" href="#" rm_price=' + date_diff_v1.amount + ' id_product=' + productId + ' date_from=' + date_diff_v1.data_form + ' date_to=' + date_diff_v1.data_to + ' num_rooms=' + date_diff_v1.num_rm + ' title="' + remove_rm_title + '"></a>';
booking_dates_content += '</td>';
@@ -1154,16 +1154,20 @@ var ajaxCart = {
if (hasDeliveryAddress)
$('.ajax_cart_shipping_cost').parent().find('.unvisible').show();
$('.ajax_cart_tax_cost').text(jsonData.taxCost);
$('.ajax_cart_tax_cost').text(jsonData.tax_cost);
$('.cart_block_wrapping_cost').text(jsonData.wrapping_cost);
$('.ajax_block_cart_total').text(jsonData.total);
$('.ajax_block_cart_total').attr('total_cart_price', jsonData.totalToPay);
$('.ajax_block_products_total').text(jsonData.product_total);
$('.ajax_block_room_total').text(jsonData.roomTotal);
$('.ajax_block_room_total').text(jsonData.room_total);
$('.ajax_block_nornal_products_total').text(jsonData.normalProductsTotal);
$('.ajax_cart_extra_demands_cost').text(jsonData.total_extra_services_format);
$('.ajax_cart_convenience_fee').text(jsonData.total_convenience_fee_format);
if (jsonData.total_convenience_fee) {
$('.ajax_cart_convenience_fee').parent().show();
} else {
$('.ajax_cart_convenience_fee').parent().hide();
}
$('.ajax_total_price_wt').text(jsonData.total_price_wt);
if (parseFloat(jsonData.free_shipping_float) > 0) {
@@ -1255,6 +1259,16 @@ function disableRoomTypeDemands(show) {
}
}
function disableRoomTypeServices(disable) {
if (disable) {
$('#service_products_cont').find('button.add_roomtype_product').attr('disabled', 'disabled');
$('#service_products_cont').find('.qty_container .qty_direction a').attr('disabled', 'disabled');
} else {
$('#service_products_cont').find('button.add_roomtype_product').removeAttr('disabled');
$('#service_products_cont').find('.qty_container .qty_direction a').removeAttr('disabled');
}
}
function getRoomsExtraDemands()
{
var roomDemands = [];

View File

@@ -228,7 +228,7 @@ $(document).ready(function(){
occupancy_block += '</div>';
occupancy_block += '<div class="form-group col-sm-7 col-xs-6 occupancy_count_block">';
occupancy_block += '<div class="row">';
occupancy_block += '<label class="col-sm-12">' + child_txt + '<span class="label-desc-txt">(' + below_txt + ' ' + max_child_age + ' ' + years_txt + ')</span></label>';
occupancy_block += '<label class="col-sm-12">' + children_txt + '<span class="label-desc-txt">(' + below_txt + ' ' + max_child_age + ' ' + years_txt + ')</span></label>';
occupancy_block += '<div class="col-sm-12">';
occupancy_block += '<input type="hidden" class="num_occupancy num_children room_occupancies" name="occupancy['+roomBlockIndex+'][children]" value="0">';
occupancy_block += '<div class="occupancy_count pull-left">';

View File

@@ -35,38 +35,40 @@ $(document).ready(function()
// room price details tooltip
if ($('.room_price_detail_block .room-price-detail').length) {
$('.room_price_detail_block .room-price-detail img').tooltip({
content: $('.room_price_detail_block .room-price-detail-container').html(),
items: "span",
trigger : 'hover',
tooltipClass: "room-price-detail-tooltip",
open: function(event, ui)
{
if (typeof(event.originalEvent) === 'undefined')
$('.room_price_detail_block .room-price-detail').each(function (i, element) {
$(this).find('img').tooltip({
content: $(this).closest('.price_block').find('.room-price-detail-container').html(),
items: "span",
trigger : 'hover',
tooltipClass: "room-price-detail-tooltip",
open: function(event, ui)
{
return false;
}
var $id = $(ui.tooltip).attr('id');
if ($('div.ui-tooltip').not('#' + $id).length) {
return false;
}
},
close: function(event, ui)
{
ui.tooltip.hover(function()
{
$(this).stop(true).fadeTo(400, 1);
},
function()
{
$(this).fadeOut('400', function()
if (typeof(event.originalEvent) === 'undefined')
{
$(this).remove();
return false;
}
var $id = $(ui.tooltip).attr('id');
if ($('div.ui-tooltip').not('#' + $id).length) {
return false;
}
},
close: function(event, ui)
{
ui.tooltip.hover(function()
{
$(this).stop(true).fadeTo(400, 1);
},
function()
{
$(this).fadeOut('400', function()
{
$(this).remove();
});
});
});
}
}
});
});
}

View File

@@ -1350,8 +1350,10 @@ var BookingForm = {
}
if (!$('.max_avail_type_qty').length || $('.max_avail_type_qty').val() < 1) {
disableRoomTypeDemands(1);
disableRoomTypeServices(1);
} else {
disableRoomTypeDemands(0);
disableRoomTypeServices(0);
}
},
initDatepicker: function(max_order_date, preparation_time, dateFrom, dateTo) {
@@ -1359,6 +1361,14 @@ var BookingForm = {
if (preparation_time) {
start_date.setDate(start_date.getDate() + parseInt(preparation_time));
start_date.setHours(0, 0, 0, 0);
if (dateFrom && new Date(dateFrom + ' 00:00:00') < start_date) {
dateFrom = $.datepicker.formatDate('yy-mm-dd', start_date);
if (new Date(dateTo + ' 00:00:00') <= start_date) {
dateTo = new Date(start_date);
dateTo.setDate(start_date.getDate() + 1);
dateTo = $.datepicker.formatDate('yy-mm-dd', dateTo);
}
}
}
if (max_order_date) {
@@ -1382,7 +1392,6 @@ var BookingForm = {
max_order_date = $.datepicker.formatDate('dd-mm-yy', max_order_date);
}
$('#room_date_range').dateRangePicker({
startDate: $.datepicker.formatDate('dd-mm-yy', new Date()),
endDate: max_order_date,
startDate: start_date,
}).on('datepicker-change', function(event,obj){

View File

@@ -124,7 +124,7 @@
{$data_v['data_form']|date_format:"%d-%m-%Y"}&nbsp;-&nbsp;{$data_v['data_to']|date_format:"%d-%m-%Y"}
</td>
<td class="num_rooms_in_date">{$data_v['num_rm']}</td>
<td>{convertPrice price=$data_v['amount']}</td>
<td>{convertPrice price=($data_v['amount'] + $data_v['demand_price'])}</td>
<td><a class="remove_rooms_from_cart_link" href="#" rm_price="{$data_v['amount']}" id_product="{$product.id_product|intval}" date_from="{$data_v['data_form']}" date_to="{$data_v['data_to']}" num_rooms="{$data_v['num_rm']}" title="{l s='remove this room from my cart' mod='blockcart'}"></a></td>
</tr>
{/foreach}
@@ -222,10 +222,10 @@
<span>{l s='Tax' mod='blockcart'}</span>
</div>
{/if}
{if isset($total_extra_services)}
{if isset($total_convenience_fee)}
<div class="cart-prices-line">
<span class="price cart_block_additional_facilities_cost ajax_cart_extra_demands_cost">{convertPrice price=$total_extra_services}</span>
<span class="price">{l s='Extra Services Cost' mod='blockcart'}</strong>
<span class="price cart_block_convenience_fee ajax_cart_convenience_fee">{convertPrice price=$total_convenience_fee}</span>
<span class="price">{l s='Convenience Fees' mod='blockcart'}</strong>
</div>
{/if}
<div class="cart-prices-line last-line">
@@ -314,7 +314,7 @@
{/if}
{/if}
</strong>
<span class="ajax_block_products_total">
<span class="ajax_block_room_total pull-right">
{if $cart_qties > 0}
{convertPrice price=$cart->getOrderTotal(false, Cart::ONLY_PRODUCTS)}
{/if}
@@ -354,16 +354,16 @@
{/if}
</span>
</div> -->
{if isset($total_extra_services)}
{if isset($total_convenience_fee)}
<div class="layer_cart_row">
<strong class="dark">{l s='Total Extra Services Cost' mod='blockcart'}</strong>
<span class="price ajax_cart_extra_demands_cost">{convertPrice price=$total_extra_services}</span>
<strong class="dark">{l s='Convenience Fees' mod='blockcart'}</strong>
<span class="price ajax_cart_convenience_fee pull-right">{convertPrice price=$total_convenience_fee}</span>
</div>
{/if}
{if $show_tax && $use_tax}
<div class="layer_cart_row">
<strong class="dark">{l s='Tax' mod='blockcart'}</strong>
<span class="price cart_block_tax_cost ajax_cart_tax_cost">{$tax_cost}</span>
<span class="price cart_block_tax_cost ajax_cart_tax_cost pull-right">{$tax_cost}</span>
</div>
{/if}
<div class="layer_cart_row">
@@ -377,7 +377,7 @@
{/if}
{/if}
</strong>
<span class="ajax_block_cart_total">
<span class="ajax_block_cart_total pull-right">
{if $cart_qties > 0}
{if $priceDisplay == 1}
{convertPrice price=$cart->getOrderTotal(false)}

View File

@@ -414,7 +414,7 @@
<td>
{if (isset($rm_v['extra_demands']) && $rm_v['extra_demands']) || isset($rm_v['additional_services']) && $rm_v['additional_services']}
<a data-date_from="{$rm_v['data_form']}" data-date_to="{$rm_v['data_to']}" data-id_product="{$data_v['id_product']}" data-id_order="{$order->id}" data-action="{$link->getPageLink('order-detail')}" class="open_rooms_extra_services_panel" href="#rooms_type_extra_services_form">
<a data-date_from="{$rm_v['data_form']}" data-date_to="{$rm_v['data_to']}" data-id_product="{$data_v['id_product']}" data-id_order="{$order->id}" data-action="{$link->getPageLink({$page_name})}" class="open_rooms_extra_services_panel" href="#rooms_type_extra_services_form">
{/if}
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v['extra_demands_price_ti'] + $rm_v['additional_services_price_ti']) currency=$currency}