diff --git a/classes/webservice/WebserviceSpecificManagementBookings.php b/classes/webservice/WebserviceSpecificManagementBookings.php index 060028c5e..8101e68df 100644 --- a/classes/webservice/WebserviceSpecificManagementBookings.php +++ b/classes/webservice/WebserviceSpecificManagementBookings.php @@ -2936,11 +2936,16 @@ class WebserviceSpecificManagementBookingsCore Extends ObjectModel implements We } $params['name'] = 'Api-Booking-Price'; - $params['date_selection_type'] = HotelRoomTypeFeaturePricing::DATE_SELECTION_TYPE_RANGE; $params['impact_type'] = HotelRoomTypeFeaturePricing::IMPACT_TYPE_FIXED_PRICE; $params['price'] /= $numDays; $params['is_special_days_exists'] = 0; $params['special_days'] = json_encode(false); + $params['price_rules'] = array( + array( + 'date_from' => $params['date_from'], + 'date_to' => $params['date_to'] + ) + ); return HotelRoomTypeFeaturePricing::createRoomTypeFeaturePrice($params); } diff --git a/controllers/admin/AdminCartsController.php b/controllers/admin/AdminCartsController.php index a014cee8b..a3def740c 100644 --- a/controllers/admin/AdminCartsController.php +++ b/controllers/admin/AdminCartsController.php @@ -984,13 +984,16 @@ class AdminCartsControllerCore extends AdminController 'id_cart' => $id_cart, 'id_guest' => (int) $this->context->cookie->id_guest, 'id_room' => $id_room, - 'date_selection_type' => HotelRoomTypeFeaturePricing::DATE_SELECTION_TYPE_RANGE, - 'date_from' => $date_from, - 'date_to' => $date_to, 'is_special_days_exists' => 0, 'impact_way' => HotelRoomTypeFeaturePricing::IMPACT_WAY_FIX_PRICE, 'impact_type' => HotelRoomTypeFeaturePricing::IMPACT_TYPE_FIXED_PRICE, - 'impact_value' => $price + 'impact_value' => $price, + 'price_rules' => array( + array( + 'date_from' => $date_from, + 'date_to' => $date_to + ) + ) ) ); diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php index af1604da5..f7708bfa8 100644 --- a/controllers/admin/AdminImportController.php +++ b/controllers/admin/AdminImportController.php @@ -2639,14 +2639,17 @@ class AdminImportControllerCore extends AdminController 'id_product' => (int) $orderProduct['id_product'], 'id_cart' => (int) $this->context->cart->id, 'id_guest' => (int) $this->context->cart->id_guest, - 'date_selection_type' => HotelRoomTypeFeaturePricing::DATE_SELECTION_TYPE_RANGE, - 'date_from' => date('Y-m-d', strtotime($dateFrom)), - 'date_to' => date('Y-m-d', strtotime($dateTo)), 'is_special_days_exists' => 0, 'id_room' => $bookingCart['id_room'], 'impact_way' => HotelRoomTypeFeaturePricing::IMPACT_WAY_FIX_PRICE, 'impact_type' => HotelRoomTypeFeaturePricing::IMPACT_TYPE_FIXED_PRICE, 'impact_value' => $orderProduct['amount'], + 'price_rules' => array( + array( + 'date_from' => date('Y-m-d', strtotime($dateFrom)), + 'date_to' => date('Y-m-d', strtotime($dateTo)), + ) + ) ) ); } diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index ffb10a124..f0b22576f 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -4854,7 +4854,12 @@ class AdminOrdersControllerCore extends AdminController // create feature price if needed if ($createFeaturePrice) { $featurePriceParams['id_room'] = $room_info['id_room']; - $featurePriceParams = array_merge($featurePriceParams, array('date_from' => $date_from, 'date_to' => $date_to)); + $featurePriceParams['price_rules'] = array( + array( + 'date_from' => $date_from, + 'date_to' => $date_to + ) + ); HotelRoomTypeFeaturePricing::createRoomTypeFeaturePrice($featurePriceParams); } } else { @@ -5691,8 +5696,12 @@ class AdminOrdersControllerCore extends AdminController 'id_product' => $id_product, 'id_room' => $id_room, 'price' => $room_unit_price, - 'date_from' => $new_date_from, - 'date_to' => $new_date_to + 'price_rules' => array( + array( + 'date_from' => $new_date_from, + 'date_to' => $new_date_to + ) + ) ); HotelRoomTypeFeaturePricing::createRoomTypeFeaturePrice($params); diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index efc389e0d..94afa0a9a 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -1994,9 +1994,11 @@ class HotelBookingDetail extends ObjectModel // create feature price if needed if ($createFeaturePrice) { $featurePriceParams['id_room'] = $roomInfo['id_room']; - $featurePriceParams = array_merge( - $featurePriceParams, - array('date_from' => $objOldHotelBooking->date_from, 'date_to' => $objOldHotelBooking->date_to) + $featurePriceParams['price_rules'] = array( + array( + 'date_from' => $objOldHotelBooking->date_from, + 'date_to' => $objOldHotelBooking->date_to + ) ); HotelRoomTypeFeaturePricing::createRoomTypeFeaturePrice($featurePriceParams); }