corsonr
6/17/2014 - 1:11 PM

WooCommerce Subscriptions: edit sign-up button text

WooCommerce Subscriptions: edit sign-up button text

<?php
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', __( 'Sign Up 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);