1. Home
  2. WC Vendors Marketplace
  3. How To
  4. Paid Membership with WC Vendors and Paid Memberships Pro plugin (third party)
  1. Home
  2. WC Vendors Pro
  3. How To
  4. Paid Membership with WC Vendors and Paid Memberships Pro plugin (third party)
  1. Home
  2. WC Vendors Marketplace
  3. Code Snippets
  4. Paid Membership with WC Vendors and Paid Memberships Pro plugin (third party)
  1. Home
  2. WC Vendors Pro
  3. Code Snippets
  4. Paid Membership with WC Vendors and Paid Memberships Pro plugin (third party)

Paid Membership with WC Vendors and Paid Memberships Pro plugin (third party)

This post is for reference only; we do not support this configuration nor do we support the third party plugin mentioned in this post.

I’ve seen a lot of requests regarding the implementation of a paid membership (monthly, yearly, etc.) in conjunction with WC Vendors. I thought I would share what I was able to implement so that our site could have a choice of a paid membership in order to enable vendor capabilities.

The challenge was setting up a membership plugin so that it would automatically upgrade a subscriber to the essential vendor role. Most membership plugins will not automatically switch roles upon successful membership payment; nor will they allow the use of an already created role that is not a standard wp role or a role that the membership plugin defines.
……………………………………………………….

Steps:
– install & configure the Paid Memberships Pro plugin. You can use the free version. https://wordpress.org/plugins/paid-memberships-pro/

– Set up your membership level or levels.

– Add the below code in your theme or child theme functions.php . This code will enable automatic upgrading to a vendor role upon completion of the first membership payment. In addition, if a member wishes to downgrade or cancel the membership (close shop, essentially), it will then downgrade the member to a subscriber role upon cancellation. Also enables admin ignore. You will have to get the level numbers and roles to match your site. You can have this switch to different roles other than vendor- whatever the roles are on your site that you wish to have assigned to a paid membership.

In this case, I have a monthly and a yearly membership level choices. Each is upgraded to vendor, I just wanted members to have a choice of monthly or yearly payment plans to open a shop.

 

This code is to be placed in your child theme functions.php file:

actions

Updated on January 18, 2018

Was this article helpful?