S2member and Woocommerce workaround

Hi, Newbie here.

I know that (sadly) there is not an integration of those two plugins just yet, but I think that I have ALMOST figured a workaround, and I’m reaching for some ideas in the meantime (I’ve only installed the plugin yesterday, but have spent hours trying to learn the way to make it do what I need)

I am planning on using s2m not for membership levels but rather in this way:

I have about 40 videos stored in Vimeo, that I want to sell individually, and/or as premade bundles. I know now that the best way to tackle this is with custom capabilities.

I have previously created the products in woocommerce (at firs, I thought that might work out… spoiler: it didn’t). Now, since I’ve already spent so much time and effort setting my woocommerce store (and honestly, I like the user interface with the shopping cart better than sending my cusomers to pay 2 or 3 separate times if they want 2 or 3 separate videos), my plan is to:

  1. Have the customer complete the purchase with woocommerce, previous login.
  2. Once they complete payment, a message with the video link will pop up
  3. This video link will be protected by custom capabilities

My problem is… how do I make woocommerce assign custom capabilities to the user after payment? I know that s2m does exactly that when I generate the PayPal button, but is it possible for me to add some code in order to achieve this?

Am I on the right track? Thank you so much in advance.

I keep looking for a way to make this work, and I figure that I can generate a button like the ones that s2m generates for paypal payment: delete the code for PayPal (since the transaction was already completed with Woo) and leave only the code that adds the custom capabilities to the member.

This button can be named “activate your access” or something like that and would pop up along with the video link…

Hi Bertha.

Yes, you are on the right track, I think. You just need to add the custom capabilities to the user after completing checkout. You’d need to find a WP or Woo hook after payment to add your customization, and based on the items the user got, give him the corresponding s2 capabilities for access.

I think this article will interest you: https://s2member.com/kb-article/rolescapabilities-via-php/

I hope that helps! :slight_smile: