Page 1 of 1

updating user meta and adding to subscriptions

PostPosted: January 27th, 2012, 1:52 pm
by ETSol
Hello,
I've just switched to s2member pro after trying various other membership plugins and finding some dire problems with them - things are looking good so far, but I've got a couple of questions I'm hoping that someone can help with!

Firstly, when a new member subscribes I'd like a WP user meta entry to be updated with a value, depending on the membership level chosen - Is there any way to do this with s2member, perhaps a hook i can use?

I'd also like to be able to upsell an additional feature on each of my membership packages, like a 'silver' level and a 'silver-plus' level. I currently use just the regular 4 membership levels, but rather than creating an additional 4 'plus' levels, is there a way to offer the 'plus' as an addon/extra?

Thanks!

Re: updating user meta and adding to subscriptions

PostPosted: January 28th, 2012, 4:55 am
by Cristián Lávaque
There are hooks that s2Member makes available to extend/customize it, and you can find them in the code itself, or the s2Member Codex. viewforum.php?f=40

You can also use the Notification API. WP Admin -> s2Member -> API / Notifications -> Sign Up

Regarding the plus access on top of the level, maybe custom capabilities would be what you want. Watch this video: http://www.s2member.com/custom-capabilities-video/

I hope that helps. :)

Re: updating user meta and adding to subscriptions

PostPosted: January 28th, 2012, 1:50 pm
by ETSol
Thanks for the reply Cristián!

Forgetting about the second part of my question for the moment - I think I've located a good hook to use for my purposes - ws_plugin__s2member_after_paypal_notify - but I'm not having much success with it (from what I've read on other forum posts, it could be because the member isn't currently loggedin when it fires).

To explain what I'm trying to do a little further - I'm running a token system on my site, and the memberships I sell signify a set number of tokens available to the member monthly (ie. lvl1=10 tokens, lvl2=20 tokens etc.).
As things stand, I'm manually adding these tokens as WP user meta values once a member signs up at a given level, but ideally I'd like to hook into s2member so I can automatically assign the tokens to a member once they've paid (on both their initial payment and on subsequent recurring payments).

Am I on the right track here with the hook I'm looking at, and is it possible to get the userid associated with the paypal payment notification somehow, instead of relying on the loggedin user (which couldn't really work for recurring payments anyway lol).

Thanks again for your help!