I need a better way to do this.
Currently, I have added code directly to the get_price_string function within class-wc-subscriptions-product.php file, so when a free trial is setup I can change the text being added to the price string.
This, of course, is far from perfect.
So, does anyone know what hook I need to add to the functions.php file in the theme’s folder to be able to do the same thing?
OK old question but I needed to do this recently. I didn’t want to rely on string replacement so this is how I did it (can be adapted to suit your needs – they key is to look at the attributes in
$product
which are available to you):Here is a VERY simple version for my site. I needed to have it say “per season” instead of “every 3 months”. The simplest way was to create a plugin:
In
/public_html/wp-content/plugins/woocommerce-subscriptions/includes/class-wc-subscriptions-product.php
Find
get_price_string(...)
Adjust the Boolean values here: