Change per person text

Homepage Forums WP Travel Change per person text

This topic contains 9 replies, has 3 voices, and was last updated by  Support Team 12 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #8517

    Jacky
    Participant

    Hello, I would like to change the /person text to something else, is that possible?

    #8520

    Jacky
    Participant

    I really need help on this urgently

    #8521

    WP Travel Admin
    Keymaster

    Hello @jacky,

    We would like to apologize for the delay in the response.

    To change the text as per your requirement in the “/ person” filed, please add below given code.

    https://pastebin.com/rAnXWmEi

    In the line no: 34 replace “Your text” with your desired text.

    Hope this helps.

    Let us know if you have any confusion further.

    Thank you.

    Regards!!

    #8523

    Jacky
    Participant

    Thank you so much but it didnt work, my text is still saying La personne.

    It is possible someone changed it somewhere else but I don’t know where

    http://dev.shiftone.co.za/satravel/

    Also, I pasted the code in my child theme’s functions.php, is this correct?

    • This reply was modified 12 months ago by  Jacky.
    #8526

    Jacky
    Participant

    I would also be happy to remove that text completely

    #8528

    Support Team
    Keymaster

    Hello @jacky,

    The code works perfectly fine in our side as you can see in the below given screenshots:

    https://prnt.sc/ll025p

    If you want to completely remove it then please remove the text in line no: 34 from the code provided above so that it won’t display any text.

    Thank you.

    Regards!!

    #8530

    Jacky
    Participant

    I pasted the code in my child theme’s functions.php, is this correct?

    #8532

    Support Team
    Keymaster

    Hello @jacky,

    Yes please do paste the code that we have provided above in your child theme functions.php and verify whether it works or not?

    Thank you.

    Regards!!

    #8534

    Jacky
    Participant

    This is the code I currently have in my functions.php, is it clashing maybe?

    function wp_travel_customize_sale_price_display( $s, $c, $d ) {
    return sprintf( esc_html__(‘Prix à partir de %1s %2s’, ‘wp-travel’ ), $c , $d );
    }
    add_filter( ‘wp_travel_itinerary_sale_price’, ‘wp_travel_customize_sale_price_display’, 99, 3 );
    function wp_travel_customize_price_display( $s, $c, $d ) {
    global $wp_travel_itinerary;
    if ( $wp_travel_itinerary && $wp_travel_itinerary->is_sale_enabled() ) {
    return sprintf( esc_html__(‘Prix à partir de %1s %2s’, ‘wp-travel’ ), $c , $d );
    // return $s;
    }
    return sprintf( esc_html__(‘Prix à partir de %1s %2s’, ‘wp-travel’ ), $c , $d );
    }
    add_filter( ‘wp_travel_itinerary_price’, ‘wp_travel_customize_price_display’, 99, 3 );

    function wp_travel_trip_price_customize( $post_id, $hide_rating = false ) {
    $settings = wp_travel_get_settings();
    $trip_price = wp_travel_get_trip_price( $post_id );
    $enable_sale = get_post_meta( $post_id, ‘wp_travel_enable_sale’, true );
    $sale_price = wp_travel_get_trip_sale_price( $post_id );
    $currency_code = ( isset( $settings[‘currency’] ) ) ? $settings[‘currency’] : ”;
    $currency_symbol = wp_travel_get_currency_symbol( $currency_code );
    $per_person_text = wp_travel_get_price_per_text( $post_id );
    // $wp_travel_itinerary = new WP_Travel_Itinerary();
    ?>
    <div class=”wp-detail-review-wrap”>
    <?php do_action( ‘wp_travel_single_before_trip_price’, $post_id, $hide_rating ); ?>
    <div class=”wp-travel-trip-detail”>
    <?php if ( ” != $trip_price || ‘0’ != $trip_price ) : ?>
    <div class=”trip-price” >
    <?php if ( $enable_sale ) : ?>

    <span><?php echo apply_filters( ‘wp_travel_itinerary_price’, sprintf( ‘ %s %s ‘, $currency_symbol, $trip_price ), $currency_symbol, $trip_price ); ?></span>

    <?php endif; ?>
    <span class=”person-count”>
    <ins>
    <span>
    <?php
    if ( $enable_sale ) {
    echo apply_filters( ‘wp_travel_itinerary_sale_price’, sprintf( ‘ %s %s’, $currency_symbol, $sale_price ), $currency_symbol, $sale_price );
    } else {
    echo apply_filters( ‘wp_travel_itinerary_price’, sprintf( ‘ %s %s ‘, $currency_symbol, $trip_price ), $currency_symbol, $trip_price );
    }
    ?>
    </span>
    </ins>
    Personne
    </span>
    </div>
    <?php endif; ?>
    </div>
    <?php do_action( ‘wp_travel_single_after_trip_price’, $post_id, $hide_rating ); ?>
    </div>
    <?php
    }
    remove_action( ‘wp_travel_after_single_title’, ‘wp_travel_trip_price’, 1 );
    add_action( ‘wp_travel_after_single_title’, ‘wp_travel_trip_price_customize’, 0 );

    #8536

    Support Team
    Keymaster

    Hello @jacky,

    Please remove the block of code mentioned below that you have pasted.

    function wp_travel_trip_price_customize( $post_id, $hide_rating = false ) {
    $settings = wp_travel_get_settings();
    $trip_price = wp_travel_get_trip_price( $post_id );
    $enable_sale = get_post_meta( $post_id, ‘wp_travel_enable_sale’, true );
    $sale_price = wp_travel_get_trip_sale_price( $post_id );
    $currency_code = ( isset( $settings[‘currency’] ) ) ? $settings[‘currency’] : ”;
    $currency_symbol = wp_travel_get_currency_symbol( $currency_code );
    $per_person_text = wp_travel_get_price_per_text( $post_id );
    // $wp_travel_itinerary = new WP_Travel_Itinerary();
    ?>
    <div class=”wp-detail-review-wrap”>
    <?php do_action( ‘wp_travel_single_before_trip_price’, $post_id, $hide_rating ); ?>
    <div class=”wp-travel-trip-detail”>
    <?php if ( ” != $trip_price || ‘0’ != $trip_price ) : ?>
    <div class=”trip-price” >
    <?php if ( $enable_sale ) : ?>
    
    <span><?php echo apply_filters( ‘wp_travel_itinerary_price’, sprintf( ‘ %s %s ‘, $currency_symbol, $trip_price ), $currency_symbol, $trip_price ); ?></span>
    
    <?php endif; ?>
    <span class=”person-count”>
    <ins>
    <span>
    <?php
    if ( $enable_sale ) {
    echo apply_filters( ‘wp_travel_itinerary_sale_price’, sprintf( ‘ %s %s’, $currency_symbol, $sale_price ), $currency_symbol, $sale_price );
    } else {
    echo apply_filters( ‘wp_travel_itinerary_price’, sprintf( ‘ %s %s ‘, $currency_symbol, $trip_price ), $currency_symbol, $trip_price );
    }
    ?>
    </span>
    </ins>
    Personne
    </span>
    </div>
    <?php endif; ?>
    </div>
    <?php do_action( ‘wp_travel_single_after_trip_price’, $post_id, $hide_rating ); ?>
    </div>
    <?php
    }
    remove_action( ‘wp_travel_after_single_title’, ‘wp_travel_trip_price’, 1 );
    add_action( ‘wp_travel_after_single_title’, ‘wp_travel_trip_price_customize’, 0 );

    And paste the code that we have provided above which is :

    https://pastebin.com/rAnXWmEi

    Thank you.

    Regards!!

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.