I am trying to remove the "with a XX day free trial" from my product, cart and checkout pages. I need to have the feature still work without having to express it in the product details.
Asked
Active
Viewed 1,702 times
1 Answers
1
It is possible using the filter hook 'woocommerce_subscriptions_product_price_string'
for this hooked function, this way:
add_filter( 'woocommerce_subscriptions_product_price_string', 'subscriptions_custom_price_string', 20, 3 );
function subscriptions_custom_price_string( $price_string, $product, $args ) {
// Get the trial length to check if it's enabled
$trial_length = $product->get_meta('_subscription_trial_length');
if( $trial_length > 0 )
$price_string = $args['price'];
return $price_string;
}
Code goes in function.php file of your active child theme (or theme).
Tested and works.

LoicTheAztec
- 229,944
- 23
- 356
- 399