Restrict bookings to the child category when no adult category is selected, which facilitates efficient booking management for family-oriented services or events.

Understanding how to navigate this scenario can smooth processes, ensure compliance, and enhance the overall user experience.

WP Travel is a complete booking package for making customized travel agency or tour operator websites on WordPress in minutes.

On the other hand, WP Travel Pro is an enhanced version of the plugin that offers additional functionalities, including adding multiple categories to a single price for a trip.

For example, you can add different prices for adults and children, reflecting the varying costs associated with each category.

However, you can achieve the restriction on bookings when only the ‘child’ category is selected by using additional JavaScript code.

Unlock exclusive child booking with adult inclusion

To control the booking process, you can follow the steps provided below:

1. Install and activate the Simple Custom CSS and JS plugin.

The Simple Custom CSS and JS plugin allows you to add custom CSS or JavaScript code snippets to your website. With just a few clicks, enhance your site’s design and functionality by implementing tailored styles.

2. Activate Plugin for Custom JS & CSS Settings

3. Implement Custom JavaScript Code

jQuery(function($) {
   $(document).on( 'click', '.edit-pax-selector-qty', function(){
       var getAdultInputValue = $('.wp-travel-booking__trip-option-list li:first-child .text-right .pricing-area .qty-spinner input' ).val();
       if( getAdultInputValue < 1 ){
           $('.wp-travel-book').addClass( 'btn-disable' );
           $('.wp-travel-book').removeClass( 'btn-disable' );
   } );

4. Save Changes for Automatic JavaScript Execution

The ‘Book Now’ button at the footer will be disabled if only the child category is selected.

Unlock exclusive child booking with adult inclusion

To proceed with a booking, at least one adult must be selected with a child. This is due to the JS code added, which restricts bookings when only the ‘child’ category is selected.

Unlock exclusive child booking with adult inclusion

Restricting bookings to the child category when no adult selection is made ensures streamlined booking processes and enhances the user experience.

By leveraging this approach, businesses can effectively cater to family-oriented demographics while maintaining clarity and efficiency in their booking systems.

If you liked this article, subscribing to our YouTube Channel for WordPress video tutorials would be the cherry on top.

You can also find us on FacebookInstagram, Twitter, LinkedInTikTokPinterest, and our dedicated, engaging Facebook user community.

Further, if you have any queries, please submit them to our contact page.

Get WP Travel Pro and start creating your travel and tour booking website within minutes without any hassle of coding.