Created
February 14, 2018 14:51
-
-
Save mattpramschufer/d308b6eab561da2f13c0a941de05ffcd to your computer and use it in GitHub Desktop.
Modify WooCommerce Subscriptions Subscription Strings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('woocommerce_subscriptions_product_price_string', 'modified_subscription_strings', 10, 3); | |
function modified_subscription_strings($subscription_string, $product, $include){ | |
switch($product->get_slug()){ | |
case 'green-magazine-subscription': | |
case 'classic-farm-tractor-subscription': | |
case 'little-green-magazine-subscription': | |
return '$' . number_format($product->get_price(), 2, '.', '') . ' / year'; | |
break; | |
default: | |
return $subscription_string; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment