- {if Product::getPriceCalculationApplicableDays(
+ {if Product::getServicePriceBillableDays(
$service.price_calculation_method,
$additionalServices['date_from'],
$additionalServices['date_to']
@@ -159,7 +159,7 @@
{$currencySign}
- {if Product::getPriceCalculationApplicableDays(
+ {if Product::getServicePriceBillableDays(
$product['price_calculation_method'],
$additionalServices['date_from'],
$additionalServices['date_to']
@@ -315,7 +315,7 @@
{displayPrice price=$service['unit_price_tax_excl'] currency=$orderCurrency}
- {if Product::getPriceCalculationApplicableDays(
+ {if Product::getServicePriceBillableDays(
$service['price_calculation_method'],
$additionalServices['date_from'],
$additionalServices['date_to']
diff --git a/classes/Cart.php b/classes/Cart.php
index 813ff4f89..242072486 100644
--- a/classes/Cart.php
+++ b/classes/Cart.php
@@ -2480,7 +2480,7 @@ class CartCore extends ObjectModel
'id_hotel_cart_booking' => $selectedProduct['id_hotel_cart_booking'],
);
}
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
$selectedProduct['price_calculation_method'],
$selectedProduct['date_from'],
$selectedProduct['date_to']
diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php
index 8b6e57e1b..e289ad98a 100644
--- a/classes/PaymentModule.php
+++ b/classes/PaymentModule.php
@@ -592,7 +592,7 @@ 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_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE
+ || $product['selling_preference_type'] == Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE
)
) {
$cover_image_arr = $objProduct->getCover($product['id_product']);
@@ -1065,7 +1065,7 @@ abstract class PaymentModuleCore extends Module
}
}
- } elseif (Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE == $product['selling_preference_type']) {
+ } elseif (Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE == $product['selling_preference_type']) {
$idProductRoomType = null;
$idProductHotel = null;
if (isset($product['id_room_type']) && $product['id_room_type']) {
diff --git a/classes/Product.php b/classes/Product.php
index 32c6d0bfe..8202e43d1 100644
--- a/classes/Product.php
+++ b/classes/Product.php
@@ -560,22 +560,22 @@ 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_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE = 3; // Product to be sold Standalone with Hotels and with Room types also
+ 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_STANDALONE_AND_WITH_ROOM_TYPE = 5; // Product to be sold standalone and with Room types also
- const SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_STANDALONE = 6; // Product to be sold standalone with Hotels and with Room types also
- const SELLING_PREFERENCE_HOTEL_STANDALONE_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_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 PRICE_ADDITION_TYPE_WITH_ROOM = 1;
const PRICE_ADDITION_TYPE_INDEPENDENT = 2;
- const PRICE_CALCULATION_METHOD_ONLY_CHECKIN_DAY = 1;
- const PRICE_CALCULATION_METHOD_ONLY_CHECKOUT_DAY = 2;
- const PRICE_CALCULATION_METHOD_ONLY_DURINGSTAY_DAY = 4;
+ const PRICE_CALCULATION_METHOD_ON_CHECKIN_DAY = 1;
+ const PRICE_CALCULATION_METHOD_ON_CHECKOUT_DAY = 2;
+ const PRICE_CALCULATION_METHOD_ON_DURING_STAY = 4;
const PRICE_CALCULATION_METHOD_CHECKIN_DAY_AND_CHECKOUT_DAY = 3;
- const PRICE_CALCULATION_METHOD_CHECKIN_AND_DURINGSTAY = 5;
- const PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURINGSTAY = 6;
- const PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURINGSTAY = 7;
+ const PRICE_CALCULATION_METHOD_CHECKIN_AND_DURING_STAY = 5;
+ const PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURING_STAY = 6;
+ const PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY = 7;
const STANDARD_PRODUCT_ADDRESS_PREFERENCE_CUSTOMER = 1;
const STANDARD_PRODUCT_ADDRESS_PREFERENCE_HOTEL = 2;
@@ -1456,9 +1456,9 @@ 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_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE.'
- || p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE.'
- || p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_STANDALONE_AND_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_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 : '')
.($front ? ' AND product_shop.`show_at_front` = 1':'')
@@ -1503,9 +1503,9 @@ 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_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE.'
- || p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE.'
- || p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_STANDALONE_AND_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_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 : '')
.($front ? ' AND product_shop.`show_at_front` = 1':'')
@@ -1554,9 +1554,9 @@ 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_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE.
- ' || p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE.
- ' || p.`selling_preference_type` = '.(int)self::SELLING_PREFERENCE_STANDALONE_AND_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_STANDALONE_AND_WITH_ROOM_TYPE.
' AND product_shop.`id_shop` = '.(int)$context->shop->id;
$sql .= ' GROUP BY cl.`id_category`';
@@ -6881,7 +6881,7 @@ class ProductCore extends ObjectModel
)
);
- $numdays = Product::getPriceCalculationApplicableDays(
+ $numdays = Product::getServicePriceBillableDays(
Product::getProductPriceCalculation($idProduct),
$dateFrom,
$dateTo
@@ -6892,46 +6892,42 @@ class ProductCore extends ObjectModel
}
- public static function getPriceCalculationApplicableDays(
+ public static function getServicePriceBillableDays(
$priceCalculationMethod,
$dateFrom,
$dateTo,
- $defaultDays = 1
) {
- if (empty($dateFrom) || empty($dateTo)) {
- return (int) $defaultDays;
- }
$numNights = (int) HotelHelper::getNumberOfDays($dateFrom, $dateTo);
- if ($numNights <= 0) {
- return (int) $defaultDays;
+ if ($numNights < 1) {
+ return 1;
}
- $checkin = 1;
- $checkout = 1;
- $duringStay = max($numNights - 1, 0);
+ $checkinDay = 1;
+ $checkoutDay = 1;
+ $stayDay = $numNights - 1;
switch ((int) $priceCalculationMethod) {
- case self::PRICE_CALCULATION_METHOD_ONLY_CHECKIN_DAY:
- return $checkin;
+ case self::PRICE_CALCULATION_METHOD_ON_CHECKIN_DAY:
+ return $checkinDay;
- case self::PRICE_CALCULATION_METHOD_ONLY_CHECKOUT_DAY:
- return $checkout;
+ case self::PRICE_CALCULATION_METHOD_ON_CHECKOUT_DAY:
+ return $checkoutDay;
- case self::PRICE_CALCULATION_METHOD_ONLY_DURINGSTAY_DAY:
- return $duringStay;
+ case self::PRICE_CALCULATION_METHOD_ON_DURING_STAY:
+ return $stayDay;
case self::PRICE_CALCULATION_METHOD_CHECKIN_DAY_AND_CHECKOUT_DAY:
- return $checkin + $checkout;
+ return $checkinDay + $checkoutDay;
- case self::PRICE_CALCULATION_METHOD_CHECKIN_AND_DURINGSTAY:
- return $checkin + $duringStay;
+ case self::PRICE_CALCULATION_METHOD_CHECKIN_AND_DURING_STAY:
+ return $checkinDay + $stayDay;
- case self::PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURINGSTAY:
- return $checkout + $duringStay;
+ case self::PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURING_STAY:
+ return $checkoutDay + $stayDay;
- case self::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURINGSTAY:
- return $checkin + $checkout + $duringStay;
+ case self::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY:
+ return $checkinDay + $checkoutDay + $stayDay;
default:
return $numNights;
@@ -6942,9 +6938,9 @@ class ProductCore extends ObjectModel
{
return in_array((int) self::getSellingPreferenceType($idProduct), [
self::SELLING_PREFERENCE_WITH_ROOM_TYPE,
- self::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE,
- self::SELLING_PREFERENCE_STANDALONE_AND_WITH_ROOM_TYPE,
- self::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
+ self::SELLING_PREFERENCE_WITH_HOTE_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,
]);
}
@@ -6952,9 +6948,9 @@ class ProductCore extends ObjectModel
{
return in_array((int) self::getSellingPreferenceType($idProduct), [
self::SELLING_PREFERENCE_HOTEL_STANDALONE,
- self::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE,
- self::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_STANDALONE,
- self::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
+ self::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE,
+ self::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE,
+ self::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
]);
}
@@ -6962,9 +6958,9 @@ class ProductCore extends ObjectModel
{
return in_array((int) self::getSellingPreferenceType($idProduct), [
self::SELLING_PREFERENCE_STANDALONE,
- self::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_STANDALONE,
- self::SELLING_PREFERENCE_STANDALONE_AND_WITH_ROOM_TYPE,
- self::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_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,
]);
}
}
diff --git a/classes/order/Order.php b/classes/order/Order.php
index 412f4460b..c3ed92715 100644
--- a/classes/order/Order.php
+++ b/classes/order/Order.php
@@ -2578,7 +2578,7 @@ class OrderCore extends ObjectModel
)) {
$totals = array_reduce($serviceProductDetail, function ($carry, $item) use ($order_detail) {
$objHotelBookingDetail = new HotelBookingDetail((int) $item['id_htl_booking_detail']);
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
$order_detail['product_price_calculation_method'],
$objHotelBookingDetail->date_from,
$objHotelBookingDetail->date_to
@@ -2633,7 +2633,7 @@ class OrderCore extends ObjectModel
// We are getting auto added service for specific room.There will be only on htl_booking_detail but can have multiple auto added service with room.
// Note: All the auto added service with room have same id_tax_rule group
$autoAddedServiceData = array_shift($autoAddedServiceData);
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
$order_detail['product_price_calculation_method'],
$autoAddedServiceData['date_from'],
$autoAddedServiceData['date_to']
diff --git a/classes/order/OrderDetail.php b/classes/order/OrderDetail.php
index f9e165503..a5d0c2176 100644
--- a/classes/order/OrderDetail.php
+++ b/classes/order/OrderDetail.php
@@ -450,7 +450,7 @@ class OrderDetailCore extends ObjectModel
$taxGroupInfo['id_room_type'],
)) {
$serviceProductData = array_shift($serviceProductData);
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
$this->product_price_calculation_method,
$serviceProductData['date_from'],
$serviceProductData['date_to']
@@ -484,7 +484,7 @@ class OrderDetailCore extends ObjectModel
$serviceProductData = array_shift($serviceProductData);
$unit_price_tax_excl = isset($serviceProductData['unit_price_tax_excl']) ? $serviceProductData['unit_price_tax_excl'] : 0;
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
$this->product_price_calculation_method,
$serviceProductData['date_from'],
$serviceProductData['date_to']
diff --git a/classes/webservice/WebserviceSpecificManagementBookings.php b/classes/webservice/WebserviceSpecificManagementBookings.php
index b7c7546a8..960ab4521 100644
--- a/classes/webservice/WebserviceSpecificManagementBookings.php
+++ b/classes/webservice/WebserviceSpecificManagementBookings.php
@@ -1193,7 +1193,7 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
$objOrderDetail = new OrderDetail($service['id_order_detail']);
$objServiceProductOrderDetail = new ServiceProductOrderDetail($service['id_service_product_order_detail']);
$quantity = $objServiceProductOrderDetail->quantity;
- $quantity *= Product::getPriceCalculationApplicableDays(
+ $quantity *= Product::getServicePriceBillableDays(
$objOrderDetail->product_price_calculation_method,
$objHotelBookingDetail->date_from,
$objHotelBookingDetail->date_to
@@ -2312,7 +2312,7 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
foreach ($services as $service) {
$insertedServiceProductIdOrderDetail = $objBookingDetail->getLastInsertedServiceIdOrderDetail($objOrder->id, $service['id_product']);
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
Product::getProductPriceCalculation($service['id_product']),
$objBookingDetail->date_from,
$objBookingDetail->date_to
@@ -2670,7 +2670,7 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
foreach ($selectedAdditonalServices[$idHotelBooking]['additional_services'] as $service) {
$serviceOrderDetail = new OrderDetail($service['id_order_detail']);
$cart_quantity = $service['quantity'];
- $serviceApplicableDays = Product::getPriceCalculationApplicableDays(
+ $serviceApplicableDays = Product::getServicePriceBillableDays(
$service['price_calculation_method'],
$dateFrom,
$dateTo
@@ -3189,7 +3189,7 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
$priceTaxExcl = $objServiceProductOrderDetail->total_price_tax_excl;
$priceTaxIncl = $objServiceProductOrderDetail->total_price_tax_incl;
$objHotelBookingDetail = new HotelBookingDetail($objServiceProductOrderDetail->id_htl_booking_detail);
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
Product::getProductPriceCalculation($service['id_product']),
$objHotelBookingDetail->date_from,
$objHotelBookingDetail->date_to
@@ -3285,7 +3285,7 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
$insertedServiceProductIdOrderDetail = $objHotelBookingDetail->getLastInsertedServiceIdOrderDetail($objOrder->id, $service['id_product']);
$objOrderDetail = new OrderDetail($insertedServiceProductIdOrderDetail);
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
Product::getProductPriceCalculation($product['id_product']),
$objHotelBookingDetail->date_from,
$objHotelBookingDetail->date_to
@@ -4214,7 +4214,7 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We
$services['id_service'] = (int) $service['id_product'];
$services['name'] = $service['name'];
$services['quantity'] = (int) $service['quantity'];
- $applicableDays = Product::getPriceCalculationApplicableDays(
+ $applicableDays = Product::getServicePriceBillableDays(
$service['price_calculation_method'],
$additionalService['date_from'],
$additionalService['date_to']
diff --git a/config/defines.inc.php b/config/defines.inc.php
index f16e93903..d78f92763 100644
--- a/config/defines.inc.php
+++ b/config/defines.inc.php
@@ -26,7 +26,7 @@
/* Debug only */
if (!defined('_PS_MODE_DEV_')) {
- define('_PS_MODE_DEV_', false);
+ define('_PS_MODE_DEV_', true);
}
/* Compatibility warning */
define('_PS_DISPLAY_COMPATIBILITY_WARNING_', false);
diff --git a/controllers/admin/AdminCartsController.php b/controllers/admin/AdminCartsController.php
index a30655767..2d22649ae 100644
--- a/controllers/admin/AdminCartsController.php
+++ b/controllers/admin/AdminCartsController.php
@@ -1217,7 +1217,7 @@ class AdminCartsControllerCore extends AdminController
continue;
}
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
$servProduct['price_calculation_method'],
$dateFrom,
$dateTo
@@ -1568,7 +1568,7 @@ class AdminCartsControllerCore extends AdminController
continue;
}
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
$servProduct['price_calculation_method'],
$objCartBookingData->date_from,
$objCartBookingData->date_to
@@ -1683,7 +1683,7 @@ class AdminCartsControllerCore extends AdminController
$cartTotalQty = Cart::getProductQtyInCart($objCart->id, $idServiceProduct);
$qty = (int)$serviceQuantities[$idServiceProduct];
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
$objProduct->price_calculation_method,
$objHotelCartBookingData->date_from,
$objHotelCartBookingData->date_to
diff --git a/controllers/admin/AdminNormalProductsController.php b/controllers/admin/AdminNormalProductsController.php
index 0c3986722..b41b5fd99 100644
--- a/controllers/admin/AdminNormalProductsController.php
+++ b/controllers/admin/AdminNormalProductsController.php
@@ -200,13 +200,13 @@ class AdminNormalProductsControllerCore extends AdminController
Product::PRICE_ADDITION_TYPE_INDEPENDENT => $this->l('Convenience Fee')
);
$priceCalculationMethod = array(
- Product::PRICE_CALCULATION_METHOD_ONLY_CHECKIN_DAY => $this->l('Only check-in day'),
- Product::PRICE_CALCULATION_METHOD_ONLY_CHECKOUT_DAY => $this->l('Only check-out day'),
- Product::PRICE_CALCULATION_METHOD_ONLY_DURINGSTAY_DAY => $this->l('Only during-stay days'),
+ 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_DURINGSTAY => $this->l('Check-in | during-stay days'),
- Product::PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURINGSTAY => $this->l('Check-out | during-stay days'),
- Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURINGSTAY => $this->l('Check-in | check-out | during-stay 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'),
);
$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_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE => $this->l('With hotel|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_HOTEL_STANDALONE_AND_WITH_STANDALONE => $this->l('With hotel|standalone'),
- Product::SELLING_PREFERENCE_STANDALONE_AND_WITH_ROOM_TYPE => $this->l('With room type|standalone'),
- Product::SELLING_PREFERENCE_HOTEL_STANDALONE_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|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'),
);
$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_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE,
- Product::SELLING_PREFERENCE_STANDALONE_AND_WITH_ROOM_TYPE,
- Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
+ Product::SELLING_PREFERENCE_WITH_HOTE_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,
);
$hotelSellingPreferences = array(
Product::SELLING_PREFERENCE_HOTEL_STANDALONE,
- Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE,
- Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_STANDALONE,
- Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
+ Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE,
+ Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE,
+ Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
);
if (in_array((int)$product->selling_preference_type, $roomTypeSellingPreferences, true)) {
diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php
index d28c8fd23..a824685d0 100644
--- a/controllers/admin/AdminOrdersController.php
+++ b/controllers/admin/AdminOrdersController.php
@@ -1013,7 +1013,7 @@ class AdminOrdersControllerCore extends AdminController
unset($serviceProducts[$key]);
} else {
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
$servProduct['price_calculation_method'],
$dateFrom,
$dateTo
@@ -4184,9 +4184,9 @@ class AdminOrdersControllerCore extends AdminController
$products = array();
$standaloneSellingPreferenceTypes = array(
Product::SELLING_PREFERENCE_STANDALONE,
- Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_STANDALONE,
- Product::SELLING_PREFERENCE_STANDALONE_AND_WITH_ROOM_TYPE,
- Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_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,
);
foreach ($standaloneSellingPreferenceTypes as $sellingPreferenceType) {
if ($productsByType = Product::searchByName(
@@ -5396,7 +5396,7 @@ class AdminOrdersControllerCore extends AdminController
)) {
foreach ($services as $service) {
$insertedServiceProductIdOrderDetail = $objBookingDetail->getLastInsertedServiceIdOrderDetail($order->id, $service['id_product']);
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
Product::getProductPriceCalculation($service['id_product']),
$objBookingDetail->date_from,
$objBookingDetail->date_to
@@ -6197,12 +6197,12 @@ class AdminOrdersControllerCore extends AdminController
&& count($orderServiceProduct['additional_services'])
) {
foreach ($orderServiceProduct['additional_services'] as $serviceProduct) {
- $newNumDays = Product::getPriceCalculationApplicableDays(
+ $newNumDays = Product::getServicePriceBillableDays(
$serviceProduct['price_calculation_method'],
$new_date_from,
$new_date_to
);
- $oldNumDays = Product::getPriceCalculationApplicableDays(
+ $oldNumDays = Product::getServicePriceBillableDays(
$serviceProduct['price_calculation_method'],
$old_date_from,
$old_date_to
@@ -6589,7 +6589,7 @@ class AdminOrdersControllerCore extends AdminController
$serviceOrderDetail = new OrderDetail($service['id_order_detail']);
$cart_quantity = $service['quantity'];
- $serviceApplicableDays = Product::getPriceCalculationApplicableDays(
+ $serviceApplicableDays = Product::getServicePriceBillableDays(
$service['price_calculation_method'],
$selectedAdditonalServices[$idHotelBooking]['date_from'],
$selectedAdditonalServices[$idHotelBooking]['date_to']
@@ -7452,7 +7452,7 @@ class AdminOrdersControllerCore extends AdminController
unset($serviceProducts[$key]);
} else {
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
$servProduct['price_calculation_method'],
$dateFrom,
$dateTo
@@ -7637,7 +7637,7 @@ class AdminOrdersControllerCore extends AdminController
$objServiceProductOrderDetail->quantity = $quantity;
$objServiceProductOrderDetail->unit_price_tax_excl = $unitPrice;
$objServiceProductOrderDetail->unit_price_tax_incl = $unitPrice * $oldTaxMultiplier;
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
$objOrderDetail->product_price_calculation_method,
$objHotelBookingDetail->date_from,
$objHotelBookingDetail->date_to
@@ -7757,7 +7757,7 @@ class AdminOrdersControllerCore extends AdminController
if ($objProduct->allow_multiple_quantity && Validate::isUnsignedInt($qty[$service])) {
$finalQty = (int)$qty[$service];
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
Product::getProductPriceCalculation($service),
$objHotelBookingDetail->date_from,
$objHotelBookingDetail->date_to
@@ -7813,7 +7813,7 @@ class AdminOrdersControllerCore extends AdminController
$this->context->cart = $cart;
$this->context->customer = new Customer($order->id_customer);
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
Product::getProductPriceCalculation($service['id']),
$objHotelBookingDetail->date_from,
$objHotelBookingDetail->date_to
@@ -8133,7 +8133,7 @@ class AdminOrdersControllerCore extends AdminController
$objRoomTypeServiceProductPrice = new RoomTypeServiceProductPrice();
$cartProductProcessed = 1;
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
Product::getProductPriceCalculation($objServiceProduct->id),
$objHotelBookingDetail->date_from,
$objHotelBookingDetail->date_to
@@ -8369,7 +8369,7 @@ class AdminOrdersControllerCore extends AdminController
if ($res &= $objServiceProductOrderDetail->delete()) {
$order = new Order($objServiceProductOrderDetail->id_order);
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
$objOrderDetail->product_price_calculation_method,
$objHotelBookingDetail->date_from,
$objHotelBookingDetail->date_to
diff --git a/controllers/admin/AdminStatsController.php b/controllers/admin/AdminStatsController.php
index 9886d86a1..0ade4a0e5 100644
--- a/controllers/admin/AdminStatsController.php
+++ b/controllers/admin/AdminStatsController.php
@@ -2421,9 +2421,9 @@ class AdminStatsControllerCore extends AdminStatsTabController
IFNULL(SUM(
CASE
WHEN od.`purchase_supplier_price` <> "0.000000"
- THEN (od.`purchase_supplier_price` / (IF (od.`product_price_calculation_method` = '.Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURINGSTAY.', DATEDIFF(hbd.`date_to`, hbd.`date_from`), 1)))
+ THEN (od.`purchase_supplier_price` / (IF (od.`product_price_calculation_method` = '.Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY.', DATEDIFF(hbd.`date_to`, hbd.`date_from`), 1)))
WHEN od.`purchase_supplier_price` = "0.000000"
- THEN ((od.`original_product_price` / o.`conversion_rate`) * '.(int)Configuration::get('CONF_AVERAGE_PRODUCT_MARGIN').' / 100) / (IF (od.`product_price_calculation_method` = '.Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURINGSTAY.', DATEDIFF(hbd.`date_to`, hbd.`date_from`), 1))
+ THEN ((od.`original_product_price` / o.`conversion_rate`) * '.(int)Configuration::get('CONF_AVERAGE_PRODUCT_MARGIN').' / 100) / (IF (od.`product_price_calculation_method` = '.Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY.', DATEDIFF(hbd.`date_to`, hbd.`date_from`), 1))
END
), 0)
FROM `'._DB_PREFIX_.'service_product_order_detail` rtspod
diff --git a/controllers/front/CartController.php b/controllers/front/CartController.php
index 10df365a1..8e1937270 100644
--- a/controllers/front/CartController.php
+++ b/controllers/front/CartController.php
@@ -756,7 +756,7 @@ class CartControllerCore extends FrontController
$this->errors[] = Tools::displayError('The quantity you\'ve entered is invalid.');
} else {
$cartTotalQty = Cart::getProductQtyInCart((int)$this->context->cart->id,(int)$idServiceProduct);
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
$objProduct->price_calculation_method,
$objHotelCartBookingData->date_from,
$objHotelCartBookingData->date_to
diff --git a/controllers/front/ParentOrderController.php b/controllers/front/ParentOrderController.php
index 573aea7f8..6048edfdc 100644
--- a/controllers/front/ParentOrderController.php
+++ b/controllers/front/ParentOrderController.php
@@ -324,9 +324,9 @@ class ParentOrderControllerCore extends FrontController
$objServiceProductCartDetail = new ServiceProductCartDetail();
$hotelSellingPreferences = [
Product::SELLING_PREFERENCE_HOTEL_STANDALONE,
- Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE,
- Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_STANDALONE,
- Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
+ Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE,
+ Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE,
+ Product::SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE,
];
if ($hotelProducts = $objServiceProductCartDetail->getServiceProductsInCart(
$this->context->cart->id,
@@ -353,9 +353,9 @@ class ParentOrderControllerCore extends FrontController
$standaloneSellingPreferences = [
Product::SELLING_PREFERENCE_STANDALONE,
- Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_STANDALONE,
- Product::SELLING_PREFERENCE_STANDALONE_AND_WITH_ROOM_TYPE,
- Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_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,
];
$standaloneProducts = $objServiceProductCartDetail->getServiceProductsInCart(
$this->context->cart->id,
@@ -501,9 +501,9 @@ class ParentOrderControllerCore extends FrontController
$objServiceProductCartDetail = new ServiceProductCartDetail();
$standaloneSellingPreferences = [
Product::SELLING_PREFERENCE_STANDALONE,
- Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_STANDALONE,
- Product::SELLING_PREFERENCE_STANDALONE_AND_WITH_ROOM_TYPE,
- Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_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,
];
if (count($objServiceProductCartDetail->getServiceProductsInCart(
$this->context->cart->id,
diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js
index fccec2e4f..10b8df061 100644
--- a/modules/blockcart/ajax-cart.js
+++ b/modules/blockcart/ajax-cart.js
@@ -140,22 +140,22 @@ var ajaxCart = {
case SELLING_PREFERENCE_HOTEL_STANDALONE:
channels.with_hotel = true;
break;
- case SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE:
+ 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_HOTEL_STANDALONE_AND_WITH_STANDALONE:
+ case SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE:
channels.with_hotel = true;
channels.standalone = true;
break;
- case SELLING_PREFERENCE_STANDALONE_AND_WITH_ROOM_TYPE:
+ case SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE:
channels.with_room_type = true;
channels.standalone = true;
break;
- case SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE:
+ case SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE:
channels.with_room_type = true;
channels.with_hotel = true;
channels.standalone = true;
diff --git a/modules/blockcart/blockcart.tpl b/modules/blockcart/blockcart.tpl
index 6caf931e7..910a50f4a 100644
--- a/modules/blockcart/blockcart.tpl
+++ b/modules/blockcart/blockcart.tpl
@@ -405,10 +405,10 @@
{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_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE=Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE}
- {addJsDef SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_STANDALONE=Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_STANDALONE}
- {addJsDef SELLING_PREFERENCE_STANDALONE_AND_WITH_ROOM_TYPE=Product::SELLING_PREFERENCE_STANDALONE_AND_WITH_ROOM_TYPE}
- {addJsDef SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE=Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE}
+ {addJsDef SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE=Product::SELLING_PREFERENCE_WITH_HOTE_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}
{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}
diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php
index 2cb844209..b8bea902b 100644
--- a/modules/hotelreservationsystem/classes/HotelHelper.php
+++ b/modules/hotelreservationsystem/classes/HotelHelper.php
@@ -2155,7 +2155,7 @@ class HotelHelper
'price' => '250',
'auto_add_to_cart' => 1,
'show_at_front' => 0,
- 'price_calculation_method' => Product::PRICE_CALCULATION_METHOD_ONLY_DURINGSTAY_DAY,
+ 'price_calculation_method' => Product::PRICE_CALCULATION_METHOD_ON_DURING_STAY,
'price_addition_type' => Product::PRICE_ADDITION_TYPE_WITH_ROOM,
'en' => array(
'name' => 'Room Maintenance Fees',
@@ -2187,7 +2187,7 @@ class HotelHelper
'price' => '250',
'auto_add_to_cart' => 1,
'show_at_front' => 0,
- 'price_calculation_method' => Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURINGSTAY,
+ 'price_calculation_method' => Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY,
'price_addition_type' => Product::PRICE_ADDITION_TYPE_INDEPENDENT,
'en' => array(
'name' => 'Internet Handling Charges',
@@ -2220,7 +2220,7 @@ class HotelHelper
'price' => '50',
'auto_add_to_cart' => 0,
'show_at_front' => 1,
- 'price_calculation_method' => Product::PRICE_CALCULATION_METHOD_ONLY_DURINGSTAY_DAY,
+ 'price_calculation_method' => Product::PRICE_CALCULATION_METHOD_ON_DURING_STAY,
'price_addition_type' => Product::PRICE_ADDITION_TYPE_WITH_ROOM,
'en' => array(
'name' => 'Airport Shuttle',
@@ -2252,7 +2252,7 @@ class HotelHelper
'price' => '200',
'auto_add_to_cart' => 0,
'show_at_front' => 1,
- 'price_calculation_method' => Product::PRICE_CALCULATION_METHOD_ONLY_DURINGSTAY_DAY,
+ 'price_calculation_method' => Product::PRICE_CALCULATION_METHOD_ON_DURING_STAY,
'price_addition_type' => Product::PRICE_ADDITION_TYPE_WITH_ROOM,
'en' => array(
'name' => 'Cab on Demand',
@@ -2284,7 +2284,7 @@ class HotelHelper
'price' => '350',
'auto_add_to_cart' => 0,
'show_at_front' => 1,
- 'price_calculation_method' => Product::PRICE_CALCULATION_METHOD_ONLY_DURINGSTAY_DAY,
+ 'price_calculation_method' => Product::PRICE_CALCULATION_METHOD_ON_DURING_STAY,
'price_addition_type' => Product::PRICE_ADDITION_TYPE_WITH_ROOM,
'en' => array(
'name' => 'Breakfast',
@@ -2316,7 +2316,7 @@ class HotelHelper
'price' => '450',
'auto_add_to_cart' => 0,
'show_at_front' => 1,
- 'price_calculation_method' => Product::PRICE_CALCULATION_METHOD_ONLY_DURINGSTAY_DAY,
+ 'price_calculation_method' => Product::PRICE_CALCULATION_METHOD_ON_DURING_STAY,
'price_addition_type' => Product::PRICE_ADDITION_TYPE_WITH_ROOM,
'en' => array(
'name' => 'Dinner',
diff --git a/modules/hotelreservationsystem/classes/ServiceProductCartDetail.php b/modules/hotelreservationsystem/classes/ServiceProductCartDetail.php
index 512e12b6b..a7872d9a8 100644
--- a/modules/hotelreservationsystem/classes/ServiceProductCartDetail.php
+++ b/modules/hotelreservationsystem/classes/ServiceProductCartDetail.php
@@ -90,7 +90,7 @@ class ServiceProductCartDetail extends ObjectModel
)) {
$updateQty = $product['quantity'];
$objHotelCartBookingData = new HotelCartBookingData($htlCartBookingId);
- $numdays = Product::getPriceCalculationApplicableDays(
+ $numdays = Product::getServicePriceBillableDays(
Product::getProductPriceCalculation($product['id_product']),
$objHotelCartBookingData->date_from,
$objHotelCartBookingData->date_to
@@ -251,7 +251,7 @@ class ServiceProductCartDetail extends ObjectModel
$product['htl_cart_booking_id']
);
} else {
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
$objProduct->price_calculation_method,
$product['date_from'],
$product['date_to']
@@ -458,7 +458,7 @@ class ServiceProductCartDetail extends ObjectModel
if ($objServiceProductCartDetail->save()) {
if (Validate::isLoadedObject($objHotelCartBooking = new HotelCartBookingData($idHtlCartData))) {
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
$objProduct->price_calculation_method,
$objHotelCartBooking->date_from,
$objHotelCartBooking->date_to
@@ -520,7 +520,7 @@ class ServiceProductCartDetail extends ObjectModel
if ($updateQunatity) {
if (Validate::isLoadedObject($objHotelCartBooking = new HotelCartBookingData($product['id_hotel_cart_booking']))) {
$objProduct = new Product((int) $product['id_product']);
- $numDays = Product::getPriceCalculationApplicableDays(
+ $numDays = Product::getServicePriceBillableDays(
$objProduct->price_calculation_method,
$objHotelCartBooking->date_from,
$objHotelCartBooking->date_to
diff --git a/modules/qlostatsserviceproducts/qlostatsserviceproducts.php b/modules/qlostatsserviceproducts/qlostatsserviceproducts.php
index 684cf15f9..c36687ef1 100644
--- a/modules/qlostatsserviceproducts/qlostatsserviceproducts.php
+++ b/modules/qlostatsserviceproducts/qlostatsserviceproducts.php
@@ -182,11 +182,11 @@ class QloStatsServiceProducts extends ModuleGrid
$numNightsSql = 'IFNULL(DATEDIFF(hbd.`date_to`, hbd.`date_from`), 0)';
$applicableDaysSql = 'CASE
WHEN spod.`id_htl_booking_detail` IS NULL OR spod.`id_htl_booking_detail` = 0 THEN 1
- WHEN od.`product_price_calculation_method` IN ('.(int)Product::PRICE_CALCULATION_METHOD_ONLY_CHECKIN_DAY.', '.(int)Product::PRICE_CALCULATION_METHOD_ONLY_CHECKOUT_DAY.') THEN 1
- WHEN od.`product_price_calculation_method` = '.(int)Product::PRICE_CALCULATION_METHOD_ONLY_DURINGSTAY_DAY.' THEN GREATEST('.$numNightsSql.' - 1, 1)
+ WHEN od.`product_price_calculation_method` IN ('.(int)Product::PRICE_CALCULATION_METHOD_ON_CHECKIN_DAY.', '.(int)Product::PRICE_CALCULATION_METHOD_ON_CHECKOUT_DAY.') THEN 1
+ WHEN od.`product_price_calculation_method` = '.(int)Product::PRICE_CALCULATION_METHOD_ON_DURING_STAY.' THEN GREATEST('.$numNightsSql.' - 1, 1)
WHEN od.`product_price_calculation_method` = '.(int)Product::PRICE_CALCULATION_METHOD_CHECKIN_DAY_AND_CHECKOUT_DAY.' THEN 2
- WHEN od.`product_price_calculation_method` IN ('.(int)Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_DURINGSTAY.', '.(int)Product::PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURINGSTAY.') THEN GREATEST('.$numNightsSql.', 1)
- WHEN od.`product_price_calculation_method` = '.(int)Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURINGSTAY.' THEN GREATEST('.$numNightsSql.' + 1, 1)
+ WHEN od.`product_price_calculation_method` IN ('.(int)Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_DURING_STAY.', '.(int)Product::PRICE_CALCULATION_METHOD_CHECKOUT_AND_DURING_STAY.') THEN GREATEST('.$numNightsSql.', 1)
+ WHEN od.`product_price_calculation_method` = '.(int)Product::PRICE_CALCULATION_METHOD_CHECKIN_AND_CHECKOUT_AND_DURING_STAY.' THEN GREATEST('.$numNightsSql.' + 1, 1)
ELSE GREATEST('.$numNightsSql.', 1)
END';
diff --git a/themes/hotel-reservation-theme/_partials/cart_booking_demands.tpl b/themes/hotel-reservation-theme/_partials/cart_booking_demands.tpl
index 7f218e0c8..964cba5d8 100644
--- a/themes/hotel-reservation-theme/_partials/cart_booking_demands.tpl
+++ b/themes/hotel-reservation-theme/_partials/cart_booking_demands.tpl
@@ -153,7 +153,7 @@
{if ($product.show_price && !isset($restricted_country_mode)) || isset($groups)}
{if !$priceDisplay}{convertPrice price=$product.price_tax_incl}{else}{convertPrice price=$product.price_tax_exc}{/if}
- {if Product::getPriceCalculationApplicableDays(
+ {if Product::getServicePriceBillableDays(
$product.price_calculation_method,
$cartRoom.date_from|default:'',
$cartRoom.date_to|default:''
diff --git a/themes/hotel-reservation-theme/_partials/service-products-list-row.tpl b/themes/hotel-reservation-theme/_partials/service-products-list-row.tpl
index 8df8fe516..c636e4129 100644
--- a/themes/hotel-reservation-theme/_partials/service-products-list-row.tpl
+++ b/themes/hotel-reservation-theme/_partials/service-products-list-row.tpl
@@ -55,7 +55,7 @@
{block name='service_product_price'}
{if !$priceDisplay}{convertPrice price=$service_product.price_tax_incl}{else}{convertPrice price=$service_product.price_tax_exc}{/if}
- {if Product::getPriceCalculationApplicableDays(
+ {if Product::getServicePriceBillableDays(
$service_product.price_calculation_method,
$service_product.date_from|default:$date_from|default:'',
$service_product.date_to|default:$date_to|default:''
diff --git a/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js b/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js
index 51978e8fe..7c2fa5f05 100644
--- a/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js
+++ b/themes/hotel-reservation-theme/js/modules/blockcart/ajax-cart.js
@@ -140,22 +140,22 @@ var ajaxCart = {
case SELLING_PREFERENCE_HOTEL_STANDALONE:
channels.with_hotel = true;
break;
- case SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE:
+ 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_HOTEL_STANDALONE_AND_WITH_STANDALONE:
+ case SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_STANDALONE:
channels.with_hotel = true;
channels.standalone = true;
break;
- case SELLING_PREFERENCE_STANDALONE_AND_WITH_ROOM_TYPE:
+ case SELLING_PREFERENCE_WITH_STANDALONE_AND_WITH_ROOM_TYPE:
channels.with_room_type = true;
channels.standalone = true;
break;
- case SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE:
+ case SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE:
channels.with_room_type = true;
channels.with_hotel = true;
channels.standalone = true;
diff --git a/themes/hotel-reservation-theme/modules/blockcart/blockcart.tpl b/themes/hotel-reservation-theme/modules/blockcart/blockcart.tpl
index 47121ca96..fecff84c9 100644
--- a/themes/hotel-reservation-theme/modules/blockcart/blockcart.tpl
+++ b/themes/hotel-reservation-theme/modules/blockcart/blockcart.tpl
@@ -406,10 +406,10 @@
{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_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE=Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE}
- {addJsDef SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_STANDALONE=Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_STANDALONE}
- {addJsDef SELLING_PREFERENCE_STANDALONE_AND_WITH_ROOM_TYPE=Product::SELLING_PREFERENCE_STANDALONE_AND_WITH_ROOM_TYPE}
- {addJsDef SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE=Product::SELLING_PREFERENCE_HOTEL_STANDALONE_AND_WITH_ROOM_TYPE_AND_WITH_STANDALONE}
+ {addJsDef SELLING_PREFERENCE_WITH_HOTE_AND_WITH_ROOM_TYPE=Product::SELLING_PREFERENCE_WITH_HOTE_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}
{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}
|