Documentation
- Getting started
- Basic settings
- Pro settings
- Product settings
- Manage bookings
- Localization
- Snippets
- Action and filter hooks
- Third-party plugins
add_filter( 'easy_booking_start_text', 'wceb_custom_start_text', 10, 2 );
function wceb_custom_start_text( $text, $product = false ) {
// You have access to the $product variable (not everywhere) in case you want to display a different text for some products
$text = __( 'Your custom text', 'woocommerce-easy-booking-system' ); // Translation-ready
return $text;
}
add_filter( 'easy_booking_end_text', 'wceb_custom_end_text', 10, 2 );
function wceb_custom_end_text( $text, $product = false ) {
// You have access to the $product variable (not everywhere) in case you want to display a different text for some products
$text = __( 'Your custom text', 'woocommerce-easy-booking-system' ); // Translation-ready
return $text;
}
add_filter( 'easy_booking_get_price_suffix', 'easy_booking_custom_price_suffix', 10, 3 );
function easy_booking_custom_price_suffix( $suffix, $_product, $booking_duration ) {
$suffix = 'your custom text';
return $suffix;
}
add_filter( 'easy_booking_price_html', 'easy_booking_display_custom_price', 10, 3 );
function easy_booking_display_custom_price( $price_html, $product, $price ) {
$content = 'From ' . $price_html;
return $content;
}
add_filter( 'easy_booking_price_html', 'easy_booking_display_custom_price', 10, 3 );
function easy_booking_display_custom_price( $price_html, $product, $price ) {
$price_html .= ' your custom text';
return $price_html;
}
add_filter( 'easy_booking_select_dates_text', 'easy_booking_custom_select_dates_text', 10, 2 );
function easy_booking_custom_select_dates_text( $text, $product ) {
$text = __( 'Your custom text', 'woocommerce-easy-booking-system' );
return $text;
}
add_filter( 'easy_booking_total_booking_duration_text', 'wceb_custom_total_booking_duration_text', 10, 3 );
function wceb_custom_total_booking_duration_text( $text, $duration, $unit ) {
// $duration is the selected duration and $unit "days" or "nights"
$text = __( 'Your custom text' );
return $text;
}
add_filter( 'easy_booking_average_price_text', 'wceb_custom_average_price_text', 10, 3 );
function wceb_custom_average_price_text( $text, $product, $average_price ) {
$text = __( 'Your custom text' );
return $text;
}
add_filter( 'easy_booking_display_average_price', '__return_false' );
add_filter( 'easy_booking_product_first_available_date', 'wceb_set_date_to_next_day', 10, 2 ); function wceb_set_date_to_next_day( $first_available_date, $product ) { date_default_timezone_set( 'Europe/Paris' ); $time = date( 'H:i:s', strtotime( '12:00:00' ) ); $timenow = date( 'H:i:s', strtotime( 'now' ) ); if ( $timenow > $time ) { $first_available_date += 1; } return $first_available_date; }