Documentation

Ajoutez ces extraits de code au fichier functions.php de votre thème enfant, ou utilisez une extension comme Code snippets. N’ajoutez pas de code directement au fichier functions.php de votre thème parent car il serait écrasé par les mises à jour. Personnalisez les textes en rouge comme bon vous semble.

Modifier les textes « Début » et « Fin »

add_filter( 'easy_booking_start_text', 'wceb_custom_start_text', 10, 2 );

function wceb_custom_start_text( $text, $product = false ) {
    $text = __( 'Your custom text', 'woocommerce-easy-booking-system' );
    return $text;
}
add_filter( 'easy_booking_end_text', 'wceb_custom_end_text', 10, 2 );

function wceb_custom_end_text( $text, $product = false ) {
    $text = __( 'Your custom text', 'woocommerce-easy-booking-system' );
    return $text;
}

Modifier le texte  » / jour »

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;
}

Ajouter du texte avant  » / jour »

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;
}

Ajouter du texte après  » / jour »

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;
}

Modifier le texte « Sélectionner date(s) »

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;
}

Modifier le texte « Durée totale de réservation »

add_filter( 'easy_booking_total_booking_duration_text', 'wceb_custom_total_booking_duration_text', 10, 3 );

// $duration is the selected duration and $unit "days" or "nights"
function wceb_custom_total_booking_duration_text( $text, $duration, $unit ) {
    $text = __( 'Your custom text', 'woocommerce-easy-booking-system' );
    return $text;
}

Modifier le texte « Prix moyen »

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', 'woocommerce-easy-booking-system' );
    return $text;
}

Supprimer le texte « Prix moyen »

add_filter( 'easy_booking_display_average_price', '__return_false', 99 );