Skip to content

Instantly share code, notes, and snippets.

@WillBrubaker
Last active August 2, 2016 02:56
Show Gist options
  • Save WillBrubaker/21a245e0e0ee7e006202 to your computer and use it in GitHub Desktop.
Save WillBrubaker/21a245e0e0ee7e006202 to your computer and use it in GitHub Desktop.
Change WooCommerce Booking Duration Label
add_filter( 'booking_form_fields', 'wooninja_booking_form_fields' );
function wooninja_booking_form_fields( $fields ) {
//Changes the text 'Day(s)' to 'Night(s)'
$fields['wc_bookings_field_duration']['after'] = str_replace( 'Day(s)', 'Night(s)', $fields['wc_bookings_field_duration']['after'] );
return $fields;
}
@cdeferrari
Copy link

Sir, i need help please.
Do you know how can i force and replace the Duration input to a select field that only accept 1,4,8 (days).
In the configuration i have 1 day min, 8 days max, but i want customers be forced to choose only between 1,4,8 . I need really to hardcode this. I find this the best way to do it.
Thanks!

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