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

How to Remove ‘No of Days’ and ‘Price Per Day’ from Cart & Checkout Page in WooCommerce Booking and Appointment Plugin?

The default behavior of our WooCommerce Booking and Appointment Plugin will display all relevant booking details such as showing “No. of Days” and “Per Day Price” associated with each booking item on the cart and checkout pages. But with some customizations, we can also refine how booking information is presented to customers on these pages.

This customization will hide detailed booking specifics like the number of days and the per-day price from the Cart and Checkout pages. Let’s see how to make these pages more user friendly by showcasing only the important details that allows customers to quickly confirm their bookings without unnecessary distractions.

Solution: Remove Booking ‘No of Days’ and ‘Price Per Day’ from Cart & Checkout Page in WooCommerce Booking and Appointment Plugin

This code snippet modifies the information displayed on the cart and checkout pages of WooCommerce removing information such as “No. of Days” and “Per Day Price” associated with each booking item.

/**
 * Remove No. of Days and Price per day from Cart and Checkout page.
 * 
 * @param array $other_data Array of Other data.
 * @param array $cart_item Array value of Cart Item.
 */
function bkap_get_item_data_callback( $other_data, $cart_item ) {

	foreach ($other_data as $key => $value) {
		if ( __( 'No. of Days', 'woocommerce-booking' ) == $value['name'] ) {
			unset( $other_data[$key] );
		}

		if ( __( 'Per Day Price', 'woocommerce-booking' ) == $value['name'] ) {
			unset( $other_data[$key] );
		}
	}
	return $other_data;
}
add_filter( 'bkap_get_item_data', 'bkap_get_item_data_callback', 10, 2 );

Output

Once customer has done with the booking and proceeds to cart page, the additional details of booking such as number of days and price per day details will be removed from the booking details section.

How to Remove ‘No of Days’ and ‘Price Per Day’ from Cart & Checkout Page in WooCommerce Booking and Appointment Plugin? - Tyche Softwares

The code also ensures that the additional booking details are hidden on checkout page as well.

How to Remove ‘No of Days’ and ‘Price Per Day’ from Cart & Checkout Page in WooCommerce Booking and Appointment Plugin? - Tyche Softwares

When the code snippet is not implemented, the booking details will show the ‘No of Days’ and ‘Per Day Price’ text on the cart and checkout pages.

How to Remove ‘No of Days’ and ‘Price Per Day’ from Cart & Checkout Page in WooCommerce Booking and Appointment Plugin? - Tyche Softwares
How to Remove ‘No of Days’ and ‘Price Per Day’ from Cart & Checkout Page in WooCommerce Booking and Appointment Plugin? - Tyche Softwares

Similar to this customization, you can also enhance user experience by hiding booking details in WooCommerce order emails. Such customization helps customers to see simplified booking information not only on checkout and cart pages but also in order emails.

Browse more in: Code Snippets, WooCommerce Booking & Appointment

Share It:

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