1

I am creating an online registration form for a paid event in CiviCRM (on WordPress). We provide several kinds of accommodation (with different prices and availability).

I have figured out that I need a Price Set for things like electing specific meals.

But I have an issue to set a Price Field for the accommodation. The total price for accommodation depends on 2 thing: 1) the type of room (different price for different types), 2) number of nights. For now I have created a price field with radio buttons for every room type. But it only uses the unit price, but not multiply it by number of nights...

I have set a custom fields for arrival day and departure day, so I have the information about number of nights. But I do not know how to use it in order to automatically calculate the total price for accommodation. As the total price is shown during the registration and is send by email, I really prefer to have it calculated automatically and fully.

As as temporal dirty quick fix I can set several price fields (one for each type of room) and let the registrees to type number of nights. But it is very dirty, confusing, not dumb-proof and redundant... Any ideas?

1
  • only cludgy way we have done something similar is to set the Price Set up so it has accommodation fields for each day. then folk have to click eg Friday - Double Room / Single Room / Dormitory (where the latter are each radio buttons) then again Saturday - Double Room / etc.
    – petednz - fuzion
    Commented May 22, 2023 at 19:40

1 Answer 1

1

I don't think there is a good solution in CiviCRM that will do this for you out of the box (Webform CiviCRM would, but that's Drupal). What I would do is have your set of radio buttons to select the room type, then add a numeric field for the total accommodation price, then use JavaScript to hide or disable that numeric field and then update it when the other relevant fields change. Someone could, of course, mess with the value of the field in the console so they don't pay as much, but that's probably not that likely.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.