Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Subscription String Change 1
add_filter( 'woocommerce_subscriptions_product_price_string', 'my_subs_price_string', 10, 3 );
function my_subs_price_string( $subscription_string, $product, $include ) {
global $product;
$products_to_change = array( 1, 2, 3, 4, 5, 6 );
/****
var_dump($product); Various variables are available to us
****/
if ( in_array( $product->id, $products_to_change ) ) {
return ‘The console has an initial cost of ' . wc_price( $product->subscription_sign_up_fee ) .
', and comes with a free ' . $product->subscription_trial_length . ' ' . $product->subscription_trial_period .
' trial of View More +. Following the trial, the monthly subscription will be ' . wc_price( $product->subscription_price );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.