How to display user's WooCommerce subscription details?
Add the following code in functions.php of the active theme.
add_shortcode('wdm_my_subscription', 'wmd_my_custom_function');function wmd_my_custom_function(){ WC_Subscriptions::get_my_subscriptions_template();}
Now use [wdm_my_subscription]
as a shortcode on the page where you want to display the User's subscription.
Screenshots:
Without Shortcode:
Adding shortcode:
Result:
If you need to modify the output of this you might need to copy the contains of get_my_subscriptions_template()
function WC_Subscriptions
class of the WooCommerce subscription Plugin and use it in this shortcode instead which will help you to add the details you want.