Active
Project:
Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals
Version:
7.x-1.x-dev
Component:
Rooms Booking Manager
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 May 2013 at 22:51 UTC
Updated:
15 May 2013 at 14:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Helgi Jónsson commentedWhen invoking the hook two $booking_info arrays are outputed, one for the current date and one for the chosen booking parameters. Is it supposed to be that way?
Comment #2
Helgi Jónsson commentedHi again :)
I have a booking scenario where a client wants to charge a different price for the first night and then a lower price for additional nights. So I set out to use hook_rooms_price_modifier_alter($price_modifiers, $booking_info) and I was able to achieve the desired outcome but since the 1.0 version I get a lot of errors when adjusting the base price of a given room type based on the $booking_info. It makes me wonder what I am doing wrong or if there is a new bug, in any case I am reporting my findings here. You will find two screenshots of the results of the code below on a commerce + rooms sandbox.
Here is my custom module code:
The price options don't display the new base price. But when the module worked with the dev release prior to 1.0 the base prices were all in sync and the booking cart displayed correctly as well.
I get several errors after performing "place booking". Here are those errors:
Really looking forward on a response. :)
Best Regards,
Helgi.
Comment #3
ronald_istos commentedHi Helgi,
could you do a dpm of both $price_modifiers and $booking_info and paste here - this way I can try and help more.
Also, please keep in mind that the idea of the price_modifiers is to "inject" changes via a price modifier, not to actually change the $booking_info information.
For example if you want to increase the price you can do:
This would increase the price by 10. The price modifier operation is applied by Rooms. Instead what you are doing seems to be changing the base price.
Comment #4
Helgi Jónsson commentedHi,
Thanks for your reply. I will choose the price modifier path instead. If I get to any trouble I will post here again. I also have further questions about $booking_info.
I am also currently working on a commerce payment module to use for the rooms module that pulls the customer profile info, line-item description & credit card information and sends it to interfax.net and their api. Their secure lounge is level 1 pci & dss environment and stores the information for 30 days. My module is a fax implementation, so that a hotel can get the order with booking information faxed and then they process the payment themselves.
This is quite important because Hotels want to confirm bookings before they capture the payment. Its possible to authorize first and capture payment later via paypal but in my case for Iceland, they transfer the money directly on to credit cards, not via bank transfers.
I tried to implement the hook_rooms_price_modifier_alter within the payement module to access the $booking_info in order to query information such as number of persons and more. I am hoping to release the module soon but this is still a critical issue at the moment. I hope that there is a simple solution to my problem.
Best Regards,
Helgi.
Comment #5
dreamsri commentedHi,
I am used your comments but it ll not affect form actual price so please help me to fix this please very urgent and thank you.
Your Code:
$price_modifiers['my_modifer'] = array(
'#type' => ROOMS_DYNAMIC_MODIFIER,
'#op_type' => add,
'#amount' => 10,
);