If you're running a subscription site, there are bound to be things you want to customize to make your website reflect your brand. Subscriptions are loaded with hooks that developers can use to customize all sorts of things programmatically. We'll be manipulating the Subscriptions price string using a filter just to show how things are done.
You must have the WooCommerce Subscriptions plugin installed and activated on your site.
In order to customize the subscription price string, go through the following steps:
Open up your theme's
functions.php
file, located underwp-content/themes/your-theme-name/
, or create a custom WooCommerce plugin and open up that file.Add the following two lines of code. These tell Subscriptions to look for your modifications to the price string:
add_filter( 'woocommerce_subscriptions_price_string', 'woocommerce_cookbook_subscription_price_string', 10, 2 ); add_filter('woocommerce_subscriptions_product_price_string...