Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function travel_log_child_formatted_currency( $currency_trip_price, $currency_symbol, $trip_price ){
- global $post;
- $post_id = $post->ID;
- if ( wp_travel_is_cart_page() ) {
- if ( isset( $_REQUEST['trip_id'] ) && '' != $_REQUEST['trip_id'] ) {
- $post_id = $_REQUEST['trip_id'];
- }
- }
- $trip_price = number_format( $trip_price, 2 );
- $enable_sale = get_post_meta( $post_id, 'wp_travel_enable_sale', true );
- $sale_price = number_format( wp_travel_get_trip_sale_price( $post_id ), 2 );
- $currency_code = ( isset( $settings['currency'] ) ) ? $settings['currency'] : '';
- $currency_symbol = wp_travel_get_currency_symbol( $currency_code );
- return sprintf( ' %s %s ', $currency_symbol, $trip_price );
- }
- add_filter( 'wp_travel_itinerary_sale_price', 'travel_log_child_formatted_currency', 10, 3);
- add_filter( 'wp_travel_itinerary_price', 'travel_log_child_formatted_currency', 10, 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__(' %1s %2s', 'wp-travel' ), number_format( $d , 2 ), $c );
- // return $s;
- }
- return sprintf( esc_html__('%1s %2s', 'wp-travel' ), number_format( $d , 2 ), $c );
- }
- add_filter( 'wp_travel_itinerary_price', 'wp_travel_customize_price_display', 99, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement