Filter Associated With Pricing

Filter: wp_travel_variation_pricing_options #

WP Travel pricing variation options like adult, child etc.

Source

File: /inc/helpers.php
Used by: /inc/helpers.php

Parameters
$variation_options

Example:

function prefix_wp_travel_variation_pricing_options() {
    $variation_options[‘organization’] = ‘__( ‘Organization’,
    ‘wp-travel’ )’;
    return $variation_options;
}
add_filter( 'wp_travel_variation_pricing_options', 'prefix_wp_travel_variation_pricing_options' );

Filter: wp_travel_show_pricing_lable_on_name #

WP Travel show pricing label filter.

Active Since v4.3.1

Source

File: /inc/helpers.php
Used by: /inc/helpers.php

Parameters
Default is true.

Example:

function prefix_wp_travel_show_pricing_lable_on_name() {
    return false;
}
add_filter( 'wp_travel_show_pricing_lable_on_name', 'prefix_wp_travel_show_pricing_lable_on_name' );

Filter: wp_travel_pricing_option_listing_type #

WP Travel pricing option listing type.

Source

File: /inc/helpers.php
Used by: /inc/helpers.php

Parameters
$list_type. Default is ‘by-pricing-option’.

Example:

function prefix_wp_travel_pricing_option_listing_type( $list_type ) {
    $list_type = ‘LIST BY TYPE’;
    return $list_type;
}
add_filter( 'wp_travel_pricing_option_listing_type', 'prefix_wp_travel_pricing_option_listing_type' );

Filter: wp_travel_post_filter_by_price #

Enable post filter by price.

Source

File: /inc/template-functions.php
Used by: /inc/template-functions.php

Parameters
Default is true.

Example:

function prefix_wp_travel_post_filter_by_price() {
    return false;
}
add_filter( 'wp_travel_post_filter_by_price', 'prefix_wp_travel_post_filter_by_price' );

Filter: wp_travel_pricing_max_pax #

Maximum pax of pricing.

Source

File: /inc/template-functions.php
Used by: /inc/template-functions.php

Parameters
$max_pax, $pricing_id

Example:

function prefix_wp_travel_pricing_max_pax( $max_pax, $pricing_id ) {
    if ( ‘PRICING ID’ === $pricing_id ) {
    $max_pax = 5;
    }
    return $max_pax;
}
add_filter( 'wp_travel_pricing_max_pax', 'prefix_wp_travel_pricing_max_pax', 12, 2 );

Filter: wp_travel_pricing_min_pax #

Minimum pax of pricing.

Source

File: /inc/template-functions.php
Used by: /inc/template-functions.php

Parameters
$min_pax, $pricing_id

Example:

function prefix_wp_travel_pricing_min_pax( $min_pax, $pricing_id ) {
    if ( ‘PRICING ID’ === $pricing_id ) {
    $min_pax = 2;
    }
    return $min_pax;
}
add_filter( 'wp_travel_pricing_min_pax', 'prefix_wp_travel_pricing_min_pax', 12, 2 );

Filter: wp_travel_pricing_pax_step #

Pricing pax step increase.

Source

File: /inc/template-functions.php
Used by: /inc/template-functions.php

Parameters
Default step is 1, $pricing_id

Example:

function prefix_wp_travel_pricing_pax_step() {
    return 2;
}
add_filter( 'wp_travel_pricing_pax_step', 'prefix_wp_travel_pricing_pax_step' );

Filter: wp_travel_pricing_option_list #

WP Travel pricing option list.

Source
File: /inc/admin/admin-helper.php
Used by: /inc/admin/admin-helper.php

Parameters
$type

Example:

function prefix_wp_travel_pricing_option_list( $type ) {
    $type[‘custom-price’] = __( ‘Custom Price’, ‘wp-travel’ );
    return $type;
}
add_filter( 'wp_travel_pricing_option_list', 'prefix_wp_travel_pricing_option_list' );

Filter: wp_travel_price_per_fields #

Filter for adding price per fields options.

Active Since v1.0.5

Source

File: /inc/helpers/helpers-price.php
Used by: /inc/helpers/helpers-price.php

Parameters
$price_per

Example:

function prefix_wp_travel_price_per_fields( $price_per ) {
    $price_per[‘couple’] = __( ‘Couple’, ‘wp-travel’ );
    return $price_per;
}
add_filter( 'wp_travel_price_per_fields', 'prefix_wp_travel_price_per_fields' );

For adding room price per field option ( Active Since WP Travel v7.3.0)

function example_callback( $example ) {
    // Maybe modify $example in some way.
    return  array(
        array(
            'label' => __( 'Person', 'wp-travel' ),
            'value' => 'person',
        ),
        array(
            'label' => __( 'Group', 'wp-travel' ),
            'value' => 'group',
        ),
        array(
            'label' => __( 'Room', 'wp-travel' ),
            'value' => 'room',
        )
    );
}
add_filter( 'wp_travel_trip_price_per', 'example_callback' );

Filter: wp_travel_enable_sale #

Is sale enabled or not filter.

Active Since v2.0.5

Source

File: /inc/helpers/trips.php
Used by: /inc/helpers/trips.php

Parameters
$enable_sale, $post_id, $pricing_options, $price_key

Example:

function prefix_wp_travel_enable_sale( $enable_sale, $post_id, $pricing_options, $price_key ) {
    if ( ‘100’ === $post_id ) {
    $enable_sale = false;
    } else {
    $enable_sale = true;
    }
    return $enable_sale;
}
add_filter( 'wp_travel_enable_sale', 'prefix_wp_travel_enable_sale', 12, 4 );

Filter: wp_travel_price #

WP Travel price filter.

Source

File: /inc/helpers/trips.php
Used by: /inc/helpers/trips.php

Parameters
$sale_price

Example:

function prefix_wp_travel_price( $sale_price ) {
    if ( $sale_price > 100 ) {
    $sale_price = $sale_price - (0.1 * $sale_price);
    }
    return $sale_price;
}
add_filter( 'wp_travel_price', 'prefix_wp_travel_price' );

Filter: wp_travel_convert_price #

Trip convert price according to currency selected. Supports multiple currencies.

Active Since v4.0.7

Source

File: /inc/helpers/helpers-price.php
Used by: /inc/helpers/helpers-price.php

Parameters
$price

Example:

function prefix_wp_travel_convert_price( $price ) {
    $price = ‘CUSTOM PRICE’;
    return $price;
}
add_filter( 'wp_travel_convert_price', 'prefix_wp_travel_convert_price' );

Filter: wptravel_get_price #

Hook to Modify the existing price. You can use this filter to modify your price.

Active Since v4.6.4

Source
File: core/helpers/pricings.php
Method/Function: get_price

Parameters
$price (Price of the trips)
$args (Array of data which consists of values (trip_id (required), is_regular_price, pricing_id, category_id, price_key ))

Example:

function wptravel_customized_price( $price, $args ) {
   // Your price alter code here.
   return $price; // This return value is modified price.
}
add_filter( 'wptravel_get_price', 'wptravel_customized_price' );