Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
Days
Hours
Minutes
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.

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