Advertisement
Guest User

WP Travel customization

a guest
Nov 21st, 2018
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.26 KB | None | 0 0
  1.  
  2. function wp_travel_trip_price_customize( $post_id, $hide_rating = false ) {
  3.     $settings = wp_travel_get_settings();
  4.     $trip_price     = wp_travel_get_trip_price( $post_id );
  5.     $enable_sale    = get_post_meta( $post_id, 'wp_travel_enable_sale', true );
  6.     $sale_price     = wp_travel_get_trip_sale_price( $post_id );
  7.     $currency_code  = ( isset( $settings['currency'] ) ) ? $settings['currency'] : '';
  8.     $currency_symbol = wp_travel_get_currency_symbol( $currency_code );
  9.     $per_person_text = wp_travel_get_price_per_text( $post_id );
  10.     // $wp_travel_itinerary = new WP_Travel_Itinerary();
  11.     ?>
  12.     <div class="wp-detail-review-wrap">
  13.         <?php do_action( 'wp_travel_single_before_trip_price', $post_id, $hide_rating ); ?>
  14.         <div class="wp-travel-trip-detail">    
  15.         <?php if ( '' != $trip_price || '0' != $trip_price ) : ?>
  16.             <div class="trip-price" >
  17.             <?php if ( $enable_sale ) : ?>
  18.                 <del>
  19.                     <span><?php echo apply_filters( 'wp_travel_itinerary_price', sprintf( ' %s %s ', $currency_symbol, $trip_price ), $currency_symbol, $trip_price ); ?></span>
  20.                 </del>
  21.             <?php endif; ?>
  22.                 <span class="person-count">
  23.                     <ins>
  24.                         <span>
  25.                             <?php
  26.                             if ( $enable_sale ) {
  27.                                 echo apply_filters( 'wp_travel_itinerary_sale_price', sprintf( ' %s %s', $currency_symbol, $sale_price ), $currency_symbol, $sale_price );
  28.                             } else {
  29.                                 echo apply_filters( 'wp_travel_itinerary_price', sprintf( ' %s %s ', $currency_symbol, $trip_price ), $currency_symbol, $trip_price );
  30.                             }
  31.                             ?>
  32.                         </span>
  33.                     </ins>  
  34.                     / Your text                  
  35.                 </span>
  36.             </div>
  37.         <?php endif; ?>
  38.         </div>
  39.         <?php do_action( 'wp_travel_single_after_trip_price', $post_id, $hide_rating ); ?>
  40.     </div>
  41. <?php
  42. }
  43. remove_action(  'wp_travel_after_single_title', 'wp_travel_trip_price', 1 );
  44. add_action( 'wp_travel_after_single_title', 'wp_travel_trip_price_customize', 0 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement