- This topic has 9 replies, 3 voices, and was last updated 4 years, 6 months ago by
Support Team.
- AuthorPosts
- November 20, 2018 at 1:28 pm #8517
Jacky
ParticipantHello, I would like to change the /person text to something else, is that possible?
November 21, 2018 at 6:17 am #8520Jacky
ParticipantI really need help on this urgently
November 21, 2018 at 6:27 am #8521WP Travel Admin
KeymasterHello @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.
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!!
November 21, 2018 at 6:42 am #8523Jacky
ParticipantThank 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?
November 21, 2018 at 6:51 am #8526Jacky
ParticipantI would also be happy to remove that text completely
November 21, 2018 at 7:04 am #8528Support Team
KeymasterHello @jacky,
The code works perfectly fine in our side as you can see in the below given screenshots:
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!!
November 21, 2018 at 7:36 am #8530Jacky
ParticipantI pasted the code in my child theme’s functions.php, is this correct?
November 21, 2018 at 8:05 am #8532Support Team
KeymasterHello @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!!
November 21, 2018 at 10:11 am #8534Jacky
ParticipantThis 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 );November 22, 2018 at 8:02 am #8536Support Team
KeymasterHello @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 :
Thank you.
Regards!!
- AuthorPosts
- The forum ‘WP Travel’ is closed to new topics and replies.