Skip to content

Instantly share code, notes, and snippets.

@MindyPostoff
Last active June 15, 2021 21:58
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save MindyPostoff/c70dc98a099a9bf1c2f0 to your computer and use it in GitHub Desktop.
Save MindyPostoff/c70dc98a099a9bf1c2f0 to your computer and use it in GitHub Desktop.
Reorder Display of Fields on WooCommerce Bookings Form
/**
* A function to reorder the default display of fields on the WooCommerce Bookings form
* Put this function in your theme's functions.php file
*/
function custom_order_booking_fields ( $fields ) {
$reorder = array();
$reorder[] = $fields['wc_bookings_field_duration']; // Duration
$reorder[] = $fields['wc_bookings_field_resource']; // Resource
$reorder[] = $fields['wc_bookings_field_persons']; // Persons
$reorder[] = $fields['wc_bookings_field_start_date']; // Calendar or Start Date
return $reorder;
}
add_filter( 'booking_form_fields', 'custom_order_booking_fields');
@lp-ben
Copy link

lp-ben commented Jun 15, 2021

@TomasHurtz I tried that and it looked correct but gave an error saying "The minimum persons per group is 1" even when it was checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment