WP Travel plugin offers flexibility in setting pricing models for your trips β€” such as per person or per group. However, if you’d like to add a custom pricing unit (e.g., per room or per vehicle), WP Travel allows this through a simple filter hook.

How to Add Room as Price Per Option Under Pricing Category?

To add another option as a Price Per optionΒ under the pricing category, please add the following filter given code inΒ theΒ functions.phpΒ file of your child theme or simply you can add it throughΒ code snippets.

function example_callback( $example ) {
    return  array(
        array(
            'label' => __( 'Person', 'wp-travel' ),
            'value' => 'person',
        ),
        array(
            'label' => __( 'Group', 'wp-travel' ),
            'value' => 'group',
        ),
        array(
            'label' => __( 'Example', 'wp-travel' ),
            'value' => 'example',
        )
    );
}
add_filter( 'wp_travel_trip_price_per', 'example_callback' );

For Example: As an example let’s add a Room as the pricing option.

To add a “Room” as a Price Per option under the pricing category, please add the following filter given code in the functions.php file of your child theme.

function example_callback( $example ) {
    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' );

For detailed information regarding “how to create a child theme?”

Kindly, please refer to the Knowledge base to be clear more precisely,

After adding the Filter code:

How to Add Room as Price Per Option Under Pricing Category?

So, in this way, you can add another option as Price Per Option Under Pricing Category successfully

Also, if you want to learn more about the filter hook that is associated with the pricing, please refer specific hook page.

Check the WP Travel documentation to learn more about configurations, modules, payments, and shortcodes.

Your feedback helps us improve. Feel free to share your thoughts!

Need assistance? Contact our support team, join our Facebook community, and subscribe to our YouTube Channel for video tutorials.

You can also find us on Facebook, Instagram, LinkedIn, TikTok, and X. Thank you for choosing WP Travel.

If you are a WP Travel Free user thinking about upgrading to Pro, simply click on the banner below.

Get WP Travel Pro