Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuartduff/a1ea175d0538c8ca6d5d9d815397f03f to your computer and use it in GitHub Desktop.
Save stuartduff/a1ea175d0538c8ca6d5d9d815397f03f to your computer and use it in GitHub Desktop.
Change WooCommerce Bookings single add to cart text "Book Now"
function change_booking_single_add_to_cart_text() {
echo 'Changed Text';
}
add_filter( 'woocommerce_booking_single_add_to_cart_text','change_booking_single_add_to_cart_text' );
@datmt
Copy link

datmt commented Sep 1, 2019

Great! I found a plugin here that does the same thing https://wordpress.org/plugins/custom-add-to-cart-button-for-woocommerce/

@daisycleo
Copy link

Thank you so much @stuartduff for posting this...I realize it's been six years but it actually worked when I placed it in the functions.php file of my child theme. I'm so happy to be done with figuring that out that I created a GitHub account just to thank you 😁

@datmt Yeah and that plugin is $29/year. Or I can just get it here for free. Why would I even...

@RavanH
Copy link

RavanH commented Dec 12, 2022

A filter function should normally return a string, not echo it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment