• Any way to hide the “x days of free trial”? I’m running a school and selling courses that start in September till July. If they sign up in August, they aren’t on “free trial”, the course has simply not started yet…

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Javier Carazo

    (@carazo)

    @ireth92,

    You can use filters like this one: woocommerce_subscriptions_product_price_string

    If you are not using English, you can also change this string: $subscription_string = sprintf( __( ‘%1$s with %2$s free trial’, ‘woocommerce-subscriptions’ ), $subscription_string, $trial_string );

    PS: all this is not part of this plugin, you will have to ask for more info to the WooCommerce Subscriptions author’s.

    Thread Starter Mireia Balaguer

    (@ireth92)

    Thank you Javier,

    You pointed me in the right direction, but I ended up taking a different approach. I changed the text from “with a free trial of (x days)” to “starting in (x days)”, so it makes sense now.

    Here’s my code: (Beware the example below is for the spanish translation).

    add_filter('woocommerce_subscriptions_product_price_string', 'woo_change_subscriptions_product_price_string' );
    function woo_change_subscriptions_product_price_string( $subscription_string ) {
    
            $subscription_string = str_replace( 'con una prueba gratuita de un', "a empezar en", $subscription_string );
    
            return $subscription_string;
    }
    Plugin Author Javier Carazo

    (@carazo)

    Sorry but as I told you this is not a problem of this plugin.

    Please ask the plugin’s developer to help you.

    Thread Starter Mireia Balaguer

    (@ireth92)

    I know, I was just sharing my solution in case someone else has the same problem.

    Plugin Author Javier Carazo

    (@carazo)

    @ireth92, ah OK sorry I didn’t ready your answer.

    Hi if anyone can please tell me where I should add this code, it will be greatly appreciated

    Plugin Author Javier Carazo

    (@carazo)

    In your functions.php inside your child theme or in a plugin you made to include it.

    Thank you so much

    I am using woocommerce subscription plug in and your plugin to achieve this. Should it go into one of them

    Plugin Author Javier Carazo

    (@carazo)

    No, it should go out this plugin. You will lost your code change when we update it.

    Please include it using good practices.

    @joacro
    If you aren’t a developer and prefer a GUI interface to use, this plugin can come to the rescue. It allows you to customize the following default strings from WooCommerce and WooCommerce Subscriptions:
    https://github.com/woocommerce/woocommerce-subscriptions-custom-price-string

    Thread Starter Mireia Balaguer

    (@ireth92)

    The easier way to add the code is to install a plugin called Snippets which allows you to add bits of code as if it was in the functions.php file, but without needing a child theme.

    Plugin Author Javier Carazo

    (@carazo)

    @ireth92,

    But saving a code in database is very unsure and slow. So always better choose another option.

    Anyway we want to include part of the functionality of this plugin (https://github.com/woocommerce/woocommerce-subscriptions-custom-price-string) here to make it easier to do.

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Hide Trial Period’ is closed to new replies.