WooCommerce Bookings has a form which allows your customers to choose the duration of their booking, the number of persons to book, the date and resources.
All the fields are shown in a specific order by default, which is
- Duration (if not fixed)
- Number of persons
- Resources (if not automatically assigned)
Do you need to change this order? Great, here is a snippet for you then.
Open the file functions.php located in wp-content/themes/your-theme-name/ and add this code at the end of the file:
From the line
5 it copies the default values of each field. Then from line
7 it begins to reorder the fields and returns the
array of fields using the new order.
In this example, the first field will be the calendar, the second the resource, then the duration and at last the persons field.
You can obviously change this order by moving the lines from
11 up and down as you need.
Note: This is only a basic example. If you use persons type or multiple resources the code may change.
Leave a Reply