Search Documentation

WP Travel User Documentation

  1. Home
  2. Docs
  3. WP Travel User Documentation
  4. Support Queries
  5. How to change display pattern of the price?

How to change display pattern of the price?

If you want to change the display pattern of the price then please add below given code in your child theme functions.php file.

function wp_travel_customize_price_display( $s, $c, $d ) {
  global $wp_travel_itinerary;
  if ( $wp_travel_itinerary->is_sale_enabled() ) {
    return $s;
  }
  return sprintf( esc_html__('Starting from %1s %2s', 'wp-travel' ), $d, $c );
}
add_filter( 'wp_travel_itinerary_price', 'wp_travel_customize_price_display', 99, 3 );


function wp_travel_customize_sale_price_display( $s, $c, $d ) {
  return  sprintf( esc_html__('Starting from %1s %2s', 'wp-travel' ), $d, $c );
}
add_filter( 'wp_travel_itinerary_sale_price', 'wp_travel_customize_sale_price_display', 99, 3 );

Default pattern:

Pattern after adding code.

You can change the text and placement of currency from the code provided above.

Was this article helpful to you? Yes No

How can we help?