Filters Associated With Checkout Page

Filter : wp_travel_checkout_fields #

Source

File : /inc/form-fields.php

Used by
/inc/form-fields.php

Example :

function wp_travel_billing_form_edit_fields( $checkout_fields ) {

    unset(
        $checkout_fields['traveller_fields']['country']
    );
    return $checkout_fields;
}

add_filter('wp_travel_checkout_fields','wp_travel_billing_form_edit_fields');

Filter: wp_travel_show_pricing_label_on_name #

This filter helps to remove the price name from the checkout page and cart page.

Example :

function wp_travel_remove_price_cartpage(){
    return false;
}
add_filter('wp_travel_show_pricing_label_on_name','wp_travel_remove_price_cartpage');

Filter: wp_travel_apply_coupon_errors #

Error Message

Source

File: /core/ajax/coupon.php
Used by: /core/ajax/coupon.php, /inc/class-ajax.php

Parameters
$message

Example:

function prefix_wp_travel_apply_coupon_errors( $message ) {
    $message = ‘<p> This is an error message. </p>’;
    return $massage;
    }
add_filter( 'wp_travel_apply_coupon_errors', 'prefix_wp_travel_apply_coupon_errors' );

Filter: apply_filters( wp_travel_country_list, $countries ) #

WP Travel countries list.

Source

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

Parameters
$countries

Example:

function prefix_wp_travel_country_list( $countries ) {
    $countries[‘COUNTRY SHORT FORM’] = ‘COUNTRY NAME’;
    return $countries;
}
add_filter( 'wp_travel_country_list', 'prefix_wp_travel_country_list' );

Filter : wp_travel_checkout_traveller_fields #

WP Travel checkout travellers fields.

Source

File:/inc/form-fields.php
Used by: /inc/form-fields.php

Parameters
$traveller_fields

Example:

function prefix_wp_travel_checkout_traveller_fields( $traveller_fields ) {
    $traveller_fields[ ‘custom field’ ] = ‘value’;
    return $traveller_fields;
}
add_filter( 'wp_travel_checkout_traveller_fields', 'prefix_wp_travel_checkout_traveller_fields' );

Filter: wp_travel_checkout_billing_fields #

WP Travel checkout billing fields.

Source

File: /inc/form-fields.php
Used by: /inc/form-fields.php

Parameters
$billing_fields

Example:

function prefix_wp_travel_checkout_billing_fields( $billing_fields ) {
    $billing_fields[ ‘custom field’ ] = ‘value’;
    return $billing_fields;
}
add_filter( 'wp_travel_checkout_billing_fields', 'prefix_wp_travel_checkout_billing_fields' );

Filter: wp_travel_checkout_default_gateway #

WP Travel checkout billing fields.

Source

File: /inc/form-fields.php
Used by: /inc/form-fields.php

Parameters
$selected_gateway

Example:

function prefix_wp_travel_checkout_default_gateway( $selected_gateway ) {
    $selected_gateway = ‘paypal’;
    return $selected_gateway;
}
add_filter( 'wp_travel_checkout_default_gateway', 'prefix_wp_travel_checkout_default_gateway' );

Filter: wp_travel_get_checkout_url #

WP Travel checkout url filter.

Active Since v1.5.7

Source

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

Parameters
$url

Example:

function prefix_wp_travel_get_checkout_url( $url ) {
    $url = “PLACE URL”;
    return $url;
}
add_filter( 'wp_travel_get_checkout_url', 'prefix_wp_travel_get_checkout_url' );

Filter: wp_travel_require_all_travelers_fields #

All traveller’s fields on checkout are required or not.

Source

File: /inc/cart/checkout.php
Used by: /inc/cart/checkout.php

Parameters
Default is false.

Example:

function prefix_wp_travel_require_all_travelers_fields() {
    return true;
}
add_filter( 'wp_travel_require_all_travelers_fields', 'prefix_wp_travel_require_all_travelers_fields' );

Filter: wp_travel_hide_mini_cart_on_checkout #

Hide mini cart on checkout or not.

Active Since v4.0.7

Source

File: /inc/cart/class-checkout.php
Used by: /inc/cart/class-checkout.php

Parameters
Default is false.

Example:

function prefix_wp_travel_hide_mini_cart_on_checkout() {
    return true;
}
add_filter( 'wp_travel_hide_mini_cart_on_checkout', 'prefix_wp_travel_hide_mini_cart_on_checkout' );