Skip to content

Instantly share code, notes, and snippets.

@WillBrubaker
Created May 19, 2015 13:58
Show Gist options
  • Save WillBrubaker/154cec18cd060246d9a8 to your computer and use it in GitHub Desktop.
Save WillBrubaker/154cec18cd060246d9a8 to your computer and use it in GitHub Desktop.
Conditionally change 'read more' to 'book now' if a bookable product
add_filter( 'woocommerce_product_add_to_cart_text', 'wooninja_read_more_text', 10, 2 );
function wooninja_read_more_text( $text, $product ) {
if ( 'booking' == $product->product_type ) {
$text = 'Book Now';
}
return $text;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment