When using the availability search ( http://example.com/booking ) with the hook_rooms_price_modifier_alter() function it works fine on normal page views.
Some of the Units have a sleeping capacity of 2 people. In the search results the Unit has a dropdown to select the number of people staying. Changing this dropdown, the parameter $booking_info has incorrect dates:
Normal page request: 2015-02-15 -- 2015-02-22
Ajax request: 2015-02-15 -- 2015-02-21
I'm also using https://www.drupal.org/project/issues/rooms_availability_constraints which is NOT compatible with the new rooms 1.4.
-- edit --
My actual problem is that for a 14 day stay you get a $10 discount, 21 days $15. So I use the start and end date to calculate the length of stay and modify the price with:
$price_modifiers['my.module'] = [
'#type' => ROOMS_DYNAMIC_MODIFIER,
'#quantity' => 1,
'#op_type' => ROOMS_SUB,
'#amount' => 10
];
Comments
Comment #1
ITWest-jg CreditAttribution: ITWest-jg commentedComment #2
acrollet CreditAttribution: acrollet commentedComment #3
ronald_istos CreditAttribution: ronald_istos at roomify - online and open source reservation solutions commentedCould we have an update here on whether this is still an issue with the latest Rooms? Thanks!
Comment #4
ITWest-jg CreditAttribution: ITWest-jg commentedHi,
Just grabbed the code tagged 7.x-1.7 from github. There is still a problem, it seems that inside hook_rooms_price_modifier_alter(&$price_modifiers, $booking_info)
$booking_info is still incorrect, for the URL:
http://example.com/booking/2015-12-12/2015-12-19/1?type=test&rooms_group_size1=1
$booking_info['end_date'] is 2015-12-18
This only happens for some rooms... weird.