The issue described here is exactly what I need to do and the solution works:
Woocommerce: Change text on order button [Updated]
However, we accept one time "orders" in the form of donations and subscriptions to sponsor a child. If there is a subscription in the cart, the checkout button reads "Sign up now". I need it to read "Give Now" no matter what is in the cart.
http://www.childhopeonline.org (the changes described above are not live and it currently uses the default "Place order" which is consistent no matter what is in the cart)
Translation doesn't seem to work.
I've also tried:
function woocommerce_custom_subscription_product_single_add_to_cart_text( $text = '' , $post = '' ) {
global $product;
if ( $product->is_type( 'subscription' ) ) {
$text = get_option( WC_Subscriptions_Admin::$option_prefix . '_add_to_cart_button_text', __( 'Give Now', 'woocommerce-subscriptions' ) );
} else {
$text = $product->add_to_cart_text(); // translated "Read More"
}
return $text;
}
add_filter('woocommerce_product_single_add_to_cart_text', 'woocommerce_custom_subscription_product_single_add_to_cart_text', 2, 10);