Add a centralized, reusable back Office tooltip system

This commit is contained in:
Amit sharma
2026-06-02 18:57:56 +05:30
parent 90dcc1faff
commit 76c2f688e8
18 changed files with 237 additions and 295 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,79 +0,0 @@
/*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License version 3.0
* that is bundled with this package in the file LICENSE.md
* It is also available through the world-wide-web at this URL:
* https://opensource.org/license/osl-3-0-php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to support@qloapps.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to a newer
* versions in the future. If you wish to customize this module for your needs
* please refer to https://store.webkul.com/customisation-guidelines for more information.
*
* @author Webkul IN
* @copyright Since 2010 Webkul
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
*/
/* Trigger element styles */
.selected-option-info,
.price-calculation-info {
cursor: pointer;
}
.price-calculation-info {
display: inline-block;
vertical-align: middle;
margin-left: 4px;
}
.selected-option-info .icon-info-sign,
.price-calculation-info .icon-info-sign {
color: #00aff0;
font-size: 16px;
}
/* Unified tooltip bubble */
.ui-tooltip.admin-info-tooltip {
background: #ffffff;
border: 1px solid #ddd;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
color: #333;
padding: 8px 12px;
font-size: 13px;
}
.ui-tooltip.admin-info-tooltip ul {
margin: 0;
padding: 0 0 0 16px;
list-style: disc;
}
.ui-tooltip.admin-info-tooltip ul li {
padding: 2px 0;
}
.ui-tooltip.admin-info-tooltip .price-info-tooltip-cont {
min-width: 160px;
}
.ui-tooltip.admin-info-tooltip .applied-on-label {
margin: 0 0 6px;
font-weight: 600;
font-size: 13px;
}
.ui-tooltip.admin-info-tooltip .applied-on-days {
margin: 0;
padding-left: 16px;
font-size: 13px;
}
.ui-tooltip.admin-info-tooltip .applied-on-days li {
padding: 2px 0;
}

View File

@@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="8" cy="8" r="8" fill="#7EC77B"/>
<path d="M8.06536 3C8.30937 3 8.51561 3.07032 8.6841 3.21097C8.85839 3.34693 8.94553 3.51336 8.94553 3.71027C8.94553 3.90717 8.85839 4.07595 8.6841 4.2166C8.51561 4.35724 8.30937 4.42757 8.06536 4.42757C7.82135 4.42757 7.6122 4.35724 7.43791 4.2166C7.26362 4.07595 7.17647 3.90717 7.17647 3.71027C7.17647 3.51336 7.26071 3.34693 7.42919 3.21097C7.60349 3.07032 7.81554 3 8.06536 3ZM8.78867 6.3685V11.5443C8.78867 11.9475 8.82353 12.2171 8.89325 12.353C8.96877 12.4843 9.07625 12.5827 9.21569 12.6484C9.36093 12.714 9.62237 12.7468 10 12.7468V13H6.122V12.7468C6.51126 12.7468 6.77269 12.7164 6.90632 12.6554C7.03994 12.5945 7.14452 12.4937 7.22004 12.353C7.30138 12.2124 7.34205 11.9428 7.34205 11.5443V9.06188C7.34205 8.36334 7.3159 7.91092 7.26362 7.70464C7.22295 7.55462 7.15904 7.45148 7.0719 7.39522C6.98475 7.33427 6.86565 7.3038 6.7146 7.3038C6.55192 7.3038 6.35439 7.33896 6.122 7.40928L6 7.15612L8.40523 6.3685H8.78867Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -481,20 +481,19 @@ $(document).ready(function() {
}); //end dom ready
function initAdminTooltip(config) {
var $elements = $(config.selector);
if (!$elements.length) {
function initTooltip() {
if (!$('.tooltip-trigger').length) {
return;
}
$elements.each(function () {
if (config.skipIfInitialized && $(this).data('ui-tooltip')) {
$('.tooltip-trigger').each(function () {
if ($(this).data('ui-tooltip')) {
return;
}
$(this).tooltip({
content: config.getContent,
items: config.items,
content: $(this).siblings('.tooltip-content').html(),
items: 'span',
trigger: 'hover',
tooltipClass: config.tooltipClass,
tooltipClass: 'tooltip-popup',
open: function (event, ui) {
if (typeof event.originalEvent === 'undefined') {
return false;
@@ -515,12 +514,5 @@ function initAdminTooltip(config) {
}
$(document).ready(function () {
initAdminTooltip({
selector: '.selected-option-info',
items: '.selected-option-info',
tooltipClass: 'admin-info-tooltip',
getContent: function () {
return $(this).data('options');
}
});
initTooltip();
});

View File

@@ -309,3 +309,36 @@ body.display-modal
.page-topbar
#help-container
margin-top: 140px
.tooltip-trigger
cursor: pointer
display: inline-block
vertical-align: middle
margin-left: 4px
.ui-tooltip.tooltip-popup
background: #ffffff
border: 1px solid #ddd
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2)
color: #333333
padding: 8px 12px
font-size: 13px
ul
margin: 0
padding: 0 0 0 16px
list-style: disc
li
padding: 2px 0
.tooltip-row
display: flex
justify-content: space-between
align-items: center
gap: 12px
margin: 3px 0
white-space: nowrap
label
font-weight: 600
margin: 0
.tooltip-cont
max-width: 200px

View File

@@ -230,8 +230,8 @@
</script>
</div>
{* Code For Standard product working *}
<div class="form-group" id="global_product_type_container">
<label class="control-label col-lg-3">
<div class="form-group " id="global_product_type_container">
<label class="control-label required col-lg-3">
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select how this product will be sold: with room types, with hotels, as a standalone product, or in a combination of these options.'}">
{l s='Buying Option'}
</span>

View File

@@ -207,7 +207,7 @@ $(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">
<label class="control-label required col-lg-3">
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select which booking days should be counted when calculating the service price.'}">
{l s='Price calculation method'}
</span>

View File

@@ -1595,15 +1595,7 @@
},
complete: function() {
$(".loading_overlay").hide();
initAdminTooltip({
selector: '.price-calculation-info',
items: 'span',
tooltipClass: 'admin-info-tooltip',
skipIfInitialized: true,
getContent: function () {
return $(this).siblings('.price-calculation-info-container').html();
}
});
initTooltip();
}
});
});
@@ -1824,15 +1816,7 @@
},
complete: function() {
$(".loading_overlay").hide();
initAdminTooltip({
selector: '.price-calculation-info',
items: 'span',
tooltipClass: 'admin-info-tooltip',
skipIfInitialized: true,
getContent: function () {
return $(this).siblings('.price-calculation-info-container').html();
}
});
initTooltip();
}
});
});
@@ -1883,15 +1867,7 @@
},
complete: function() {
$(".loading_overlay").hide();
initAdminTooltip({
selector: '.price-calculation-info',
items: 'span',
tooltipClass: 'admin-info-tooltip',
skipIfInitialized: true,
getContent: function () {
return $(this).siblings('.price-calculation-info-container').html();
}
});
initTooltip();
}
});
});

View File

@@ -63,7 +63,34 @@
<td>
<div>
{$product['name']|escape:'html':'UTF-8'}
{include file='controllers/orders/modals/_partials/_price-calculation-info.tpl' pcm=$product['price_calculation_method']|default:0}
{capture name='room_type_service_tooltip_content'}
{assign var="priceCalcMethod" value=$product['price_calculation_method']|default:0}
<div class="tooltip-cont">
<div class="tooltip-row"><label>{l s='Applied on:'}</label></div>
<ul class="tooltip-days">
{if $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_ON_CHECKIN_DAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_DAY_AND_CHECKOUT_DAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY}
<li>{l s='Check-in day'}</li>
{/if}
{if $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_ON_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY}
<li>{l s='During-stay days'}</li>
{/if}
{if $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_ON_CHECKOUT_DAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_DAY_AND_CHECKOUT_DAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY}
<li>{l s='Check-out day'}</li>
{/if}
</ul>
</div>
{/capture}
{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.room_type_service_tooltip_content allow_html=true}
</div>
</td>
<td>

View File

@@ -55,6 +55,35 @@
<td>
<div>
{$service['name']|escape:'html':'UTF-8'}
{capture name='room_type_service_tooltip_content'}
{assign var="priceCalcMethod" value=$service['price_calculation_method']|default:0}
<div class="tooltip-cont">
<div class="tooltip-row"><label>{l s='Applied on:'}</label></div>
<ul class="tooltip-days">
{if $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_ON_CHECKIN_DAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_DAY_AND_CHECKOUT_DAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY}
<li>{l s='Check-in day'}</li>
{/if}
{if $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_ON_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY}
<li>{l s='During-stay days'}</li>
{/if}
{if $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_ON_CHECKOUT_DAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_DAY_AND_CHECKOUT_DAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY}
<li>{l s='Check-out day'}</li>
{/if}
</ul>
</div>
{/capture}
{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.room_type_service_tooltip_content allow_html=true}
</div>
</div>
<input value="{$service['id_service_product_order_detail']|escape:'html':'UTF-8'}" name="id_service_product_order_detail[]" type="hidden"/>
</td>
@@ -136,8 +165,34 @@
</td>
<td>
{$product['name']|escape:'html':'UTF-8'}
{include file='controllers/orders/modals/_partials/_price-calculation-info.tpl' pcm=$product['price_calculation_method']|default:0}
</td>
{capture name='adm_pcm_tooltip_content'}
{assign var="priceCalcMethod" value=$product['price_calculation_method']|default:0}
<div class="tooltip-cont">
<div class="tooltip-row"><label>{l s='Applied on:'}</label></div>
<ul class="tooltip-days">
{if $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_ON_CHECKIN_DAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_DAY_AND_CHECKOUT_DAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY}
<li>{l s='Check-in day'}</li>
{/if}
{if $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_ON_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY}
<li>{l s='During-stay days'}</li>
{/if}
{if $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_ON_CHECKOUT_DAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_DAY_AND_CHECKOUT_DAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY}
<li>{l s='Check-out day'}</li>
{/if}
</ul>
</div>
{/capture}
{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.adm_pcm_tooltip_content allow_html=true}
</td>
<td class="text-center">
{if $product['auto_add_to_cart'] && $product['price_addition_type'] == Product::PRICE_ADDITION_TYPE_WITH_ROOM}
<span class="badge badge-info label">{l s='Auto added'}</span><br>
@@ -296,8 +351,33 @@
</td>
<td>
{$service['name']|escape:'html':'UTF-8'}
{include file='controllers/orders/modals/_partials/_price-calculation-info.tpl' pcm=$service.price_calculation_method|default:0}
</td>
{capture name='room_type_service_pcm_tooltip_content'}
{assign var="priceCalcMethod" value=$service['price_calculation_method']|default:0}
<div class="tooltip-cont">
<div class="tooltip-row"><label>{l s='Applied on:'}</label></div>
<ul class="tooltip-days">
{if $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_ON_CHECKIN_DAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_DAY_AND_CHECKOUT_DAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY}
<li>{l s='Check-in day'}</li>
{/if}
{if $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_ON_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY}
<li>{l s='During-stay days'}</li>
{/if}
{if $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_ON_CHECKOUT_DAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_DAY_AND_CHECKOUT_DAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURING_STAY
|| $priceCalcMethod == Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY}
<li>{l s='Check-out day'}</li>
{/if}
</ul>
</div>
{/capture}
{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.room_type_service_pcm_tooltip_content allow_html=true} </td>
<td>
{if $service['product_auto_add'] && $service['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT}
<span class="badge badge-info label">{l s='Convenience fee'}</span>

View File

@@ -1,43 +0,0 @@
{*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License version 3.0
* that is bundled with this package in the file LICENSE.md
* It is also available through the world-wide-web at this URL:
* https://opensource.org/license/osl-3-0-php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to support@qloapps.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to a newer
* versions in the future. If you wish to customize this module for your needs
* please refer to https://store.webkul.com/customisation-guidelines for more information.
*
* @author Webkul IN
* @copyright Since 2010 Webkul
* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0
*}
{* Required param: pcm — price_calculation_method integer value *}
<span class="price-calculation-info">
<i class="icon-info-sign"></i>
</span>
<div class="price-calculation-info-container" style="display: none;">
<div class="price-info-tooltip-cont">
<p class="applied-on-label">{l s='Applied on'}</p>
<ul class="applied-on-days">
{if $pcm == 1 || $pcm == 3 || $pcm == 5 || $pcm == 7}
<li>{l s='Check-in day'}</li>
{/if}
{if $pcm == 4 || $pcm == 5 || $pcm == 6 || $pcm == 7}
<li>{l s='During-stay days'}</li>
{/if}
{if $pcm == 2 || $pcm == 3 || $pcm == 6 || $pcm == 7}
<li>{l s='Check-out day'}</li>
{/if}
</ul>
</div>
</div>

View File

@@ -21,13 +21,20 @@
*}
{capture name='options_list'}
<ul>
{foreach $selected_options as $opt}
<li>{$opt|escape:'html'}</li>
{/foreach}
</ul>
{/capture}
<span class="selected-option-info" data-options="{$smarty.capture.options_list|escape:'html'}">
{$selected_options|@count} Selected <i class="icon-info-sign"></i>
<span class="tooltip-trigger{if isset($tooltip_class) && $tooltip_class} {$tooltip_class|escape:'html':'UTF-8'}{/if}">
<img src="themes/default/img/icon-info.svg" />
</span>
<div class="tooltip-content" style="display: none;">
{if isset($tooltip_items) && $tooltip_items|@count}
<ul class="tooltip-days">
{foreach $tooltip_items as $item}
<li>{$item|escape:'html':'UTF-8'}</li>
{/foreach}
</ul>
{elseif isset($allow_html) && $allow_html}
{$tooltip_content nofilter}
{else}
{$tooltip_content|escape:'html':'UTF-8'}
{/if}
</div>

View File

@@ -200,13 +200,13 @@ class AdminNormalProductsControllerCore extends AdminController
Product::PRICE_ADDITION_TYPE_INDEPENDENT => $this->l('Convenience Fee')
);
$priceCalculationMethod = array(
Product::PRICE_CALCULATION_METHOD_ON_CHECKIN_DAY => $this->l('Only check-in day'),
Product::PRICE_CALCULATION_METHOD_ON_CHECKOUT_DAY => $this->l('Only check-out day'),
Product::PRICE_CALCULATION_METHOD_ON_DURING_STAY => $this->l('Only during-stay days'),
Product::PRICE_CALCULATION_METHOD_CHECKIN_DAY_AND_CHECKOUT_DAY => $this->l('Check-in and check-out days'),
Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_DURING_STAY => $this->l('Check-in | during-stay days'),
Product::PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURING_STAY => $this->l('Check-out | during-stay days'),
Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY => $this->l('Check-in | check-out | during-stay days'),
Product::PRICE_CALCULATION_METHOD_ON_CHECKIN_DAY => $this->l('On Check-in day'),
Product::PRICE_CALCULATION_METHOD_ON_CHECKOUT_DAY => $this->l('On Check-out day'),
Product::PRICE_CALCULATION_METHOD_ON_DURING_STAY => $this->l('On During-stay days'),
Product::PRICE_CALCULATION_METHOD_CHECKIN_DAY_AND_CHECKOUT_DAY => $this->l('Check-in day | Check-out days'),
Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_DURING_STAY => $this->l('Check-in day | During-stay days'),
Product::PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURING_STAY => $this->l('Check-out day | During-stay days'),
Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY => $this->l('Check-in day | During-stay days | Check-out day'),
);
$this->_join .= '
@@ -331,12 +331,12 @@ class AdminNormalProductsControllerCore extends AdminController
// Code For Standard product working
$sellingPreferenceTypes = array(
Product::SELLING_PREFERENCE_WITH_ROOM_TYPE => $this->l('With room type'),
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE => $this->l('With hotel|room type'),
Product::SELLING_PREFERENCE_WITH_STANDALONE => $this->l('Standalone'),
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE => $this->l('With hotel | With room type'),
Product::SELLING_PREFERENCE_WITH_STANDALONE => $this->l('With Standalone'),
Product::SELLING_PREFERENCE_WITH_HOTEL => $this->l('With hotel'),
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE => $this->l('With hotel|standalone'),
Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE => $this->l('With room type|standalone'),
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE => $this->l('With hotel|room type|standalone'),
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE => $this->l('With hotel | With standalone'),
Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE => $this->l('With room type | With standalone'),
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE => $this->l('With hotel | With room type | With standalone'),
);
$this->fields_list['selling_preference_type'] = array(
'type' => 'select',
@@ -435,27 +435,38 @@ class AdminNormalProductsControllerCore extends AdminController
{
$list = $this->fields_list['selling_preference_type']['list'];
if (!isset($list[$selling_preference_type])) {
if (empty($list[$selling_preference_type])) {
return '--';
}
$this->context->smarty->assign('selected_options', array_map('trim', explode('|', $list[$selling_preference_type])));
$options = array_map('trim', explode('|', $list[$selling_preference_type]));
return $this->context->smarty->fetch('controllers/normal_products/selected_option.tpl');
$this->context->smarty->assign(array(
'tooltip_items' => $options,
));
$tooltip = $this->context->smarty->fetch('helpers/tooltip.tpl');
return count($options) . ' ' . $this->l('Selected') . ' ' . $tooltip;
}
public function getPriceCalculationMethod($txt, $row)
public function getPriceCalculationMethod($price_calculation_method, $row)
{
$list = $this->fields_list['price_calculation_method']['list'];
$method = (int)$row['price_calculation_method'];
if (!isset($list[$method])) {
if (empty($list[$price_calculation_method])) {
return '--';
}
$this->context->smarty->assign('selected_options', array_map('trim', explode('|', $list[$method])));
$options = array_map('trim', explode('|', $list[$price_calculation_method]));
return $this->context->smarty->fetch('controllers/normal_products/selected_option.tpl');
$this->context->smarty->assign(array(
'tooltip_items' => $options,
));
$tooltip = $this->context->smarty->fetch('helpers/tooltip.tpl');
return count($options) . ' ' . $this->l('Selected') . ' ' . $tooltip;
}
public function getHotelName($hotelName, $row)
@@ -1543,7 +1554,6 @@ class AdminNormalProductsControllerCore extends AdminController
_PS_CSS_DIR_.'ps-hotel-reservation.css',
));
}else {
$this->addCSS(__PS_BASE_URI__.$this->admin_webpath.'/themes/default/css/admin-tooltip.css');
$this->addJqueryUI('ui.tooltip', 'base', true);
}
}
@@ -2374,7 +2384,10 @@ class AdminNormalProductsControllerCore extends AdminController
$this->errors[] = $this->l('Please select at least one buying option.');
}
if (!Tools::getValue('price_calculation_method')) {
$priceCalculationMethod = Tools::getValue('price_calculation_method');
$id = Tools::getValue('id_'.$this->table);
if (isset($priceCalculationMethod, $id) && empty($priceCalculationMethod) && !empty($id)) {
$this->errors[] = $this->l('Please select at least one price calculation method.');
}

View File

@@ -1379,7 +1379,6 @@ class AdminOrdersControllerCore extends AdminController
$this->addJqueryUI('ui.datepicker');
$this->addJS(_PS_JS_DIR_.'vendor/d3.v3.min.js');
$this->addCSS(__PS_BASE_URI__.$this->admin_webpath.'/themes/default/css/admin-tooltip.css');
$this->addJqueryUI(array('ui.tooltip'), 'base', true);
if ($this->display == 'view') {

View File

@@ -1466,15 +1466,7 @@ $(document).ready(function() {
},
complete: function() {
$(".loading_overlay").hide();
initAdminTooltip({
selector: '.price-calculation-info',
items: 'span',
tooltipClass: 'admin-info-tooltip',
skipIfInitialized: true,
getContent: function () {
return $(this).siblings('.price-calculation-info-container').html();
}
});
initTooltip();
}
});
});
@@ -2546,15 +2538,7 @@ const EditRoomBookingModal = {
// initialize datepickers
EditRoomBookingModal.initDatePickers();
initAdminTooltip({
selector: '.price-calculation-info',
items: 'span',
tooltipClass: 'admin-info-tooltip',
skipIfInitialized: true,
getContent: function () {
return $(this).siblings('.price-calculation-info-container').html();
}
});
initTooltip();
$('#edit_product .extra-services-container #id_htl_booking').val(jsonProductLineData.id);
$('#edit-room-booking-modal').modal('show');
} else {

View File

@@ -41,45 +41,6 @@ $(document).ready(function() {
$('#voucher_expiry').parent().removeClass('has-error');
});
// initialize tootip for room price
if ($('#rooms_refund_info .price_info').length) {
$('#rooms_refund_info .price_info').each(function (i, element) {
$(this).find('img').tooltip({
content: $(this).closest('td').find('.price_info_container').html(),
items: "span",
trigger : 'hover',
tooltipClass: "price_info-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();
});
});
}
});
});
}
$(document).on('change', '#refundTransactionAmount', function() {
if ($(this).is(':checked')) {
$(".refund_transaction_fields").show(200);

View File

@@ -171,35 +171,23 @@
<td>{dateFormat date=$booking['date_from'] full=$is_full_date} {l s='To' mod='hotelreservationsystem'} {dateFormat date=$booking['date_to'] full=$is_full_date}</td>
<td>
{displayPrice price=($booking['total_price_tax_incl'] + $booking['extra_service_total_price_tax_incl']) currency=$orderCurrency['id']}
<span class="price_info">
&nbsp;<img src="{$info_icon_path|escape:'htmlall':'UTF-8'}" />
</span>
<div class="price_info_container" style="display: none;">
<div>
<label>{l s='Room cost:' mod='hotelreservationsystem'}</label>
<span class="pull-right">{displayPrice price=$booking['total_price_tax_incl'] currency=$orderCurrency['id']}</span>
</div>
<div>
<label>{l s='Services cost:' mod='hotelreservationsystem'}</label>
<span class="pull-right">{displayPrice price=$booking['extra_service_total_price_tax_incl'] currency=$orderCurrency['id']}</span>
</div>
{capture name='refund_total_tooltip'}
<div class="tooltip-cont">
<div class="tooltip-row"><label>{l s='Room cost:' mod='hotelreservationsystem'}</label><span>{displayPrice price=$booking['total_price_tax_incl'] currency=$orderCurrency['id']}</span></div>
<div class="tooltip-row"><label>{l s='Services cost:' mod='hotelreservationsystem'}</label><span>{displayPrice price=$booking['extra_service_total_price_tax_incl'] currency=$orderCurrency['id']}</span></div>
</div>
{/capture}
{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.refund_total_tooltip allow_html=true}
</td>
<td>
{displayPrice price=($booking['room_paid_amount'] + $booking['extra_service_total_paid_amount']) currency=$orderCurrency['id']}
<span class="price_info">
&nbsp;<img src="{$info_icon_path|escape:'htmlall':'UTF-8'}" />
</span>
<div class="price_info_container" style="display: none;">
<div>
<label>{l s='Room paid amount:' mod='hotelreservationsystem'}</label>
<span class="pull-right">{displayPrice price=$booking['room_paid_amount'] currency=$orderCurrency['id']}</span>
</div>
<div>
<label>{l s='Services paid amount:' mod='hotelreservationsystem'}</label>
<span class="pull-right">{displayPrice price=$booking['extra_service_total_paid_amount'] currency=$orderCurrency['id']}</span>
</div>
{capture name='refund_paid_tooltip'}
<div class="tooltip-cont">
<div class="tooltip-row"><label>{l s='Room paid amount:' mod='hotelreservationsystem'}</label><span>{displayPrice price=$booking['room_paid_amount'] currency=$orderCurrency['id']}</span></div>
<div class="tooltip-row"><label>{l s='Services paid amount:' mod='hotelreservationsystem'}</label><span>{displayPrice price=$booking['extra_service_total_paid_amount'] currency=$orderCurrency['id']}</span></div>
</div>
{/capture}
{include file='helpers/tooltip.tpl' tooltip_content=$smarty.capture.refund_paid_tooltip allow_html=true}
</td>
{if !$isRefundCompleted}
<td>

View File

@@ -455,7 +455,7 @@
</div>
{/if}
<div class="col-xs-11 demand_adv_option_block">
<p>{$demand['name']|escape:'html':'UTF-8'} {if $product->show_price && !isset($restricted_country_mode) && !$PS_CATALOG_MODE}<span class="pull-right"><span class="extra_demand_option_price">{convertPrice price = $demand['price']}</span>{if $demand['price_calc_method'] == $WK_PRICE_CALC_METHOD_EACH_DAY}{l s='/night'}{/if}</span>{/if}</p>
<p>{$demand['name']|escape:'html':'UTF-8'} {if $product->show_price && !isset($restricted_country_mode) && !$PS_CATALOG_MODE}<span class="pull-right"><span class="extra_demand_option_price">{convertPrice price = $demand['price']}</span>{if $demand['price_calc_method'] == $WK_PRICE_CALC_METHOD_EACH_DAY}{l s='/Night'}{/if}</span>{/if}</p>
{if isset($demand['adv_option']) && $demand['adv_option']}
<select class="id_option">
{foreach $demand['adv_option'] as $idOption => $option}