Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function travel_log_child_formatted_currency(){
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( wp_travel_get_trip_price( $post_id ), 2 );
$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 );
return sprintf( ' %s %s ', $currency_symbol, $trip_price );
}
add_filter( 'wp_travel_itinerary_price', 'travel_log_child_formatted_currency' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment