Fix: Incorrect selling type context during order validation for multi-preference service products

This commit is contained in:
Amit sharma
2026-05-29 19:12:37 +05:30
parent 71cd5573da
commit 412f43919b
38 changed files with 387 additions and 522 deletions

View File

@@ -77,9 +77,9 @@
var product_type_simple = {Product::PTYPE_SIMPLE|intval};
var SELLING_PREFERENCE_WITH_ROOM_TYPE = {Product::SELLING_PREFERENCE_WITH_ROOM_TYPE|intval};
var SELLING_PREFERENCE_HOTEL_STANDALONE = {Product::SELLING_PREFERENCE_HOTEL_STANDALONE|intval};
var SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE = {Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE|intval};
var SELLING_PREFERENCE_STANDALONE = {Product::SELLING_PREFERENCE_STANDALONE|intval};
var SELLING_PREFERENCE_WITH_HOTEL = {Product::SELLING_PREFERENCE_WITH_HOTEL|intval};
var SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE = {Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE|intval};
var SELLING_PREFERENCE_WITH_STANDALONE = {Product::SELLING_PREFERENCE_WITH_STANDALONE|intval};
var price_addition_type_with_room = {Product::PRICE_ADDITION_TYPE_WITH_ROOM|intval};
var price_addition_type_independent = {Product::PRICE_ADDITION_TYPE_INDEPENDENT|intval};

View File

@@ -261,7 +261,7 @@
</div>
</div>
</div>
<div class="form-group" id="associated_hotel_tree" {if ($product->selling_preference_type != Product::SELLING_PREFERENCE_HOTEL_STANDALONE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE)}style="display:none;"{/if}>
<div class="form-group" id="associated_hotel_tree" {if ($product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE)}style="display:none;"{/if}>
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="category_box" type="category_box"}</span></div>
<label class="control-label col-lg-2" for="hotel_block">
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select hotels for which this service will be available.'}">
@@ -274,7 +274,7 @@
</div>
</div>
</div>
<div class="form-group" id="associated_hotel_rooms_tree" {if ($product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE && $product->selling_preference_type != 0)}style="display:none;"{/if}>
<div class="form-group" id="associated_hotel_rooms_tree" {if ($product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE && $product->selling_preference_type != 0)}style="display:none;"{/if}>
<div class="col-lg-1"><span class="pull-right">{include file="controllers/products/multishop/checkbox.tpl" field="category_box" type="category_box"}</span></div>
<label class="control-label col-lg-2" for="hotel_room_block">
<span class="label-tooltip" data-toggle="tooltip" title="{l s='Select room type and hotels for which this service will be available.'}">
@@ -287,7 +287,7 @@
</div>
</div>
</div>
<div class="form-group" id="auto_add_to_cart_container" {if $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE && $product->selling_preference_type != 0}style="display:none;"{/if}>
<div class="form-group" id="auto_add_to_cart_container" {if $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE && $product->selling_preference_type != Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE && $product->selling_preference_type != 0}style="display:none;"{/if}>
<label class="control-label col-lg-3" for="">
<span class="label-tooltip" data-toggle="tooltip" title="{l s='When enabled, this service will be added in cart for each associated Room type or Hotel when they are added in cart. Also auto added services will not be visible to customers.'}">
{l s='Auto add to cart this product'}
@@ -621,10 +621,10 @@
hideOtherLanguage({$default_form_language});
var missing_product_name = '{l s='Please fill product name input field' js=1}';
var SELLING_PREFERENCE_WITH_ROOM_TYPE = {Product::SELLING_PREFERENCE_WITH_ROOM_TYPE|intval};
var SELLING_PREFERENCE_HOTEL_STANDALONE = {Product::SELLING_PREFERENCE_HOTEL_STANDALONE|intval};
var SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE = {Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE|intval};
var SELLING_PREFERENCE_STANDALONE = {Product::SELLING_PREFERENCE_STANDALONE|intval};
var SELLING_PREFERENCE_WITH_HOTEL = {Product::SELLING_PREFERENCE_WITH_HOTEL|intval};
var SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE = {Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE|intval};
var SELLING_PREFERENCE_WITH_STANDALONE = {Product::SELLING_PREFERENCE_WITH_STANDALONE|intval};
var SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE = {Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE|intval};
var SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE = {Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE|intval};
var SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE = {Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE|intval};
var SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE = {Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE|intval};
</script>

View File

@@ -930,8 +930,8 @@
{assign var=total_rooms_price_tax_incl value=$order->getTotalProductsWithTaxes(false, true)}
{* Get total extra services including convenience fees prices *}
{assign var=total_products_price_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_HOTEL_STANDALONE) + $order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_STANDALONE))}
{assign var=total_products_price_tax_incl value=($order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_HOTEL_STANDALONE) + $order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_STANDALONE))}
{assign var=total_products_price_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_HOTEL) + $order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_STANDALONE))}
{assign var=total_products_price_tax_incl value=($order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_HOTEL) + $order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_STANDALONE))}
{* Get total of extra services and extra demands prices(excluding convenience fee) *}
{assign var=total_room_services_and_demands_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_ROOM_TYPE) + $totalDemandsPriceTE)}

View File

@@ -1644,6 +1644,10 @@ class CartCore extends ObjectModel
$objAdvPayment = new HotelAdvancedPayment();
foreach ($products as $product) {
// skip products if selection os for only room or only normal products
$canSellWithRoomType = Product::isSellableWithRoomType($product['id_product']);
$canSellWithHotel = Product::isSellableWithHotel($product['id_product']);
$canSellAsStandalone = Product::isSellableAsStandalone($product['id_product']);
if ($product['booking_product']) {
if ($type == Cart::ONLY_ROOM_SERVICES
|| $type == Cart::ONLY_STANDALONE_PRODUCTS
@@ -1659,10 +1663,6 @@ class CartCore extends ObjectModel
continue;
}
$canSellWithRoomType = Product::isSellableWithRoomType($product['id_product']);
$canSellWithHotel = Product::isSellableWithHotel($product['id_product']);
$canSellAsStandalone = Product::isSellableAsStandalone($product['id_product']);
if ($canSellWithRoomType) {
if ($type == Cart::ONLY_STANDALONE_PRODUCTS && !$canSellAsStandalone && !$canSellWithHotel) {
continue;
@@ -1761,28 +1761,17 @@ class CartCore extends ObjectModel
Cart::ONLY_ROOM_SERVICES_WITH_AUTO_ADD_WITHOUT_CONVENIENCE_FEE,
));
$singleContextSellTypes = [
Product::SELLING_PREFERENCE_WITH_ROOM_TYPE,
Product::SELLING_PREFERENCE_HOTEL_STANDALONE,
Product::SELLING_PREFERENCE_STANDALONE,
];
$specificSellType = ($param_product
&& isset($product['selling_preference_type'])
&& in_array((int)$product['selling_preference_type'], $singleContextSellTypes))
? (int)$product['selling_preference_type']
: null;
$sellsAsStandalone = $specificSellType !== null
? ($specificSellType === Product::SELLING_PREFERENCE_STANDALONE)
: Product::isSellableAsStandalone($product['id_product']);
$sellsWithHotel = $specificSellType !== null
? ($specificSellType === Product::SELLING_PREFERENCE_HOTEL_STANDALONE)
: Product::isSellableWithHotel($product['id_product']);
$sellsWithRoomType = $specificSellType !== null
? ($specificSellType === Product::SELLING_PREFERENCE_WITH_ROOM_TYPE)
: Product::isSellableWithRoomType($product['id_product']);
if ($param_product && isset($product['selling_preference_type'])) {
$canSellWithRoomType = $canSellWithRoomType
&& ($product['selling_preference_type'] == Product::SELLING_PREFERENCE_WITH_ROOM_TYPE);
$canSellWithHotel = $canSellWithHotel
&& ($product['selling_preference_type'] == Product::SELLING_PREFERENCE_WITH_HOTEL);
$canSellAsStandalone = $canSellAsStandalone
&& ($product['selling_preference_type'] == Product::SELLING_PREFERENCE_WITH_STANDALONE);
}
if ($sellsAsStandalone && !$isRoomServiceTotalType) {
if ($canSellAsStandalone && !$isRoomServiceTotalType) {
if ($serviceProducts = $objServiceProductCartDetail->getServiceProductsInCart(
$this->id,
[],
@@ -1807,7 +1796,7 @@ class CartCore extends ObjectModel
}
}
if ($sellsWithHotel) {
if ($canSellWithHotel) {
if ($type == Cart::ONLY_ROOM_SERVICES
|| $type == Cart::ONLY_CONVENIENCE_FEE
|| $type == Cart::ONLY_ROOM_SERVICES_WITHOUT_AUTO_ADD
@@ -1860,7 +1849,7 @@ class CartCore extends ObjectModel
}
}
}
if ($sellsWithRoomType && $type !== Cart::ONLY_STANDALONE_PRODUCTS) {
if ($canSellWithRoomType && $type !== Cart::ONLY_STANDALONE_PRODUCTS) {
if ($servicesWithRoom = $objServiceProductCartDetail->getServiceProductsInCart(
$this->id,
@@ -2561,7 +2550,7 @@ class CartCore extends ObjectModel
$serviceProduct['total_wt'] = $standaloneProductData['total_price_tax_incl'];
$serviceProduct['price'] = $standaloneProductData['total_price_tax_excl'] / $standaloneProductData['quantity'];
$serviceProduct['price_wt'] = $standaloneProductData['total_price_tax_incl'] / $standaloneProductData['quantity'];
$serviceProduct['selling_preference_type'] = Product::SELLING_PREFERENCE_STANDALONE;
$serviceProduct['selling_preference_type'] = Product::SELLING_PREFERENCE_WITH_STANDALONE;
$serviceProduct['id_hotel'] = 0;
$serviceProduct['id_hotel_cart_booking'] = 0;
$serviceProduct['id_room_type'] = 0;
@@ -2625,7 +2614,7 @@ class CartCore extends ObjectModel
// if (!empty($hotelProducts['products'])) {
// foreach($hotelProducts['products'] as $hotelProduct) {
$productinfo = $serviceProduct;
$productinfo['selling_preference_type'] = Product::SELLING_PREFERENCE_HOTEL_STANDALONE;
$productinfo['selling_preference_type'] = Product::SELLING_PREFERENCE_WITH_HOTEL;
$orderPackage[$id_address][$hotelProduct['id_hotel']]['product_list'][] = $productinfo;
if (!isset($orderPackage[$id_address][$hotelProduct['id_hotel']]['id_hotel'])) {

View File

@@ -590,9 +590,9 @@ abstract class PaymentModuleCore extends Module
}
if (!$product['booking_product']
&& ($product['selling_preference_type'] == Product::SELLING_PREFERENCE_STANDALONE
|| $product['selling_preference_type'] == Product::SELLING_PREFERENCE_HOTEL_STANDALONE
|| $product['selling_preference_type'] == Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE
&& ($product['selling_preference_type'] == Product::SELLING_PREFERENCE_WITH_STANDALONE
|| $product['selling_preference_type'] == Product::SELLING_PREFERENCE_WITH_HOTEL
|| $product['selling_preference_type'] == Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE
)
) {
$cover_image_arr = $objProduct->getCover($product['id_product']);
@@ -1003,7 +1003,7 @@ abstract class PaymentModuleCore extends Module
$objServiceProductOrderDetail->save();
}
}
} elseif (Product::SELLING_PREFERENCE_HOTEL_STANDALONE == $product['selling_preference_type']) {
} elseif (Product::SELLING_PREFERENCE_WITH_HOTEL == $product['selling_preference_type']) {
if ($hotelProducts = $objServiceProductCartDetail->getServiceProductsInCart(
$this->context->cart->id,
[],
@@ -1037,7 +1037,7 @@ abstract class PaymentModuleCore extends Module
}
}
} elseif (Product::SELLING_PREFERENCE_STANDALONE == $product['selling_preference_type']) {
} elseif (Product::SELLING_PREFERENCE_WITH_STANDALONE == $product['selling_preference_type']) {
if ($standaloneProducts = $objServiceProductCartDetail->getServiceProductsInCart(
$this->context->cart->id,
[],
@@ -1065,7 +1065,7 @@ abstract class PaymentModuleCore extends Module
}
}
} elseif (Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE == $product['selling_preference_type']) {
} elseif (Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE == $product['selling_preference_type']) {
$idProductRoomType = null;
$idProductHotel = null;
if (isset($product['id_room_type']) && $product['id_room_type']) {
@@ -1083,7 +1083,7 @@ abstract class PaymentModuleCore extends Module
)) {
foreach ($serviceProducts as $serviceProduct) {
if ($serviceProduct['id_hotel']) {
$idOrderDetail = $objBookingDetail->getPsOrderDetailIdByIdProduct($idProduct, $order->id, Product::SELLING_PREFERENCE_HOTEL_STANDALONE);
$idOrderDetail = $objBookingDetail->getPsOrderDetailIdByIdProduct($idProduct, $order->id, Product::SELLING_PREFERENCE_WITH_HOTEL);
} else {
$idOrderDetail = $objBookingDetail->getPsOrderDetailIdByIdProduct($idProduct, $order->id, Product::SELLING_PREFERENCE_WITH_ROOM_TYPE);
}
@@ -1247,10 +1247,10 @@ abstract class PaymentModuleCore extends Module
$total_convenience_fee_tax = $total_convenience_fee_ti - $total_convenience_fee_te;
// service products
$standalone_products_price_tax_excl = $order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_STANDALONE);
$standalone_products_price_tax_incl = $order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_STANDALONE);
$hotel_standalone_products_price_tax_excl = $order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_HOTEL_STANDALONE);
$hotel_standalone_products_price_tax_incl = $order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_HOTEL_STANDALONE);
$standalone_products_price_tax_excl = $order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_STANDALONE);
$standalone_products_price_tax_incl = $order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_STANDALONE);
$hotel_standalone_products_price_tax_excl = $order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_HOTEL);
$hotel_standalone_products_price_tax_incl = $order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_HOTEL);
$service_products_tax = ($standalone_products_price_tax_incl + $hotel_standalone_products_price_tax_incl) - ($standalone_products_price_tax_excl + $hotel_standalone_products_price_tax_excl);

View File

@@ -559,12 +559,12 @@ class ProductCore extends ObjectModel
// Product selling preference types
const SELLING_PREFERENCE_WITH_ROOM_TYPE = 1; // Product to be sold with Room types
const SELLING_PREFERENCE_HOTEL_STANDALONE = 2; // Product to be sold Standalone with Hotels
const SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE = 3; // Product to be sold Standalone with Hotels and with Room types also
const SELLING_PREFERENCE_STANDALONE = 4; // Product to be sold standalone
const SELLING_PREFERENCE_WITH_HOTEL = 2; // Product to be sold Standalone with Hotels
const SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE = 3; // Product to be sold Standalone with Hotels and with Room types also
const SELLING_PREFERENCE_WITH_STANDALONE = 4; // Product to be sold standalone
const SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE = 5; // Product to be sold standalone and with Room types also
const SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE = 6; // Product to be sold standalone with Hotels and with Room types also
const SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE = 7; // Product to be sold standalone with Hotels and with Room types also and standalone
const SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE = 7; // Product to be sold standalone with Hotels and with Room types also and standalone
const PRICE_ADDITION_TYPE_WITH_ROOM = 1;
const PRICE_ADDITION_TYPE_INDEPENDENT = 2;
@@ -1456,8 +1456,8 @@ class ProductCore extends ObjectModel
'(`element_type` = '.RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE.' AND `id_element` = '.(int)$this->id.')
)
AND (p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_ROOM_TYPE. '
|| p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE.'
|| p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE.'
|| p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE.'
|| p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE.'
|| p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE.')
AND product_shop.`id_shop` = '.(int)$context->shop->id
.($sub_category? ' AND product_shop.`id_category_default` = '.(int)$sub_category : '')
@@ -1503,8 +1503,8 @@ class ProductCore extends ObjectModel
'(`element_type` = '.RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE.' AND `id_element` = '.(int)$this->id.')
)
AND (p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_ROOM_TYPE. '
|| p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE.'
|| p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE.'
|| p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE.'
|| p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE.'
|| p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE.')'. '
AND product_shop.`id_shop` = '.(int)$context->shop->id
.($sub_category? ' AND product_shop.`id_category_default` = '.(int)$sub_category : '')
@@ -1554,8 +1554,8 @@ class ProductCore extends ObjectModel
'(`element_type` = '.RoomTypeServiceProduct::WK_ELEMENT_TYPE_ROOM_TYPE.' AND `id_element` = '.(int)$this->id.')
)
AND p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_ROOM_TYPE.
' || p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE.
' || p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE.
' || p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE.
' || p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE.
' || p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE.
' AND product_shop.`id_shop` = '.(int)$context->shop->id;
@@ -3117,7 +3117,7 @@ class ProductCore extends ObjectModel
}
if (!Product::isBookingProduct($id_product)
&& (Product::getSellingPreferenceType($id_product) == Product::SELLING_PREFERENCE_STANDALONE)
&& (Product::getSellingPreferenceType($id_product) == Product::SELLING_PREFERENCE_WITH_STANDALONE)
&& !$id_address
) {
$serviceAddressPrefrenceType = Configuration::get('PS_STANDARD_PRODUCT_ORDER_ADDRESS_PREFRENCE');
@@ -6938,29 +6938,29 @@ class ProductCore extends ObjectModel
{
return in_array((int) self::getSellingPreferenceType($idProduct), [
self::SELLING_PREFERENCE_WITH_ROOM_TYPE,
self::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE,
self::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE,
self::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE,
self::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
self::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
]);
}
public static function isSellableWithHotel($idProduct)
{
return in_array((int) self::getSellingPreferenceType($idProduct), [
self::SELLING_PREFERENCE_HOTEL_STANDALONE,
self::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE,
self::SELLING_PREFERENCE_WITH_HOTEL,
self::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE,
self::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE,
self::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
self::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
]);
}
public static function isSellableAsStandalone($idProduct)
{
return in_array((int) self::getSellingPreferenceType($idProduct), [
self::SELLING_PREFERENCE_STANDALONE,
self::SELLING_PREFERENCE_WITH_STANDALONE,
self::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE,
self::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE,
self::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
self::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
]);
}
}

View File

@@ -2882,12 +2882,12 @@ class OrderCore extends ObjectModel
}
// check hotel linked products
$objServiceProductOrderDetail = new ServiceProductOrderDetail();
if ($hotelProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($this->id, 0, 0, Product::SELLING_PREFERENCE_HOTEL_STANDALONE)) {
if ($hotelProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($this->id, 0, 0, Product::SELLING_PREFERENCE_WITH_HOTEL)) {
$res &= $this->checkList($hotelProducts, $action, false);
$hasRoomsOrProducts = 1;
}
if ($standaloneProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($this->id, 0, 0, Product::SELLING_PREFERENCE_STANDALONE)) {
if ($standaloneProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($this->id, 0, 0, Product::SELLING_PREFERENCE_WITH_STANDALONE)) {
$res &= $this->checkList($standaloneProducts, $action, false);
$hasRoomsOrProducts = 1;
}

View File

@@ -612,8 +612,8 @@ class OrderInvoiceCore extends ObjectModel
$order_detail = $this->getProducts();
$order_detail = array_filter($order_detail, function($v) {
return (!$v['is_booking_product'] && (
$v['selling_preference_type'] == Product::SELLING_PREFERENCE_STANDALONE
|| $v['selling_preference_type'] == Product::SELLING_PREFERENCE_HOTEL_STANDALONE
$v['selling_preference_type'] == Product::SELLING_PREFERENCE_WITH_STANDALONE
|| $v['selling_preference_type'] == Product::SELLING_PREFERENCE_WITH_HOTEL
));
});

View File

@@ -607,8 +607,8 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
foreach ($cart_htl_data[$type_key]['date_diff'] as $key => &$value) {
$value['avg_paid_unit_price_tax_excl'] = Tools::ps_round($value['avg_paid_unit_price_tax_excl'] / $value['num_rm'], 6);
}
} else if (Product::SELLING_PREFERENCE_HOTEL_STANDALONE == $type_value['selling_preference_type']
|| Product::SELLING_PREFERENCE_STANDALONE == $type_value['selling_preference_type']
} else if (Product::SELLING_PREFERENCE_WITH_HOTEL == $type_value['selling_preference_type']
|| Product::SELLING_PREFERENCE_WITH_STANDALONE == $type_value['selling_preference_type']
) {
$serviceProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($order_obj->id, $type_value['id_order_detail'], $type_value['product_id']);
if ($taxes = OrderDetail::getTaxListStatic($type_value['id_order_detail'])) {
@@ -651,8 +651,8 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate
if ($idsOrderDetail = array_column($order_details, 'id_order_detail')) {
$footer['room_price_tax_excl'] = $this->order->getTotalProductsWithoutTaxes(false, true, null, null, null, $idsOrderDetail) + $this->order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_ROOM_TYPE, 1, Product::PRICE_ADDITION_TYPE_WITH_ROOM, $idsOrderDetail);
$footer['room_price_tax_incl'] = $this->order->getTotalProductsWithTaxes(false, true, null, null, null, $idsOrderDetail) + $this->order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_ROOM_TYPE, 1, Product::PRICE_ADDITION_TYPE_WITH_ROOM, $idsOrderDetail);
$footer['service_products_price_tax_excl'] = $this->order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_STANDALONE, false, false, $idsOrderDetail) + $this->order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_HOTEL_STANDALONE, false, false, $idsOrderDetail);
$footer['service_products_price_tax_incl'] = $this->order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_STANDALONE, false, false, $idsOrderDetail) + $this->order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_HOTEL_STANDALONE, false, false, $idsOrderDetail);
$footer['service_products_price_tax_excl'] = $this->order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_STANDALONE, false, false, $idsOrderDetail) + $this->order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_HOTEL, false, false, $idsOrderDetail);
$footer['service_products_price_tax_incl'] = $this->order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_STANDALONE, false, false, $idsOrderDetail) + $this->order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_HOTEL, false, false, $idsOrderDetail);
$footer['additional_service_price_tax_excl'] = $this->order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_ROOM_TYPE, 0, null, $idsOrderDetail) + $totalDemandsPriceTE;
$footer['additional_service_price_tax_incl'] = $this->order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_ROOM_TYPE, 0, null, $idsOrderDetail) + $totalDemandsPriceTI;
$footer['total_convenience_fee_te'] = $this->order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_ROOM_TYPE, 1, Product::PRICE_ADDITION_TYPE_INDEPENDENT, $idsOrderDetail);

View File

@@ -348,8 +348,8 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice
$breakdown = array();
$order_detail = array_filter($this->order->products, function($v) {
return (!$v['is_booking_product'] && (
$v['selling_preference_type'] == Product::SELLING_PREFERENCE_STANDALONE
|| $v['selling_preference_type'] == Product::SELLING_PREFERENCE_HOTEL_STANDALONE
$v['selling_preference_type'] == Product::SELLING_PREFERENCE_WITH_STANDALONE
|| $v['selling_preference_type'] == Product::SELLING_PREFERENCE_WITH_HOTEL
));
});

View File

@@ -3953,7 +3953,7 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
$objProduct = new Product($service['id_product']);
$services['per_night'] = 0;
if ($objProduct->price_calculation_method == Product::PRICE_CALCULATION_METHOD_PER_DAY) {
if ($objProduct->price_calculation_method & Product::PRICE_CALCULATION_METHOD_ON_DURING_STAY) {
$services['per_night'] = 1;
}

View File

@@ -26,7 +26,7 @@
/* Debug only */
if (!defined('_PS_MODE_DEV_')) {
define('_PS_MODE_DEV_', true);
define('_PS_MODE_DEV_', false);
}
/* Compatibility warning */
define('_PS_DISPLAY_COMPATIBILITY_WARNING_', false);

View File

@@ -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_HOTE_AND_WITH_ROOM_TYPE => $this->l('With hotel|room type'),
Product::SELLING_PREFERENCE_STANDALONE => $this->l('Standalone'),
Product::SELLING_PREFERENCE_HOTEL_STANDALONE => $this->l('With hotel'),
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 => $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_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE => $this->l('With hotel|room type|standalone'),
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE => $this->l('With hotel|room type|standalone'),
);
$this->fields_list['selling_preference_type'] = array(
'type' => 'select',
@@ -3016,15 +3016,15 @@ class AdminNormalProductsControllerCore extends AdminController
$roomTypeSellingPreferences = array(
Product::SELLING_PREFERENCE_WITH_ROOM_TYPE,
Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE,
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE,
Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE,
Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
);
$hotelSellingPreferences = array(
Product::SELLING_PREFERENCE_HOTEL_STANDALONE,
Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE,
Product::SELLING_PREFERENCE_WITH_HOTEL,
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE,
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE,
Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
);
if (in_array((int)$product->selling_preference_type, $roomTypeSellingPreferences, true)) {

View File

@@ -1156,13 +1156,13 @@ class AdminOrdersControllerCore extends AdminController
}
$refundReqProducts = $objOrderReturn->getOrderRefundRequestedProducts($objOrder->id, 0, 1, 1);
$hotelProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($objOrder->id, 0, 0, Product::SELLING_PREFERENCE_HOTEL_STANDALONE);
$hotelProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($objOrder->id, 0, 0, Product::SELLING_PREFERENCE_WITH_HOTEL);
foreach($hotelProducts as $key => $product) {
if ((in_array($product['id_service_product_order_detail'], $refundReqProducts)) || $product['is_refunded']) {
unset($hotelProducts[$key]);
}
}
$standaloneProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($objOrder->id, 0, 0, Product::SELLING_PREFERENCE_STANDALONE);
$standaloneProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($objOrder->id, 0, 0, Product::SELLING_PREFERENCE_WITH_STANDALONE);
foreach($standaloneProducts as $key => $product) {
if ((in_array($product['id_service_product_order_detail'], $refundReqProducts)) || $product['is_refunded']) {
unset($standaloneProducts[$key]);
@@ -2438,7 +2438,7 @@ class AdminOrdersControllerCore extends AdminController
}
if ($hotelProducts = $objRoomTypeServProdOrderDtl->getServiceProductsInOrder($order->id, 0, 0, Product::SELLING_PREFERENCE_HOTEL_STANDALONE)) {
if ($hotelProducts = $objRoomTypeServProdOrderDtl->getServiceProductsInOrder($order->id, 0, 0, Product::SELLING_PREFERENCE_WITH_HOTEL)) {
foreach ($hotelProducts as $serviceProduct) {
$objRoomTypeServProdOrderDtl = new ServiceProductOrderDetail($serviceProduct['id_service_product_order_detail']);
foreach ($fields as $field) {
@@ -2453,7 +2453,7 @@ class AdminOrdersControllerCore extends AdminController
}
}
if ($standaloneProducts = $objRoomTypeServProdOrderDtl->getServiceProductsInOrder($order->id, 0, 0, Product::SELLING_PREFERENCE_STANDALONE)) {
if ($standaloneProducts = $objRoomTypeServProdOrderDtl->getServiceProductsInOrder($order->id, 0, 0, Product::SELLING_PREFERENCE_WITH_STANDALONE)) {
foreach ($standaloneProducts as $serviceProduct) {
$objRoomTypeServProdOrderDtl = new ServiceProductOrderDetail($serviceProduct['id_service_product_order_detail']);
foreach ($fields as $field) {
@@ -2947,8 +2947,8 @@ class AdminOrdersControllerCore extends AdminController
// if order has normal products the add kpi for total products
$objServiceProductOrderDetail = new ServiceProductOrderDetail();
$hotelProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($objOrder->id, 0, 0, Product::SELLING_PREFERENCE_HOTEL_STANDALONE);
$standaloneProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($objOrder->id, 0, 0, Product::SELLING_PREFERENCE_STANDALONE);
$hotelProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($objOrder->id, 0, 0, Product::SELLING_PREFERENCE_WITH_HOTEL);
$standaloneProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($objOrder->id, 0, 0, Product::SELLING_PREFERENCE_WITH_STANDALONE);
if ($hotelProducts || $standaloneProducts) {
$helper = new HelperKpi();
@@ -3295,14 +3295,14 @@ class AdminOrdersControllerCore extends AdminController
} else {
$product['image_link'] = $this->context->link->getImageLink($objProduct->link_rewrite, $this->context->language->iso_code.'-default', 'small_default');
}
if ($product['selling_preference_type'] == Product::SELLING_PREFERENCE_HOTEL_STANDALONE) {
$hotelProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($order->id, $product['id_order_detail'], $product['product_id'], Product::SELLING_PREFERENCE_HOTEL_STANDALONE);
if ($product['selling_preference_type'] == Product::SELLING_PREFERENCE_WITH_HOTEL) {
$hotelProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($order->id, $product['id_order_detail'], $product['product_id'], Product::SELLING_PREFERENCE_WITH_HOTEL);
foreach ($hotelProducts as $hotelProduct) {
$orderHotelServiceProducts[] = array_merge($product, $hotelProduct);
}
}
if ($product['selling_preference_type'] == Product::SELLING_PREFERENCE_STANDALONE) {
$standaloneProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($order->id, $product['id_order_detail'], $product['product_id'], Product::SELLING_PREFERENCE_STANDALONE);
if ($product['selling_preference_type'] == Product::SELLING_PREFERENCE_WITH_STANDALONE) {
$standaloneProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($order->id, $product['id_order_detail'], $product['product_id'], Product::SELLING_PREFERENCE_WITH_STANDALONE);
foreach ($standaloneProducts as $standaloneProduct) {
$orderStandaloneServiceProducts[] = array_merge($product, $standaloneProduct);
}
@@ -3636,8 +3636,8 @@ class AdminOrdersControllerCore extends AdminController
// send hotel standalone and standalone products
$objProduct = new Product();
$hotelStandaloneProducts = $objProduct->getServiceProducts(null, Product::SELLING_PREFERENCE_HOTEL_STANDALONE);
$standaloneProducts = $objProduct->getServiceProducts(null, Product::SELLING_PREFERENCE_STANDALONE);
$hotelStandaloneProducts = $objProduct->getServiceProducts(null, Product::SELLING_PREFERENCE_WITH_HOTEL);
$standaloneProducts = $objProduct->getServiceProducts(null, Product::SELLING_PREFERENCE_WITH_STANDALONE);
$this->tpl_view_vars = array(
'hotelStandaloneProducts' => $hotelStandaloneProducts,
@@ -4183,10 +4183,10 @@ class AdminOrdersControllerCore extends AdminController
} else {
$products = array();
$standaloneSellingPreferenceTypes = array(
Product::SELLING_PREFERENCE_STANDALONE,
Product::SELLING_PREFERENCE_WITH_STANDALONE,
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE,
Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE,
Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
);
foreach ($standaloneSellingPreferenceTypes as $sellingPreferenceType) {
if ($productsByType = Product::searchByName(
@@ -5708,9 +5708,9 @@ class AdminOrdersControllerCore extends AdminController
$objOrderDetail = new OrderDetail();
$cartProducts = $objCart->getProducts();
if (Product::isSellableWithHotel($cartProducts[0]['id_product']) && $addressTax->id_hotel) {
$cartProducts[0]['selling_preference_type'] = Product::SELLING_PREFERENCE_HOTEL_STANDALONE;
$cartProducts[0]['selling_preference_type'] = Product::SELLING_PREFERENCE_WITH_HOTEL;
} elseif (Product::isSellableAsStandalone($cartProducts[0]['id_product'])) {
$cartProducts[0]['selling_preference_type'] = Product::SELLING_PREFERENCE_STANDALONE;
$cartProducts[0]['selling_preference_type'] = Product::SELLING_PREFERENCE_WITH_STANDALONE;
}
$objOrderDetail->createList($objOrder, $objCart, $objOrder->getCurrentOrderState(), $cartProducts, (isset($objOrderInvoice) ? $objOrderInvoice->id : 0), $useTaxes, (int)Tools::getValue('add_product_warehouse'));

View File

@@ -524,7 +524,7 @@ class GuestTrackingControllerCore extends FrontController
1
);
}
} else if (Product::SELLING_PREFERENCE_HOTEL_STANDALONE == $type_value['selling_preference_type']) {
} else if (Product::SELLING_PREFERENCE_WITH_HOTEL == $type_value['selling_preference_type']) {
$cover_image_arr = $product->getCover($type_value['product_id']);
if (!empty($cover_image_arr)) {
@@ -536,7 +536,7 @@ class GuestTrackingControllerCore extends FrontController
foreach ($hotelProducts as $hotelProduct) {
$hotelServiceProducts[] = array_merge($type_value, $hotelProduct);
}
} else if (Product::SELLING_PREFERENCE_STANDALONE == $type_value['selling_preference_type']) {
} else if (Product::SELLING_PREFERENCE_WITH_STANDALONE == $type_value['selling_preference_type']) {
$cover_image_arr = $product->getCover($type_value['product_id']);
if (!empty($cover_image_arr)) {

View File

@@ -362,7 +362,7 @@ class OrderConfirmationControllerCore extends FrontController
$totalRoomsBooked += 1;
}
} else if ($type_value['selling_preference_type'] == Product::SELLING_PREFERENCE_HOTEL_STANDALONE) {
} else if ($type_value['selling_preference_type'] == Product::SELLING_PREFERENCE_WITH_HOTEL) {
$cover_image_arr = $product->getCover($type_value['product_id']);
if (!empty($cover_image_arr)) {
@@ -385,7 +385,7 @@ class OrderConfirmationControllerCore extends FrontController
}
$cart_hotel_service_products[] = $type_value;
}
} else if ($type_value['selling_preference_type'] == Product::SELLING_PREFERENCE_STANDALONE) {
} else if ($type_value['selling_preference_type'] == Product::SELLING_PREFERENCE_WITH_STANDALONE) {
$cover_image_arr = $product->getCover($type_value['product_id']);
if (!empty($cover_image_arr)) {
@@ -415,8 +415,8 @@ class OrderConfirmationControllerCore extends FrontController
if (!$objCartOrder->hasInvoice()) {
$orders_has_invoice = 0;
}
$orderTotalInfo['total_standalone_products_ti'] += ($objCartOrder->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_HOTEL_STANDALONE)+$objCartOrder->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_STANDALONE));
$orderTotalInfo['total_standalone_products_te'] += ($objCartOrder->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_HOTEL_STANDALONE)+$objCartOrder->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_STANDALONE));
$orderTotalInfo['total_standalone_products_ti'] += ($objCartOrder->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_HOTEL)+$objCartOrder->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_STANDALONE));
$orderTotalInfo['total_standalone_products_te'] += ($objCartOrder->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_HOTEL)+$objCartOrder->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_STANDALONE));
$orderTotalInfo['total_wrapping'] += $objCartOrder->total_wrapping;
$orderTotalInfo['total_rooms_te'] += $objCartOrder->getTotalProductsWithoutTaxes(false, true);
$orderTotalInfo['total_rooms_ti'] += $objCartOrder->getTotalProductsWithTaxes(false, true);

View File

@@ -385,7 +385,7 @@ class OrderDetailControllerCore extends FrontController
1
);
}
} else if (Product::SELLING_PREFERENCE_HOTEL_STANDALONE == $type_value['selling_preference_type']) {
} else if (Product::SELLING_PREFERENCE_WITH_HOTEL == $type_value['selling_preference_type']) {
$hotelProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($id_order, $type_value['id_order_detail'], $type_value['product_id']);
foreach ($hotelProducts as $hotelProduct) {
$hotelServiceProducts[] = array_merge($type_value, $hotelProduct);
@@ -404,7 +404,7 @@ class OrderDetailControllerCore extends FrontController
}
$serviceProductsFormatted[$hotelProduct['id_product']]['options'][] = $hotelProduct;
}
} else if (Product::SELLING_PREFERENCE_STANDALONE == $type_value['selling_preference_type']) {
} else if (Product::SELLING_PREFERENCE_WITH_STANDALONE == $type_value['selling_preference_type']) {
$standaloneProducts = $objServiceProductOrderDetail->getServiceProductsInOrder($id_order, $type_value['id_order_detail'], $type_value['product_id']);
foreach ($standaloneProducts as $standaloneProduct) {
$standaloneServiceProducts[] = array_merge($type_value, $standaloneProduct);

View File

@@ -323,10 +323,10 @@ class ParentOrderControllerCore extends FrontController
}
$objServiceProductCartDetail = new ServiceProductCartDetail();
$hotelSellingPreferences = [
Product::SELLING_PREFERENCE_HOTEL_STANDALONE,
Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE,
Product::SELLING_PREFERENCE_WITH_HOTEL,
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE,
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE,
Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
];
if ($hotelProducts = $objServiceProductCartDetail->getServiceProductsInCart(
$this->context->cart->id,
@@ -352,10 +352,10 @@ class ParentOrderControllerCore extends FrontController
}
$standaloneSellingPreferences = [
Product::SELLING_PREFERENCE_STANDALONE,
Product::SELLING_PREFERENCE_WITH_STANDALONE,
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE,
Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE,
Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
];
$standaloneProducts = $objServiceProductCartDetail->getServiceProductsInCart(
$this->context->cart->id,
@@ -500,10 +500,10 @@ class ParentOrderControllerCore extends FrontController
} elseif (!Customer::getAddressesTotalById($this->context->customer->id)) {
$objServiceProductCartDetail = new ServiceProductCartDetail();
$standaloneSellingPreferences = [
Product::SELLING_PREFERENCE_STANDALONE,
Product::SELLING_PREFERENCE_WITH_STANDALONE,
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE,
Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE,
Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
];
if (count($objServiceProductCartDetail->getServiceProductsInCart(
$this->context->cart->id,

View File

@@ -570,8 +570,8 @@ product_tabs['Informations'] = new function(){
var standalone = $('#sp_standalone').is(':checked');
const sellingPreference =
(withRoomType ? SELLING_PREFERENCE_WITH_ROOM_TYPE : 0) |
(withHotel ? SELLING_PREFERENCE_HOTEL_STANDALONE : 0) |
(standalone ? SELLING_PREFERENCE_STANDALONE : 0);
(withHotel ? SELLING_PREFERENCE_WITH_HOTEL : 0) |
(standalone ? SELLING_PREFERENCE_WITH_STANDALONE : 0);
$('#selling_preference_type').val(sellingPreference);

View File

@@ -127,50 +127,26 @@ var ajaxCart = {
dateFormat: 'DD-MM-YYYY',
dateFormatFull: 'DD-MM-YYYY HH:mm:ss',
nb_total_products: 0,
getSellingPreferenceChannels: function(sellingPreferenceType) {
var channels = {
with_room_type: false,
with_hotel: false,
standalone: false
};
switch (parseInt(sellingPreferenceType)) {
case SELLING_PREFERENCE_WITH_ROOM_TYPE:
channels.with_room_type = true;
break;
case SELLING_PREFERENCE_HOTEL_STANDALONE:
channels.with_hotel = true;
break;
case SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE:
channels.with_room_type = true;
channels.with_hotel = true;
break;
case SELLING_PREFERENCE_STANDALONE:
channels.standalone = true;
break;
case SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE:
channels.with_hotel = true;
channels.standalone = true;
break;
case SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE:
channels.with_room_type = true;
channels.standalone = true;
break;
case SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE:
channels.with_room_type = true;
channels.with_hotel = true;
channels.standalone = true;
break;
}
return channels;
},
isSellableWithRoomType: function(sellingPreferenceType) {
return this.getSellingPreferenceChannels(sellingPreferenceType).with_room_type;
return (sellingPreferenceType == SELLING_PREFERENCE_WITH_ROOM_TYPE
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE
);
},
isSellableWithHotel: function(sellingPreferenceType) {
return this.getSellingPreferenceChannels(sellingPreferenceType).with_hotel;
return (sellingPreferenceType == SELLING_PREFERENCE_WITH_HOTEL
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE
);
},
isSellableAsStandalone: function(sellingPreferenceType) {
return this.getSellingPreferenceChannels(sellingPreferenceType).standalone;
return (sellingPreferenceType == SELLING_PREFERENCE_WITH_STANDALONE
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE
);
},
_overrideButtonsInThePage: function () {
//for every 'add' buttons...

View File

@@ -403,12 +403,12 @@
{addJsDef generated_date=$smarty.now|intval}
{addJsDef ajax_allowed=$ajax_allowed|boolval}
{addJsDef SELLING_PREFERENCE_WITH_ROOM_TYPE=Product::SELLING_PREFERENCE_WITH_ROOM_TYPE}
{addJsDef SELLING_PREFERENCE_STANDALONE=Product::SELLING_PREFERENCE_STANDALONE}
{addJsDef SELLING_PREFERENCE_HOTEL_STANDALONE=Product::SELLING_PREFERENCE_HOTEL_STANDALONE}
{addJsDef SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE=Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE}
{addJsDef SELLING_PREFERENCE_WITH_STANDALONE=Product::SELLING_PREFERENCE_WITH_STANDALONE}
{addJsDef SELLING_PREFERENCE_WITH_HOTEL=Product::SELLING_PREFERENCE_WITH_HOTEL}
{addJsDef SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE=Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE}
{addJsDef SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE=Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE}
{addJsDef SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE=Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE}
{addJsDef SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE=Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE}
{addJsDef SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE=Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE}
{addJsDefL name=customizationIdMessage}{l s='Customization #' mod='blockcart' js=1}{/addJsDefL}
{addJsDefL name=removingLinkText}{l s='remove this product from my cart' mod='blockcart' js=1}{/addJsDefL}

View File

@@ -795,7 +795,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
public function assignServiceProductsForm()
{
$objProduct = new Product();
$serviceProducts = $objProduct->getServiceProducts(null, Product::SELLING_PREFERENCE_STANDALONE);
$serviceProducts = $objProduct->getServiceProducts(null, Product::SELLING_PREFERENCE_WITH_STANDALONE);
$hotelAddressInfo = HotelBranchInformation::getAddress($this->id_hotel);
$serviceProducts = Product::getProductsProperties($this->context->language->id, $serviceProducts);
$this->context->smarty->assign(array(
@@ -978,7 +978,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController
'ALLOTMENT_AUTO' => HotelBookingDetail::ALLOTMENT_AUTO,
'ALLOTMENT_MANUAL' => HotelBookingDetail::ALLOTMENT_MANUAL,
'SELLING_PREFERENCE_WITH_ROOM_TYPE' => Product::SELLING_PREFERENCE_WITH_ROOM_TYPE,
'SELLING_PREFERENCE_STANDALONE' => Product::SELLING_PREFERENCE_STANDALONE,
'SELLING_PREFERENCE_WITH_STANDALONE' => Product::SELLING_PREFERENCE_WITH_STANDALONE,
'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'),
'occupancy_required_for_booking' => $occupancyRequiredForBooking,
'rooms_reallocation_url' => $this->context->link->getAdminLink('AdminHotelRoomsBooking'),

View File

@@ -135,7 +135,33 @@
</div>
<div class="col-xs-10">
<span>{$product['name']|escape:'html':'UTF-8'}</span>
{include file='_partials/price-calculation-info.tpl' pcm=$product.price_calculation_method|default:0}
{assign var='priceCalcMethod' value=$product.price_calculation_method|default:0}
{capture name='htl_pcm_tooltip'}
<div class="htl-tooltip-cont">
<p class="htl-tooltip-title">{l s='Applied on:'}</p>
<ul>
{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='_partials/htl-tooltip.tpl' tooltip_content=$smarty.capture.htl_pcm_tooltip allow_html=true}
{if $product.allow_multiple_quantity}
<div class="qty_container">
<input type="text" class="form-control qty" id="qty_{$product.id_product}" name="room_service_product_qty_{$product.id_product}" data-id-product="{$product.id_product}" data-max_quantity="{$product.max_quantity}" value="{if $serviceSelected}{$cartRoom['selected_service'][$product['id_product']]['quantity']}{else}1{/if}">

View File

@@ -20,24 +20,14 @@
* @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">
<span class="htl-tooltip{if isset($tooltip_class) && $tooltip_class} {$tooltip_class|escape:'html':'UTF-8'}{/if}">
<img src="{$img_dir}icon/icon-info.svg" />
</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 class="htl-tooltip-content" style="display: none;">
{if isset($allow_html) && $allow_html}
{$tooltip_content nofilter}
{else}
{$tooltip_content|escape:'html':'UTF-8'}
{/if}
</div>

View File

@@ -58,7 +58,33 @@
{if $additionalService['allow_multiple_quantity']}
<span class="quantity">{l s='(Quantity: %s)' sprintf=[$additionalService['quantity']|string_format:'%02d']}</span>
{/if}
{include file='_partials/price-calculation-info.tpl' pcm=$additionalService.price_calculation_method|default:0}
{assign var='priceCalcMethod' value=$additionalService.price_calculation_method|default:0}
{capture name='htl_pcm_tooltip'}
<div class="htl-tooltip-cont">
<p class="htl-tooltip-title">{l s='Applied on:'}</p>
<ul>
{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='_partials/htl-tooltip.tpl' tooltip_content=$smarty.capture.htl_pcm_tooltip allow_html=true}
</div>
</div>
<div class="">

View File

@@ -125,41 +125,35 @@
{displayWtPriceWithCurrency price=($rm_v.amount_tax_excl + $rm_v.extra_demands_price_te + $rm_v.additional_services_price_te + $rm_v.additional_services_price_auto_add_te) currency=$currency}
{/if}
{if (isset($rm_v.extra_demands) && $rm_v.extra_demands) || isset($rm_v.additional_services) && $rm_v.additional_services}
<span class="order-price-info">
<img src="{$img_dir}icon/icon-info.svg" />
</span>
<div class="price-info-container" style="display: none;">
<div class="price-info-tooltip-cont">
<div class="list-row">
<div>
<p>{l s='Room(s) cost:'}</p>
</div>
<div class="text-right">
<p>
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v.amount_tax_incl + $rm_v.additional_services_price_auto_add_ti) currency=$currency}
{else}
{displayWtPriceWithCurrency price=($rm_v.amount_tax_excl + $rm_v.additional_services_price_auto_add_te) currency=$currency}
{/if}
</p>
</div>
{capture name='htl_room_price_tooltip'}
<div class="htl-tooltip-cont">
<div class="htl-tooltip-row">
<div><p>{l s='Room(s) cost:'}</p></div>
<div class="text-right">
<p>
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v.amount_tax_incl + $rm_v.additional_services_price_auto_add_ti) currency=$currency}
{else}
{displayWtPriceWithCurrency price=($rm_v.amount_tax_excl + $rm_v.additional_services_price_auto_add_te) currency=$currency}
{/if}
</p>
</div>
<div class="list-row">
<div>
<p>{l s='Service(s) cost:'}</p>
</div>
<div class="text-right">
<p>
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v.extra_demands_price_ti + $rm_v.additional_services_price_ti) currency=$currency}
{else}
{displayWtPriceWithCurrency price=($rm_v.extra_demands_price_te + $rm_v.additional_services_price_te) currency=$currency}
{/if}
</p>
</div>
</div>
<div class="htl-tooltip-row">
<div><p>{l s='Service(s) cost:'}</p></div>
<div class="text-right">
<p>
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v.extra_demands_price_ti + $rm_v.additional_services_price_ti) currency=$currency}
{else}
{displayWtPriceWithCurrency price=($rm_v.extra_demands_price_te + $rm_v.additional_services_price_te) currency=$currency}
{/if}
</p>
</div>
</div>
</div>
{/capture}
{include file='_partials/htl-tooltip.tpl' tooltip_content=$smarty.capture.htl_room_price_tooltip allow_html=true tooltip_class='htl-tooltip-room-price-detail'}
{/if}
</dd>
</div>

View File

@@ -38,7 +38,33 @@
{block name='service_product_name'}
<div class="col-sm-12 clearfix service-product-block">
<span class="service-product-name">{$service_product['name']}</span>
{include file='_partials/price-calculation-info.tpl' pcm=$service_product.price_calculation_method|default:0}
{assign var='priceCalcMethod' value=$service_product.price_calculation_method|default:0}
{capture name='htl_pcm_tooltip'}
<div class="htl-tooltip-cont">
<p class="htl-tooltip-title">{l s='Applied on:'}</p>
<ul>
{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='_partials/htl-tooltip.tpl' tooltip_content=$smarty.capture.htl_pcm_tooltip allow_html=true}
</div>
{/block}
{block name='service_product_description'}

View File

@@ -9188,36 +9188,51 @@ div a.our_properties_link{
font-size: 17px;
font-weight: 400;}
/* price calculation info tooltip */
.price-calculation-info {
cursor: pointer;
display: inline-block;
vertical-align: middle;
margin-left: 4px;
.htl-tooltip {
cursor: pointer;
display: inline-block;
vertical-align: middle;
margin-left: 4px;
}
.ui-tooltip.price-tootip {
box-shadow: 0 2px 6px 0 rgb(0 0 0 / 20%);
background: #FFFFFF;
border: unset;
color: #333;
padding: 9px 15px;
.ui-tooltip.htl-tooltip-popup {
box-shadow: 0 2px 6px 0 rgb(0 0 0 / 20%);
background: #FFFFFF;
border: unset;
color: #333;
padding: 9px 15px;
}
.ui-tooltip.price-tootip .price-info-tooltip-cont {
min-width: 160px;
.htl-tooltip-cont {
min-width: 160px;
}
.ui-tooltip.price-tootip .applied-on-label {
margin: 0 0 6px;
font-weight: 600;
font-size: 13px;
.htl-tooltip-cont .htl-tooltip-title {
margin: 0 0 6px;
font-weight: 600;
font-size: 13px;
}
.ui-tooltip.price-tootip .applied-on-days {
margin: 0;
padding-left: 16px;
font-size: 13px;
.htl-tooltip-cont ul {
margin: 0;
padding-left: 16px;
font-size: 13px;
list-style: disc;
}
.ui-tooltip.price-tootip .applied-on-days li {
padding: 2px 0;
.htl-tooltip-cont ul li {
padding: 2px 0;
}
.price-info-tooltip-cont ul li{
list-style: disc;;
.htl-tooltip-cont .htl-tooltip-row {
display: flex;
justify-content: space-between;
margin: 5px 0;
white-space: nowrap;
}
.htl-tooltip-cont .htl-tooltip-row p,
.htl-tooltip-cont .htl-tooltip-row label {
margin: 0;
font-size: 13px;
}

View File

@@ -458,40 +458,41 @@ window.addEventListener('offline', function () {
onlineFlag = false;
});
function initPriceCalculationTooltip() {
if ($('.price-calculation-info').length) {
$('.price-calculation-info').each(function () {
if ($(this).hasClass('ui-tooltip-content')) {
return;
}
$(this).tooltip({
content: $(this).siblings('.price-calculation-info-container').html(),
items: 'span',
trigger: 'hover',
tooltipClass: 'price-tootip',
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();
});
});
}
});
});
function initHtlTooltip() {
if (!$('.htl-tooltip').length) {
return;
}
$('.htl-tooltip').each(function () {
if ($(this).hasClass('ui-tooltip-content')) {
return;
}
$(this).tooltip({
content: $(this).siblings('.htl-tooltip-content').html(),
items: 'span',
trigger: 'hover',
tooltipClass: 'htl-tooltip-popup',
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).ready(function () {
initPriceCalculationTooltip();
});
initHtlTooltip();
});

View File

@@ -127,50 +127,26 @@ var ajaxCart = {
dateFormat: 'DD-MM-YYYY',
dateFormatFull: 'DD-MM-YYYY HH:mm:ss',
nb_total_products: 0,
getSellingPreferenceChannels: function(sellingPreferenceType) {
var channels = {
with_room_type: false,
with_hotel: false,
standalone: false
};
switch (parseInt(sellingPreferenceType)) {
case SELLING_PREFERENCE_WITH_ROOM_TYPE:
channels.with_room_type = true;
break;
case SELLING_PREFERENCE_HOTEL_STANDALONE:
channels.with_hotel = true;
break;
case SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE:
channels.with_room_type = true;
channels.with_hotel = true;
break;
case SELLING_PREFERENCE_STANDALONE:
channels.standalone = true;
break;
case SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE:
channels.with_hotel = true;
channels.standalone = true;
break;
case SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE:
channels.with_room_type = true;
channels.standalone = true;
break;
case SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE:
channels.with_room_type = true;
channels.with_hotel = true;
channels.standalone = true;
break;
}
return channels;
},
isSellableWithRoomType: function(sellingPreferenceType) {
return this.getSellingPreferenceChannels(sellingPreferenceType).with_room_type;
return (sellingPreferenceType == SELLING_PREFERENCE_WITH_ROOM_TYPE
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE
);
},
isSellableWithHotel: function(sellingPreferenceType) {
return this.getSellingPreferenceChannels(sellingPreferenceType).with_hotel;
return (sellingPreferenceType == SELLING_PREFERENCE_WITH_HOTEL
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE
);
},
isSellableAsStandalone: function(sellingPreferenceType) {
return this.getSellingPreferenceChannels(sellingPreferenceType).standalone;
return (sellingPreferenceType == SELLING_PREFERENCE_WITH_STANDALONE
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE
|| sellingPreferenceType == SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE
);
},
_overrideButtonsInThePage: function () {
//for every 'add' buttons...

View File

@@ -49,7 +49,7 @@ $(document).ready(function(){
if (result.extra_demands) {
$('#rooms_extra_services').html('');
$('#rooms_extra_services').append(result.extra_demands);
initPriceCalculationTooltip();
initHtlTooltip();
}
$.fancybox({
href: "#rooms_extra_services",
@@ -75,40 +75,5 @@ $(document).ready(function(){
});
});
initPriceTooltip();
});
function initPriceTooltip() {
if ($('.order-price-info').length) {
$('.order-price-info').each(function () {
$(this).tooltip({
content: $(this).closest('dd').find('.price-info-container').html(),
items: 'span',
trigger: 'hover',
tooltipClass: 'price-tootip',
open: function (event, ui) {
if (typeof (event.originalEvent) === 'undefined') {
return false;
}
var $id = $(ui.tooltip).attr('id');
// close any lingering tooltips
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();
});
});
}
});
});
}
}
initHtlTooltip();
});

View File

@@ -62,76 +62,7 @@ function sendOrderMessage() {
});
}
function initPriceTooltip() {
if ($('.order-price-info').length) {
$('.order-price-info').each(function () {
$(this).tooltip({
content: $(this).closest('dd').find('.price-info-container').html(),
items: 'span',
trigger: 'hover',
tooltipClass: 'price-tootip',
open: function (event, ui) {
if (typeof (event.originalEvent) === 'undefined') {
return false;
}
var $id = $(ui.tooltip).attr('id');
// close any lingering tooltips
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();
});
});
}
});
});
}
}
// initialize tooltip for
function initRefundDeniedTooltip() {
if ($('.refund-denied-info').length) {
$('.refund-denied-info').each(function () {
$(this).tooltip({
content: $(this).data('refund_denied_info'),
items: 'i',
trigger: 'hover',
tooltipClass: 'refund-denied-tootip',
open: function (event, ui) {
if (typeof (event.originalEvent) === 'undefined') {
return false;
}
var $id = $(ui.tooltip).attr('id');
// close any lingering tooltips
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();
});
});
}
});
});
}
}
function initMap() {
$('.booking-hotel-map-container').each(function (i, element) {
@@ -362,7 +293,7 @@ $(document).on('click', '.btn-view-extra-services', function(e) {
if (result.extra_demands) {
$('#popup-view-extra-services').html('');
$('#popup-view-extra-services').append(result.extra_demands);
initPriceCalculationTooltip();
initHtlTooltip();
$.fancybox.open({
href: '#popup-view-extra-services',
@@ -388,6 +319,5 @@ $(document).ready(function () {
sendOrderMessage();
});
initPriceTooltip();
initRefundDeniedTooltip();
initHtlTooltip();
});

View File

@@ -33,45 +33,6 @@ $(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').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)
{
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();
@@ -705,7 +666,7 @@ $(document).ready(function()
if (result.extra_demands) {
$('#rooms_extra_services').html('');
$('#rooms_extra_services').append(result.extra_demands);
initPriceCalculationTooltip();
initHtlTooltip();
}
$.fancybox({
href: "#rooms_extra_services",

View File

@@ -1171,7 +1171,7 @@ $(document).ready(function() {
triggerElement.hide();
}
}
initPriceCalculationTooltip();
initHtlTooltip();
} else {
triggerElement.hide();
}

View File

@@ -404,12 +404,12 @@
{addJsDef ajax_allowed=$ajax_allowed|boolval}
{addJsDef hasDeliveryAddress=(isset($cart->id_address_delivery) && $cart->id_address_delivery)}
{addJsDef SELLING_PREFERENCE_WITH_ROOM_TYPE=Product::SELLING_PREFERENCE_WITH_ROOM_TYPE}
{addJsDef SELLING_PREFERENCE_STANDALONE=Product::SELLING_PREFERENCE_STANDALONE}
{addJsDef SELLING_PREFERENCE_HOTEL_STANDALONE=Product::SELLING_PREFERENCE_HOTEL_STANDALONE}
{addJsDef SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE=Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE}
{addJsDef SELLING_PREFERENCE_WITH_STANDALONE=Product::SELLING_PREFERENCE_WITH_STANDALONE}
{addJsDef SELLING_PREFERENCE_WITH_HOTEL=Product::SELLING_PREFERENCE_WITH_HOTEL}
{addJsDef SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE=Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE}
{addJsDef SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE=Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE}
{addJsDef SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE=Product::SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE}
{addJsDef SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE=Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE}
{addJsDef SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE=Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE}
{addJsDefL name=customizationIdMessage}{l s='Customization #' mod='blockcart' js=1}{/addJsDefL}
{addJsDefL name=removingLinkText}{l s='remove this product from my cart' mod='blockcart' js=1}{/addJsDefL}

View File

@@ -159,41 +159,35 @@
{displayWtPriceWithCurrency price=($rm_v['amount_tax_excl'] + $rm_v['extra_demands_price_te'] + $rm_v['additional_services_price_te'] + $rm_v['additional_services_price_auto_add_te']) currency=$objOrderCurrency}
{/if}
{if (isset($rm_v['extra_demands']) && $rm_v['extra_demands']) || isset($rm_v['additional_services']) && $rm_v['additional_services']}
<span class="order-price-info">
<img src="{$img_dir}icon/icon-info.svg" />
</span>
<div class="price-info-container" style="display:none">
<div class="price-info-tooltip-cont">
<div class="list-row">
<div>
<p>{l s='Room cost'} : </p>
</div>
<div class="text-right">
<p>
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v['amount_tax_incl'] + $rm_v['additional_services_price_auto_add_ti']) currency=$objOrderCurrency}
{else}
{displayWtPriceWithCurrency price=($rm_v['amount_tax_excl'] + $rm_v['additional_services_price_auto_add_te']) currency=$objOrderCurrency}
{/if}
</p>
</div>
{capture name='htl_order_price_tooltip'}
<div class="htl-tooltip-cont">
<div class="htl-tooltip-row">
<div><p>{l s='Room cost'} : </p></div>
<div class="text-right">
<p>
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v['amount_tax_incl'] + $rm_v['additional_services_price_auto_add_ti']) currency=$objOrderCurrency}
{else}
{displayWtPriceWithCurrency price=($rm_v['amount_tax_excl'] + $rm_v['additional_services_price_auto_add_te']) currency=$objOrderCurrency}
{/if}
</p>
</div>
<div class="list-row">
<div>
<p>{l s='Service cost'} : </p>
</div>
<div class="text-right">
<p>
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v['extra_demands_price_ti'] + $rm_v['additional_services_price_ti']) currency=$objOrderCurrency}
{else}
{displayWtPriceWithCurrency price=($rm_v['extra_demands_price_te'] + $rm_v['additional_services_price_te']) currency=$objOrderCurrency}
{/if}
</p>
</div>
</div>
<div class="htl-tooltip-row">
<div><p>{l s='Service cost'} : </p></div>
<div class="text-right">
<p>
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v['extra_demands_price_ti'] + $rm_v['additional_services_price_ti']) currency=$objOrderCurrency}
{else}
{displayWtPriceWithCurrency price=($rm_v['extra_demands_price_te'] + $rm_v['additional_services_price_te']) currency=$objOrderCurrency}
{/if}
</p>
</div>
</div>
</div>
{/capture}
{include file='_partials/htl-tooltip.tpl' tooltip_content=$smarty.capture.htl_order_price_tooltip allow_html=true}
{/if}
</dd>
</div>

View File

@@ -323,8 +323,8 @@
{assign var=total_tax_without_discount value=(($room_price_tax_incl - $room_price_tax_excl) + ($room_services_price_tax_incl - $room_services_price_tax_excl ))}
{assign var=total_standard_products_tax_incl value=($order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_STANDALONE) + $order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_HOTEL_STANDALONE))}
{assign var=total_standard_products_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_STANDALONE) + $order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_HOTEL_STANDALONE))}
{assign var=total_standard_products_tax_incl value=($order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_STANDALONE) + $order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_HOTEL))}
{assign var=total_standard_products_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_STANDALONE) + $order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_HOTEL))}
{if isset($cart_htl_data) && $cart_htl_data}
<tr>
<td>{l s='Total rooms cost'} {if $use_taxes && $display_tax_label == 1}{if $priceDisplay == 1}{l s='(tax excl.)'}{elseif $priceDisplay == 0}{l s='(tax incl.)'}{/if} {/if}</td>
@@ -729,8 +729,8 @@
{assign var=room_services_price_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_ROOM_TYPE) + $total_demands_price_te)}
{assign var=room_services_price_tax_incl value=($order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_ROOM_TYPE) + $total_demands_price_ti)}
{assign var=total_standard_products_tax_incl value=($order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_STANDALONE) + $order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_HOTEL_STANDALONE))}
{assign var=total_standard_products_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_STANDALONE) + $order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_HOTEL_STANDALONE))}
{assign var=total_standard_products_tax_incl value=($order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_STANDALONE) + $order->getTotalProductsWithTaxes(false, false, Product::SELLING_PREFERENCE_WITH_HOTEL))}
{assign var=total_standard_products_tax_excl value=($order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_STANDALONE) + $order->getTotalProductsWithoutTaxes(false, false, Product::SELLING_PREFERENCE_WITH_HOTEL))}
{assign var=total_tax_without_discount value=(($room_price_tax_incl - $room_price_tax_excl) + ($room_services_price_tax_incl - $room_services_price_tax_excl) + ($total_standard_products_tax_incl - $total_standard_products_tax_excl))}
@@ -979,7 +979,7 @@
</label>
<span>({$hotel_booking_detail.adults|string_format:'%02d'} {if $hotel_booking_detail.adults > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $hotel_booking_detail.children > 0}{l s=', '}{$hotel_booking_detail.children|string_format:'%02d'} {if $hotel_booking_detail.children > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if})</span>
{if $hotel_booking_detail.is_cancelled}<span class="badge badge-danger badge-cancelled">{l s='Cancelled'}</span>{else if $hotel_booking_detail.is_refunded}<span class="badge badge-danger badge-cancelled">{l s='Refunded'}</span>{else if $hotel_booking_detail.refund_denied}<span class="badge badge-danger badge-cancelled">{l s='Refund denied'}</span> <i class="icon-info-circle refund-denied-info" data-refund_denied_info="{l s='Refund for this booking is denied. Please contact admin for more detail.'}"></i>{else if $hotel_booking_detail.id_status != $ROOM_STATUS_ALLOTED}<span class="badge badge-danger badge-cancelled">{if $hotel_booking_detail.id_status == $ROOM_STATUS_CHECKED_OUT}{l s='Checked-Out'}{else}{l s='Checked-In'}{/if}</span>{/if}
{if $hotel_booking_detail.is_cancelled}<span class="badge badge-danger badge-cancelled">{l s='Cancelled'}</span>{else if $hotel_booking_detail.is_refunded}<span class="badge badge-danger badge-cancelled">{l s='Refunded'}</span>{else if $hotel_booking_detail.refund_denied}<span class="badge badge-danger badge-cancelled">{l s='Refund denied'}</span> {include file='_partials/htl-tooltip.tpl' tooltip_content={l s='Refund for this booking is denied. Please contact admin for more detail.'}}{else if $hotel_booking_detail.id_status != $ROOM_STATUS_ALLOTED}<span class="badge badge-danger badge-cancelled">{if $hotel_booking_detail.id_status == $ROOM_STATUS_CHECKED_OUT}{l s='Checked-Out'}{else}{l s='Checked-In'}{/if}</span>{/if}
</div>
</div>
@@ -1037,7 +1037,7 @@
<input type="checkbox" class="bookings_to_refund" id="products_to_refund_{$product_option.id_service_product_order_detail}" name="id_service_product_order_detail[]" value="{$product_option.id_service_product_order_detail|escape:'html':'UTF-8'}" {if $is_product_cancelled }disabled{/if}/>
{$product_option.name}{if isset($product_option.option_name) && $product_option.option_name} : {$product_option.option_name}{/if}
</label>
{if $product_option.is_cancelled}<span class="badge badge-danger badge-cancelled">{l s='Cancelled'}</span>{else if $product_option.is_refunded}<span class="badge badge-danger badge-cancelled">{l s='Refunded'}</span>{else if isset($product_option.refund_denied) && $product_option.refund_denied}<span class="badge badge-danger badge-cancelled">{l s='Refund denied'}</span> <i class="icon-info-circle refund-denied-info" data-refund_denied_info="{l s='Refund for this product is denied. Please contact admin for more detail.'}"></i></span>{/if}
{if $product_option.is_cancelled}<span class="badge badge-danger badge-cancelled">{l s='Cancelled'}</span>{else if $product_option.is_refunded}<span class="badge badge-danger badge-cancelled">{l s='Refunded'}</span>{else if isset($product_option.refund_denied) && $product_option.refund_denied}<span class="badge badge-danger badge-cancelled">{l s='Refund denied'}</span> {include file='_partials/htl-tooltip.tpl' tooltip_content={l s='Refund for this product is denied. Please contact admin for more detail.'}}</span>{/if}
</div>
{if $product_option.allow_multiple_quantity}
<div class="quantity-wrap clearfix">

View File

@@ -120,22 +120,18 @@
<div class="row">
<div class="{if (isset($data_v['extra_demands']) && $data_v['extra_demands']) || (isset($data_v['service_products']) && $data_v['service_products'])}col-xs-6 plus-sign{else}col-xs-12{/if}">
<div class="price_block">
<p class="total_price">
<span>
{displayPrice price=($rm_v['amount'])}
</span>
<div class="total_price">
{displayPrice price=($rm_v['amount'])}
{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>
{capture name='htl_room_price_detail_tooltip'}
<div class="htl-tooltip-cont">
<div class="htl-tooltip-row"><label>{l s='Room price'}</label><span>{displayPrice price=($rm_v['amount_without_auto_add'])}</span></div>
<div class="htl-tooltip-row"><label>{l s='Additional charges'}</label><span>{displayPrice price=($rm_v['amount'] - $rm_v['amount_without_auto_add'])}</span></div>
</div>
{/capture}
{include file='_partials/htl-tooltip.tpl' tooltip_content=$smarty.capture.htl_room_price_detail_tooltip allow_html=true tooltip_class='htl-tooltip-room-price-detail'}
{/if}
</p>
</div>
<p class="total_price_detial">
{l s='Total rooms price'} {if $display_tax_label}{if $priceDisplay} {l s='(Excl.'} {else}{l s='(Incl.)'}{/if} {l s='all taxes.)'}{/if}
</p>