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

How to Change the ‘Number of Days’ and ‘Price per Day’ Text on the Cart & Checkout Page with WooCommerce Booking and Appointment Plugin?

If you are using our Booking and Appointment Plugin for WooCommerce, the dafault labels such as “Number of days selected” and ‘Price per Day’ is displayed on the booking form after the customer has chosen their booking dates. However, you don’t have to stick with the default text provided by the plugin.

With these simple customizations, you can change it to the text that is easily understandable and relatable to your customers. We’ve already covered how to change the number of selected days on the booking product page. Now, we’ll show you how to customize the text displayed on the cart and checkout pages.

Solution: Change the Number of Days and Price per Day Text on the Cart & Checkout Page

Imagine a business that handles booking hotels using the WooCommerce Booking and Appointment Plugin, which by default shows “No. of Days” and “Per Day Price” on the cart and checkout pages. To make the booking details more relevant and much clearer for customers, you can customize the text to “Nights selected” and “Price Per Night” using the following code:

function bkap_get_item_data_callback( $other_data, $cart_item ) {

	$new_data = $other_data;

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

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

Output

The above code has changed the text to ‘Nights selected’ and ‘Price Per Night’ on the cart page which is more relevant and understandable to customers booking for hotel stays.

How to Change the 'Number of Days' and 'Price per Day' Text on the Cart & Checkout Page with WooCommerce Booking and Appointment Plugin? - Tyche Softwares

The same modified text will also be displayed on the checkout page as shown below.

How to Change the 'Number of Days' and 'Price per Day' Text on the Cart & Checkout Page with WooCommerce Booking and Appointment Plugin? - Tyche Softwares

In addition to customizing the text options on the cart and checkout page, you can also display Price Ă— Number of Days Calculation in Cart and Checkout Pages, which helps customers quickly verify the booking cost so that they are more convinced to proceed and complete the booking process.

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
Launch Alert: Flexi BOGO for WooCommerce! Create irresistible holiday discount sales with ease.Learn more
0
Would love your thoughts, please comment.x
()
x