I have the following use case flow.
Step 1 User visits the site select a rental house (starting the site with only 1).
Step 2 After the house is selected a menu item must become visible with the option to book the house and to enter the weeks to stay at the house. Two dates one of the arrival and one for the departure week.

I have the following content type:

  • rental house (text, pictures)
  • booking (all personal details, bank account city etc.) booking has an entity reference field with the rental house
  • weeks with weeknr, price and status of the week (such as booked)

After the hook save action of the booking the relation with the rental house must be made. With only 1 house it can be omitted of course. So after the hook_save action of contenttype booking some magic must be done but how? I can't find good example code. To fill in the field by the user is a bit ugly since he already selected the house in step 1.

Thanks in advance
John

Comments

Entityreference prepopulate

http://drupal.org/project/entityreference_prepopulate

Maybe that module can help?

For node reference:
http://drupal.org/project/nodereference_url
Node Reference URL Widget

Entity reference prepopulate

It took me a while to get to the usage of the prepopulate module.
I find out that I must use node/add/booking?field_rental_house=5. The link must be a menu item. For instance left to the rental house fields.
Then the reference is done correctly. But how can I make this dynamic. The number 5 can change of course.

John

Thanks,
John

You may want to look at Rooms

You may want to look at Rooms or Resource booking modules.

Rooms

Hi,

I am only want to rent one or a few houses for whole weeks only see my design at

I have created a draft desing http://members.chello.nl/jophof/D7/drupal_rentaldesign.jpg

John

Thanks,
John