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

How to Customize Select Resource Text for Specific Products on Shop Page in Booking & Appointment Plugin?

The resource setting feature available in our WooCommerce Booking and Appointment plugin will let store owners manage the resources required for their bookable products or services. But at times the text select resource may sometimes confuse customers or lack clarity. And to address this we have a solution where you can customize the generic select resource text according to the products/services you offer.

For example, if you run a wellness clinic that offers various types of doctor consultations, you can customize this text “Choose Your Doctor” to make the booking process user-friendly for your customers.

Solution: Customize Select Resource Text for Specific Products on Shop Page with Booking & Appointment Plugin

This code snippet customizes the ‘Select Resource’ text of specific products on the shop page when using the Booking and Appointment plugin.

/**
 * Changing the Select Resource Text on the Shop page for list of products
 * 
 * @param string $text Select Resource Text.
 * @param int $product_id Product ID
 * 
 * @return string
 */
function bkap_change_select_resource_text_callback( $text, $product_id ) {

    $ids = array( 123, 456, 789 ); // Product ids of resource product for which you want to change the text. 
    if ( in_array( $product_id, $ids ) ) {
        $text = __( 'Choose Your Doctor', 'woocommerce-booking' );
    }

    return $text;
}
add_filter( 'bkap_change_select_resource_text', 'bkap_change_select_resource_text_callback', 10, 2 );

Output

When customers visit the shop page for products/services that have enabled the resources option from the backend, they will see the ‘Select Resource’ text displayed on the frontend. The code snippet modifies this text, changing it to ‘Choose Your Doctor’ or any other specified text as defined in the code.

How to Customize Select Resource Text for Specific Products on Shop Page in Booking & Appointment Plugin? - Tyche Softwares

This is how the default text for resource-added products was represented before implementing the code.

How to Customize Select Resource Text for Specific Products on Shop Page in Booking & Appointment Plugin? - Tyche Softwares

If you’re interested in enhancing user interface elements further, consider exploring the customization options available, such as removing Bookings from the customer’s My Account page. These customizations ensure that only essential and expected elements are displayed on the frontend.

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

Share It:

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