Fixed: the params passed to createRoomTypeFeaturePrice were not passed properly
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -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)),
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user