0

Currently I am working on membership site where their are two types of membership

1) Free Membership 2) Premium membership

Based on these membership I want to change content of any pages For this I am using WooCommerce, WooCommerce Subscription and WooCommerce Membership.So Please tell me how I can get the membership plan after user logged to its account.

Thanks Mayank

mujuonly
  • 11,370
  • 5
  • 45
  • 75
Mayank
  • 47
  • 2
  • 8

2 Answers2

5

Woocommerce subscriptions plugin has a class WC_Subscriptions_Manager that has a static function get_users_subscriptions. This function returns array containing user's subscriptions. So please use following code:

<?php
      WC_Subscriptions_Manager::get_users_subscriptions(get_current_user_id());  
?>
0

As of 2.0, use the function wcs_get_users_subscriptions(). It returns WC_Subscription[].

roelleor
  • 443
  • 6
  • 11