Jet Appointments - Adults & Children Inputs
jet-appointments-adults-children-inputs
by Crocoblock · github.com/mjhead/jet-appointments-adults-children-inputs
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/mjhead/jet-appointments-adults-children-inputs/archive/refs/heads/main.zipJetAppointmentsBooking. Allow Adults & Children fields in the appointment form
This plugin allows you to add seprate fields for Adults count and Children count and book total number of slots by the sum of values in these 2 fields.
Result example:
How it works:
- This plugin is JetAppointmentsBooking addon, so first of all you need JetAppointmentsBooking plugin installed.
- Also it supports only JetFormBuilder (not JetEngine legacy forms), so also you need JetFormBuilder plugin installed.
- Separate fields for adults and children means single time slot could be booked multiple times. So you need to enable Manage Capacity option of JetAppointmentsBooking plugin. Also you need option User Can Manage Booked Capacity to be disabled, because you'll manage capacity with adults and children fields.
- You need to add Adults and Children fields into the form manually. Optionally you can put them int the conditional block and show only user will select the slot in the calendar.
- The last thing - you need to specify 4 properties to connect form and this addon - Adults field, Children field, Price per adult, Price per child. More detailed instructions on this below.
Setting up the plugin properties
You can set up the plugin properies in the 2 ways
- Manually, by changing default values directly in the code of the plugin before or after installing it on your website. Here is the place where you need to change them - https://github.com/MjHead/jet-appointments-adults-children-inputs/blob/main/jet-appointments-adults-children-inputs.php#L33-L40
- Or by setting up WordPress options - 'jet_apb_ac_adults_field', 'jet_apb_ac_children_field', 'jet_apb_ac_adults_price', 'jet_apb_ac_children_price'
To manage this with WordPress options you can create JetEngine Option Page. Here is the setup of the page
And the result
The important thing here are:
- Slug of the page must be exactly
jet_apb_ac - Fields storage type must be set to
Separate - Add prefix for separate options must be enabled
- Fields slugs must be exactly -
adults_field,children_field,adults_price,children_price
Price setup
Separate options for the price are needed to make this part compatible with WooCommerce integration of JetAppointmentsBooking and set correct price for the checkout. If you need to show total price in the form, you can use Calculated field and add these values directly into it, for example like this:
And the result