Merge branch 'webkul:develop' into gli-779

This commit is contained in:
Sumit Panwar
2023-03-28 20:42:55 +05:30
committed by GitHub
14 changed files with 359 additions and 166 deletions

View File

@@ -27,70 +27,112 @@
{l s='To create new Additional facilities'} <a target="_blank" href="{$link->getAdminLink('AdminRoomTypeGlobalDemand')}">{l s='click here.'}</a>
</div>
{if isset($allDemands) && $allDemands}
<div class="panel-group">
{foreach $allDemands as $key => $demand}
<div class="panel panel-sm">
<input class="selected_demand" type="checkbox" name="selected_demand[]" value="{$demand['id_global_demand']|escape:'html':'UTF-8'}" {if isset($roomDemandPrices[$demand['id_global_demand']])}checked{/if} />
<a href="#" onclick="$('#panel-demands-{$key|escape:'html':'UTF-8'}').slideToggle(250); return false;">
{$demand['name']|escape:'html':'UTF-8'}
</a>
<div class="panel-body collapse" id="panel-demands-{$key|escape:'html':'UTF-8'}">
{if isset($demand['adv_option']) && count($demand['adv_option'])}
<input type="hidden" name="demand_price_{$demand['id_global_demand']|escape:'html':'UTF-8'}"
value="{if isset($roomDemandPrices[$demand['id_global_demand']]['price'])}{$roomDemandPrices[$demand['id_global_demand']]['price']|escape:'html':'UTF-8'}{elseif isset($demand['price'])}{$demand['price']|escape:'html':'UTF-8'}{/if}"/>
{else}
<div class="form-group">
<label class="col-sm-3 control-label required" >
{l s='Price'}({l s='tax excl.'})
</label>
<div class="col-sm-3">
<div class="input-group">
<span class="input-group-addon">{$defaultcurrencySign|escape:'html':'UTF-8'}</span>
<input type="text" name="demand_price_{$demand['id_global_demand']|escape:'html':'UTF-8'}"
value="{if isset($roomDemandPrices[$demand['id_global_demand']]['price'])}{$roomDemandPrices[$demand['id_global_demand']]['price']|escape:'html':'UTF-8'}{elseif isset($demand['price'])}{$demand['price']|escape:'html':'UTF-8'}{/if}"/>
</div>
</div>
</div>
{/if}
<div class="from-group table-responsive-row clearfix">
<table class="table" id="demands_table">
<thead>
<tr>
<th></th>
<th>
{l s='Name'}
</th>
<th>
{l s='Option'}
</th>
<th class="fixed-width-xl">
{l s='Price'}
</th>
<th>
{l s='Tax rate'}
</th>
<th class="fixed-width-lg text-center">
{l s='Per day price calculation'}
</th>
</tr>
</thead>
<tbody>
{foreach $allDemands as $key => $demand}
{assign var="rowcount" value=0}
{if isset($demand['adv_option']) && $demand['adv_option']}
<div class="adv_options_dtl form-group">
<label class="col-sm-3 control-label">
{l s='Advance options'}
</label>
<div class="col-sm-9">
<div class="table-responsive-row clearfix">
<table class="table table-bordered adv_option_table">
<thead>
<tr>
<th>
<span>{l s='Option Name'}</span>
</th>
<th>
<span>{l s='Price'}</span>
</th>
</tr>
</thead>
{foreach from=$demand['adv_option'] key=key item=info}
<tr>
<td>
{$info['name']|escape:'html':'UTF-8'}
</td>
<td>
<div class="input-group">
<span class="input-group-addon">{$defaultcurrencySign|escape:'html':'UTF-8'}</span>
<input type="text" name="option_price_{$info['id']|escape:'html':'UTF-8'}" value="{if isset($roomDemandPrices[$demand['id_global_demand']]['adv_option'][$info['id']]['price'])}{$roomDemandPrices[$demand['id_global_demand']]['adv_option'][$info['id']]['price']|escape:'html':'UTF-8'}{else}{$info['price']|escape:'html':'UTF-8'}{/if}"/>
</div>
</td>
</tr>
{/foreach}
</table>
</div>
</div>
</div>
{assign var="rowspan" value=$demand['adv_option']|count}
{assign var="adv_option" value=$demand['adv_option']}
{else}
{assign var="rowspan" value=1}
{assign var="adv_option" value=[]}
{/if}
</div>
</div>
{/foreach}
{foreach $adv_option as $option}
{assign var="rowcount" value=$rowcount + 1}
<tr>
{if $rowcount <= 1}
<td rowspan="{$rowspan}">
<input class="selected_demand" type="checkbox" name="selected_demand[]" value="{$demand['id_global_demand']|escape:'html':'UTF-8'}" {if isset($selectedDemands[$demand['id_global_demand']])}checked{/if} />
<input type="hidden" name="demand_price_{$demand['id_global_demand']|escape:'html':'UTF-8'}" value="{if isset($selectedDemands[$demand['id_global_demand']]['price'])}{$selectedDemands[$demand['id_global_demand']]['price']|escape:'html':'UTF-8'}{elseif isset($demand['price'])}{$demand['price']|escape:'html':'UTF-8'}{/if}"/>
</td>
<td rowspan="{$rowspan}">
<a target="blank" href="{$link->getAdminLink('AdminRoomTypeGlobalDemand')|escape:'html':'UTF-8'}&amp;id_global_demand={$demand['id_global_demand']|escape:'html':'UTF-8'}&amp;updatehtl_room_type_global_demand"><i class="icon-external-link-sign"></i></a> {$demand['name']|escape:'html':'UTF-8'}
</td>
{/if}
<td>
{$option['name']|escape:'html':'UTF-8'}
</td>
<td class="demand_price_{$demand['id_global_demand']}">
<div class="input-group price_input" {if !isset($selectedDemands[$demand['id_global_demand']])}style="display:none"{/if}>
<span class="input-group-addon">{$defaultcurrencySign|escape:'html':'UTF-8'}</span>
<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}
</div>
</td>
{if $rowcount == 1}
<td rowspan="{$rowspan}">
{$demand['default_tax_rules_group_name']}
</td>
<td class="text-center" rowspan="{$rowspan}">
{if $demand['price_calc_method'] == 1}
<span class="badge badge-success">{l s='Yes'}</span>
{else}
<span>{l s='No'}</span>
{/if}
</td>
{/if}
</tr>
{foreachelse}
<tr>
<td>
<input class="selected_demand" type="checkbox" name="selected_demand[]" value="{$demand['id_global_demand']|escape:'html':'UTF-8'}" {if isset($selectedDemands[$demand['id_global_demand']])}checked{/if} />
</td>
<td>
<a target="blank" href="{$link->getAdminLink('AdminRoomTypeGlobalDemand')|escape:'html':'UTF-8'}&amp;id_global_demand={$demand['id_global_demand']|escape:'html':'UTF-8'}&amp;updatehtl_room_type_global_demand"><i class="icon-external-link-sign"></i></a> {$demand['name']|escape:'html':'UTF-8'}
</td>
<td></td>
<td class="demand_price_{$demand['id_global_demand']}">
<div class="input-group price_input" {if !isset($selectedDemands[$demand['id_global_demand']])}style="display:none"{/if}>
<span class="input-group-addon">{$defaultcurrencySign|escape:'html':'UTF-8'}</span>
<input type="text" name="demand_price_{$demand['id_global_demand']|escape:'html':'UTF-8'}"
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}
</div>
</td>
<td>
{$demand['default_tax_rules_group_name']}
</td>
<td class="text-center">
{if $demand['price_calc_method'] == 1}
<span class="badge badge-success">{l s='Yes'}</span>
{else}
<span>{l s='No'}</span>
{/if}
</td>
</tr>
{/foreach}
{/foreach}
</tbody>
</table>
</div>
<div class="panel-footer">
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}{if isset($smarty.request.page) && $smarty.request.page > 1}&amp;submitFilterproduct={$smarty.request.page|intval}{/if}" class="btn btn-default">

View File

@@ -3,35 +3,35 @@
<input type="hidden" name="submitted_tabs[]" value="ServiceProduct" />
<h3 class="tab"> <i class="icon-AdminAdmin"></i> {l s='Service Products'}</h3>
<div class="from-group table-responsive-row clearfix">
<table class="table tableDnD hotel-roomtype-link-table">
<thead>
<tr class="nodrag nodrop">
<th class="col-sm-1">
<span>{l s='Id Service'}</span>
</th>
<th class="col-sm-3">
<span>{l s='Name'}</span>
</th>
<th>
<span>{l s='Auto add to cart'}</span>
</th>
<th>
<span>{l s='Position'}</span>
</th>
<th>
<span>{l s='Price'}</span>
</th>
<th>
<span>{l s='Tax'}</span>
</th>
<th class="text-right">
<span>{l s='Action'}</span>
</th>
</tr>
</thead>
<tbody>
{if isset($service_products) && $service_products}
{if isset($service_products) && $service_products}
<div class="from-group table-responsive-row clearfix">
<table class="table tableDnD hotel-roomtype-link-table">
<thead>
<tr class="nodrag nodrop">
<th class="col-sm-1">
<span>{l s='Id Product'}</span>
</th>
<th class="col-sm-3">
<span>{l s='name'}</span>
</th>
<th class="">
<span>{l s='Category'}</span>
</th>
<th>
<span>{l s='Position'}</span>
</th>
<th class="">
<span>{l s='Price'}</span>
</th>
<th class="">
<span>{l s='Tax'}</span>
</th>
<th class="text-right">
<span>{l s='Action'}</span>
</th>
</tr>
</thead>
<tbody>
{foreach from=$service_products key=key item=service_product}
<tr id='room_type_service_product_{$service_product.id_room_type_service_product|escape:'html':'UTF-8'}' position='{$service_product.position|escape:'html':'UTF-8'}' id_product='{$service_product.id_product|escape:'html':'UTF-8'}' id_element="{$product->id}" data-roomtype_url="{$link->getAdminLink('AdminProducts', true)|addslashes}">
<td class="col-sm-1">{$service_product.id_product|escape:'html':'UTF-8'} <a target="blank" href="{$link->getAdminLink('AdminNormalProducts')|escape:'html':'UTF-8'}&amp;id_product={$service_product.id_product|escape:'html':'UTF-8'}&amp;updateproduct"><i class="icon-external-link-sign"></i></a></td>
@@ -77,9 +77,27 @@
</td>
</tr>
{/foreach}
{/if}
</tbody>
</table>
</div>
</tbody>
</table>
</div>
<div class="panel-footer">
<a href="{$link->getAdminLink('AdminProducts')|escape:'html':'UTF-8'}{if isset($smarty.request.page) && $smarty.request.page > 1}&amp;submitFilterproduct={$smarty.request.page|intval}{/if}" class="btn btn-default">
<i class="process-icon-cancel"></i>
{l s='Cancel'}
</a>
<button type="submit" name="submitAddproduct" class="btn btn-default pull-right" disabled="disabled">
<i class="process-icon-loading"></i>
{l s='Save'}
</button>
<button type="submit" name="submitAddproductAndStay" class="btn btn-default pull-right" disabled="disabled">
<i class="process-icon-loading"></i>
{l s='Save and stay'}
</button>
</div>
{else}
<div class="alert alert-info">
{l s='No services are attached with this room type'}
</div>
{/if}
</div>
{/if}

View File

@@ -3783,7 +3783,20 @@ class CartCore extends ObjectModel
}
}
$discountedProducts = array();
foreach ($cart_rules as $key => &$cart_rule) {
$product_rule_groups = $cart_rule['obj']->getProductRuleGroups();
foreach ($product_rule_groups as $id_product_rule_group => $product_rule_group) {
if (isset($product_rule_group['product_rules']) && $product_rule_group['product_rules']) {
foreach($product_rule_group['product_rules'] as $rule_products) {
if ($rule_products['type'] == 'products') {
$discountedProducts = array_merge($discountedProducts, $rule_products['values']);
}
}
}
}
if (((float)$cart_rule['value_real'] == 0 && (int)$cart_rule['free_shipping'] == 0)) {
unset($cart_rules[$key]);
}
@@ -3823,6 +3836,7 @@ class CartCore extends ObjectModel
'total_price' => $base_total_tax_inc,
'total_tax' => $total_tax,
'total_price_without_tax' => $base_total_tax_exc,
'discounted_products' => $discountedProducts,
'is_multi_address_delivery' => $this->isMultiAddressDelivery() || ((int)Tools::getValue('multi-shipping') == 1),
'free_ship' =>!$total_shipping && !count($this->getDeliveryAddressesWithoutCarriers(true, $errors)),
'carrier' => new Carrier($this->id_carrier, $id_lang),

View File

@@ -1083,6 +1083,7 @@ class FrontControllerCore extends Controller
$this->addjqueryPlugin('fancybox');
$this->addJS(_PS_JS_DIR_.'hookLiveEdit.js');
}
$this->addJqueryUI('ui.tooltip', 'base', true);
if (Configuration::get('PS_QUICK_VIEW')) {
$this->addjqueryPlugin('fancybox');

View File

@@ -151,7 +151,14 @@ class AdminOrderPreferencesControllerCore extends AdminController
'list' => $cms_tab,
'identifier' => 'id',
'cast' => 'intval'
)
),
'PS_ROOM_PRICE_AUTO_ADD_BREAKDOWN' => array(
'title' => $this->l('Show room price breakdown'),
'hint' => $this->l('Show a summary for prices of the auto added service add with room on shopping cart list.'),
'desc' => $this->l('This breakdown is always visible on room that have cart rule applied for that specific room.'),
'cast' => 'intval',
'type' => 'bool'
),
),
'submit' => array('title' => $this->l('Save'))
),

View File

@@ -3276,15 +3276,26 @@ class AdminProductsControllerCore extends AdminController
if ($obj->id) {
$objGlobalDemand = new HotelRoomTypeGlobalDemand();
$allDemands = $objGlobalDemand->getAllDemands();
foreach($allDemands as &$demand) {
if ($demand['id_tax_rules_group'] == 0) {
$demand['default_tax_rules_group_name'] = 'No tax';
} else {
$objTaxRuleGroup = new TaxRulesGroup(
$demand['id_tax_rules_group'],
$this->context->language->id
);
$demand['default_tax_rules_group_name'] = $objTaxRuleGroup->name;
}
}
$objCurrency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
// get room type additional facilities
$objRoomDemand = new HotelRoomTypeDemand();
$roomDemandPrices = $objRoomDemand->getRoomTypeDemands($obj->id, 0, 0);
$selectedDemands = $objRoomDemand->getRoomTypeDemands($obj->id, 0, 0);
$data->assign(array(
'product' => $obj,
'roomDemandPrices' => $roomDemandPrices,
'selectedDemands' => $selectedDemands,
'allDemands' => $allDemands,
'defaultcurrencySign' => $objCurrency->sign,
));

View File

@@ -466,6 +466,7 @@ class OrderOpcControllerCore extends ParentOrderController
// 'defaultcurrencySign' => $objCurrency->sign,
'THEME_DIR' => _THEME_DIR_,
'PS_CUSTOMER_ADDRESS_CREATION' => Configuration::get('PS_CUSTOMER_ADDRESS_CREATION'),
'PS_ROOM_PRICE_AUTO_ADD_BREAKDOWN' => Configuration::get('PS_ROOM_PRICE_AUTO_ADD_BREAKDOWN'),
'free_shipping' => $free_shipping,
'isGuest' => isset($this->context->cookie->is_guest) ? $this->context->cookie->is_guest : 0,
'countries' => $countries,
@@ -556,6 +557,7 @@ class OrderOpcControllerCore extends ParentOrderController
if (!empty($cartProducts)) {
if ($cartBookingInfo = HotelCartBookingData::getHotelCartBookingData()) {
// ddd($cartBookingInfo);
$this->context->smarty->assign('cart_htl_data', $cartBookingInfo);
}
$objHotelServiceProductCartDetail = new HotelServiceProductCartDetail();

View File

@@ -62,8 +62,6 @@ class ProductControllerCore extends FrontController
$this->addCSS(_THEME_CSS_DIR_.'occupancy.css');
$this->addJS(_THEME_JS_DIR_.'occupancy.js');
$this->addJqueryUI('ui.tooltip', 'base', true);
if (Configuration::get('PS_DISPLAY_JQZOOM') == 1) {
$this->addJqueryPlugin('jqzoom');
}

View File

@@ -654,6 +654,21 @@ product_tabs['Features'] = new function(){
displayFlags(languages, id_language, allowEmployeeFormLang);
}
}
product_tabs['AdditionalFacilities'] = new function(){
this.onReady = function(){
$('#demands_table .selected_demand').on('click', function() {
let input_block = $('#demands_table').find('.demand_price_'+$(this).val());
if ($(this).is(':checked')) {
$(input_block).find('.price_input').show();
$(input_block).find('.price_display').hide();
} else {
$(input_block).find('.price_input');
$(input_block).find('.price_input').hide();
$(input_block).find('.price_display').show();
}
});
}
}
/**
* Update the product image list position buttons

View File

@@ -1335,12 +1335,26 @@ class HotelCartBookingData extends ObjectModel
$data_v['date_from'],
$data_v['date_to']
);
$roomTypeDateRangePriceWithoutAutoAdd = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
$product['id_product'],
$data_v['date_from'],
$data_v['date_to'],
0,
0,
0,
0,
0,
0
);
if (!$price_tax) {
$amount = $roomTypeDateRangePrice['total_price_tax_excl'];
$amountWithoutAutoAdd = $roomTypeDateRangePriceWithoutAutoAdd['total_price_tax_excl'];
} else {
$amount = $roomTypeDateRangePrice['total_price_tax_incl'];
$amountWithoutAutoAdd = $roomTypeDateRangePriceWithoutAutoAdd['total_price_tax_incl'];
}
$cartHotelData[$prodKey]['date_diff'][$dateJoin]['amount'] = $amount * $varQty;
$cartHotelData[$prodKey]['date_diff'][$dateJoin]['amount_without_auto_add'] = $amountWithoutAutoAdd * $varQty;
} else {
$cartHotelData[$prodKey]['date_diff'][$dateJoin]['demand_price'] = $totalAdditionalServicePrice;
$numDays = $objBookingDetail->getNumberOfDays($data_v['date_from'], $data_v['date_to']);
@@ -1363,12 +1377,26 @@ class HotelCartBookingData extends ObjectModel
$data_v['date_from'],
$data_v['date_to']
);
$roomTypeDateRangePriceWithoutAutoAdd = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice(
$product['id_product'],
$data_v['date_from'],
$data_v['date_to'],
0,
0,
0,
0,
0,
0
);
if (!$price_tax) {
$amount = $roomTypeDateRangePrice['total_price_tax_excl'];
$amountWithoutAutoAdd = $roomTypeDateRangePriceWithoutAutoAdd['total_price_tax_excl'];
} else {
$amount = $roomTypeDateRangePrice['total_price_tax_incl'];
$amountWithoutAutoAdd = $roomTypeDateRangePriceWithoutAutoAdd['total_price_tax_incl'];
}
$cartHotelData[$prodKey]['date_diff'][$dateJoin]['amount'] = $amount;
$cartHotelData[$prodKey]['date_diff'][$dateJoin]['amount_without_auto_add'] = $amountWithoutAutoAdd;
$cartHotelData[$prodKey]['date_diff'][$dateJoin]['link'] = $context->link->getPageLink(
'order-opc',
null,

View File

@@ -68,72 +68,6 @@
{/foreach}
</div>
</div>
<div class="form-group" {if isset($smarty.post.active_adv_option)}{if $smarty.post.active_adv_option}style="display:none;"{/if}{elseif isset($globalDemands['adv_option']) && $globalDemands['adv_option']|@count}style="display:none;"{/if}>
<label class="col-sm-3 control-label required" >
{l s='Price' mod='hotelreservationsystem'}({l s='tax excl.' mod='hotelreservationsystem'})
</label>
<div class="col-sm-3">
<div class="input-group">
<span class="input-group-addon">{$defaultcurrencySign}</span>
<input type="text" id="price" name="price"
value="{if isset($smarty.post.price)}{$smarty.post.price}{elseif isset($globalDemands['price'])}{$globalDemands['price']}{/if}"/>
</div>
</div>
</div>
{if isset($taxRuleGroups)}
<div class="form-group">
<label class="col-sm-3 control-label required" >
{l s='Tax Rule' mod='hotelreservationsystem'}
</label>
<div class="col-sm-3">
<select name="id_tax_rules_group" id="id_tax_rules_group" class="form-control form-control-select" data-action="input_excl">
<option value="0">{l s='No tax' mod='hotelreservationsystem'}</option>
{foreach $taxRuleGroups as $tax_rule}
<option value="{$tax_rule.id_tax_rules_group|escape:'html':'UTF-8'}" {if isset($smarty.post.id_tax_rules_group) && ($smarty.post.id_tax_rules_group == $tax_rule.id_tax_rules_group)}selected{elseif isset($globalDemands['id_tax_rules_group']) && ($globalDemands['id_tax_rules_group'] == $tax_rule.id_tax_rules_group)}selected{/if}>
{$tax_rule.name|escape:'html':'UTF-8'}
</option>
{/foreach}
</select>
</div>
</div>
{/if}
<div class="form-group">
<label class="col-sm-3 control-label">
<span class="label-tooltip" data-toggle="tooltip" data-html="true" data-original-title="{l s='Enable, if you want to add the price of this facility for each day in the booking. Disable, If you want to add price of the facility for entire date range of the booking.' mod='hotelreservationsystem'}">{l s='Per day price calculation' mod='hotelreservationsystem'}</span>
</label>
<div class="col-sm-6">
<span class="switch prestashop-switch fixed-width-lg">
<input type="radio" value="1" id="price_calc_method_on" name="price_calc_method"
{if isset($smarty.post.price_calc_method)}
{if $smarty.post.price_calc_method}
checked="checked"
{/if}
{elseif isset($globalDemands['price_calc_method']) && $globalDemands['price_calc_method']}
checked="checked"
{/if}>
<label for="price_calc_method_on">{l s='Yes' mod='hotelreservationsystem'}</label>
<input type="radio" value="0" id="price_calc_method_off" name="price_calc_method"
{if isset($smarty.post.price_calc_method)}
{if !$smarty.post.price_calc_method}
checked="checked"
{/if}
{elseif !isset($globalDemands['price_calc_method'])}
checked="checked"
{elseif isset($globalDemands['price_calc_method']) && !$globalDemands['price_calc_method']}
checked="checked"
{/if}>
<label for="price_calc_method_off">{l s='No' mod='hotelreservationsystem'}</label>
<a class="slide-button btn"></a>
</span>
</div>
</div>
<div class="form-group">
<div class="col-lg-9 col-lg-offset-3">
<div class="alert alert-info">
{l s='Enable ("Per day price calculation"), if you want to add the price of this facility for each day in the booking. Disable, If you want to add price of the facility for entire date range of the booking.' mod='hotelreservationsystem'}
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">
<span class="label-tooltip" data-toggle="tooltip" data-html="true" title="" data-original-title="{l s='Price of the facility will be calculated according to the price of the advance options.' mod='hotelreservationsystem'}">{l s='Create advance options' mod='hotelreservationsystem'}</span>
@@ -261,6 +195,73 @@
</div>
</div>
</div>
<div class="form-group" {if isset($smarty.post.active_adv_option)}{if $smarty.post.active_adv_option}style="display:none;"{/if}{elseif isset($globalDemands['adv_option']) && $globalDemands['adv_option']|@count}style="display:none;"{/if}>
<label class="col-sm-3 control-label required" >
{l s='Price' mod='hotelreservationsystem'}({l s='tax excl.' mod='hotelreservationsystem'})
</label>
<div class="col-sm-3">
<div class="input-group">
<span class="input-group-addon">{$defaultcurrencySign}</span>
<input type="text" id="price" name="price"
value="{if isset($smarty.post.price)}{$smarty.post.price}{elseif isset($globalDemands['price'])}{$globalDemands['price']}{/if}"/>
</div>
</div>
</div>
{if isset($taxRuleGroups)}
<div class="form-group">
<label class="col-sm-3 control-label required" >
{l s='Tax Rule' mod='hotelreservationsystem'}
</label>
<div class="col-sm-3">
<select name="id_tax_rules_group" id="id_tax_rules_group" class="form-control form-control-select" data-action="input_excl">
<option value="0">{l s='No tax' mod='hotelreservationsystem'}</option>
{foreach $taxRuleGroups as $tax_rule}
<option value="{$tax_rule.id_tax_rules_group|escape:'html':'UTF-8'}" {if isset($smarty.post.id_tax_rules_group) && ($smarty.post.id_tax_rules_group == $tax_rule.id_tax_rules_group)}selected{elseif isset($globalDemands['id_tax_rules_group']) && ($globalDemands['id_tax_rules_group'] == $tax_rule.id_tax_rules_group)}selected{/if}>
{$tax_rule.name|escape:'html':'UTF-8'}
</option>
{/foreach}
</select>
</div>
</div>
{/if}
<div class="form-group">
<label class="col-sm-3 control-label">
<span class="label-tooltip" data-toggle="tooltip" data-html="true" data-original-title="{l s='Enable, if you want to add the price of this facility for each day in the booking. Disable, If you want to add price of the facility for entire date range of the booking.' mod='hotelreservationsystem'}">{l s='Per day price calculation' mod='hotelreservationsystem'}</span>
</label>
<div class="col-sm-6">
<span class="switch prestashop-switch fixed-width-lg">
<input type="radio" value="1" id="price_calc_method_on" name="price_calc_method"
{if isset($smarty.post.price_calc_method)}
{if $smarty.post.price_calc_method}
checked="checked"
{/if}
{elseif isset($globalDemands['price_calc_method']) && $globalDemands['price_calc_method']}
checked="checked"
{/if}>
<label for="price_calc_method_on">{l s='Yes' mod='hotelreservationsystem'}</label>
<input type="radio" value="0" id="price_calc_method_off" name="price_calc_method"
{if isset($smarty.post.price_calc_method)}
{if !$smarty.post.price_calc_method}
checked="checked"
{/if}
{elseif !isset($globalDemands['price_calc_method'])}
checked="checked"
{elseif isset($globalDemands['price_calc_method']) && !$globalDemands['price_calc_method']}
checked="checked"
{/if}>
<label for="price_calc_method_off">{l s='No' mod='hotelreservationsystem'}</label>
<a class="slide-button btn"></a>
</span>
</div>
</div>
<div class="form-group">
<div class="col-lg-9 col-lg-offset-3">
<div class="alert alert-info">
{l s='Enable ("Per day price calculation"), if you want to add the price of this facility for each day in the booking. Disable, If you want to add price of the facility for entire date range of the booking.' mod='hotelreservationsystem'}
</div>
</div>
</div>
<div class="panel-footer">
<a href="{$link->getAdminLink('AdminRoomTypeGlobalDemand')|escape:'html':'UTF-8'}" class="btn btn-default">
<i class="process-icon-cancel"></i>{l s='Cancel' mod='hotelreservationsystem'}

View File

@@ -8505,6 +8505,14 @@ div.star.star_hover:after {
content: "\f057";
font-family: "FontAwesome"; }
body .ui-tooltip {
box-shadow: 0 2px 6px 0 rgb(0 0 0 / 20%);
background: #FFFFFF;
border: unset;
color: #333;
padding: 10px 15px;
}
#facebook_block,
#cmsinfo_block {
overflow: hidden;

View File

@@ -33,6 +33,43 @@ $(document).ready(function()
$(this).closest('.card').find('.step-edit').addClass('hidden');
});
// 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')
{
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();
});
});
}
});
}
// BY WEBKUL
// FOR ADVANCED PAYMENT
var payment_type = $(".payment_type:checked").val();

View File

@@ -150,6 +150,17 @@
<span>
{displayPrice price=($rm_v['amount'])}
</span>
{if (($rm_v['amount'] - $rm_v['amount_without_auto_add']) > 0) && (in_array($data_v['id_product'], $discounted_products) || $PS_ROOM_PRICE_AUTO_ADD_BREAKDOWN)}
<span class="room-price-detail">
<img src="{$img_dir}icon/icon-info.svg" />
</span>
<div class="room-price-detail-container" style="display: none;">
<div class="room-price-detail-tooltip-cont">
<div><label>{l s='Room price'}</label> : {displayPrice price=($rm_v['amount_without_auto_add'])}</div>
<div><label>{l s='Additional charges'}</label> : {displayPrice price=($rm_v['amount'] - $rm_v['amount_without_auto_add'])}</div>
</div>
</div>
{/if}
{if (isset($data_v['extra_demands']) && $data_v['extra_demands']) || (isset($data_v['service_products']) && $data_v['service_products'])}
<span class="plus-sign pull-right">
+