Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
00 Days
00 Hours
00 Minutes
00 Seconds

How to Change Hours Duration Format in WooCommerce Booking & Appointment Plugin?

For those running an online service-based business, then our WooCommerce Booking & Appointment Plugin just works as a breeze to manage your bookings efficiently. However, there are some customizations that you might require to change certain aspects on the product page.

For example, while booking for a dentist appointment we can refine the duration format text to show the labels only that are necessary. In this tutorial, we will show you exactly how to modify the hour’s duration format in WooCommerce’s Booking & Appointment Plugin to better suit your business needs.

Solution: Change Hours Duration Format in WooCommerce Booking & Appointment Plugin

When using our booking plugin, it typically displays “x 1 Hour(s)” or similar text for the duration field. The code snippet will remove this text “x 1 Hour(s)” from the product page.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function bkap_hour_min_text_for_duration_field_callback(){
return '';
}
add_filter( 'bkap_hour_min_text_for_duration_field', 'bkap_hour_min_text_for_duration_field_callback' );
function bkap_hour_min_text_for_duration_field_callback(){ return ''; } add_filter( 'bkap_hour_min_text_for_duration_field', 'bkap_hour_min_text_for_duration_field_callback' );
function bkap_hour_min_text_for_duration_field_callback(){
	return '';
}
add_filter( 'bkap_hour_min_text_for_duration_field', 'bkap_hour_min_text_for_duration_field_callback' );

Output

When viewing a product that includes a duration-based booking feature, the booking plugin will display the duration field in this format as shown below.

How to Change Hours Duration Format in WooCommerce Booking & Appointment Plugin? - Tyche Softwares

The default duration field was displayed along with the additional text “x 1 Hour(s)” before the code was implemented.

How to Change Hours Duration Format in WooCommerce Booking & Appointment Plugin? - Tyche Softwares

Want to enhance this customization to the next level? Then you can try the customization that will set booking cost to 1 hour, no matter how many hours is selected by the customer.

Browse more in: Code Snippets, WooCommerce Booking & Appointment, WooCommerce How Tos

Share It:

Subscribe
Notify of


0 Comments
Newest
Oldest
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible.

Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

By using our site, you acknowledge that you have read and understood our Privacy Policy and Terms & Conditions.