latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

EOT and custom capabilities/levels

Home Forums Community Forum EOT and custom capabilities/levels

This topic contains 2 replies, has 2 voices. Last updated by  BoMember 3 years, 10 months ago.

Topic Author Topic
Posted: Tuesday Feb 12th, 2013 at 9:22 am #41553
BoMember
Username: BoMember

Hi!

After extensively searching http://www.s2member.com and watching all tutorials, I give up. Please help me.

This is the situation. I have two products:
Product A – $50 – 1 month, non-recurring
Product B – $50 – 1 month, non-recurring

User buys product A at 1st of February. At 15th of February user buys product B.

What I’m trying to achieve is to have user’s access to product A end 1st of March and access to product B ends the 15th of March. After 15th of March, account is demoted to ‘free subscriber’.

What is the best way to do this?
Thank you very much for your help!

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Thursday Feb 14th, 2013 at 11:19 pm #41755
Staff Member

Thanks for your inquiry. ~ We appreciate your patience :-)

What I’m trying to achieve is to have user’s access to product A end 1st of March and access to product B ends the 15th of March. After 15th of March, account is demoted to ‘free subscriber’.

So you want each of these purchases to result in a demotion once they expire;
exactly one month after the date or purchase. Is that correct?

If so, you’ll want to generate a Payment Button or Pro Form that provides fixed-term access through “Buy Now” functionality. After the purchase is made, an EOT Time is set for the User, and s2Member® will expire them automatically. If they purchased one month of access, they will expire after one month automatically.

See: Dashboard -› s2Member® -› PayPal® Options -› Automatic EOT Behavior
See: Dashboard -› s2Member® -› PayPal® Pro Forms -› Membership Level # Forms
See also: Dashboard -› s2Member® -› PayPal® Pro Forms -› Shortcode Attributes (Explained)

The Pro Form Generator will configure your Shortcode for you automatically, but just to point out — the relevant Shortcode Attributes are: rr="BN" (Buy Now) and rp="1" rt="M" (1 Month of fixed-term access).


IMPORTANT NOTE: s2Member does not support multiple simultaneous Subscriptions or EOT Times. Therefore, EOT Times against fixed-term access that I described above will only work one at a time. If you sell an existing Product A customer Product B — before Product A has expired, the following will happen.

Timeline:
– Product A purchased on Feb 1st (good for one month).
– Product B is now sold to existing Product A customer on Feb 5th (good for one month).
– Product A is removed, and Product B takes it’s place. The EOT Time is reset to one month after the purchase of Product B now (e.g. this is treated like an upgrade or downgrade, where everything is reset to the configuration of the customer’s most recent purchase).

Product is probably not the best word to use here, because with s2Member® this is normally associated with Membership Level Access, not with Products. However, in this context the term Product demonstrates this limitation a little more clearly I think; because that’s what you are trying to accomplish.


A Possible Workaround For You

Custom Capabilities can be sold to existing customers on a “Buy Now” basis. So this could be a viable alternative for you, if you really need to achieve this functionality for a certain business model.

Timeline:
Customer buys access to Product A on Feb 1st (i.e. Membership Level #1 — lifetime access).
On Feb 5th you sell this existing Level #1 Member an additional Custom Capability (lifetime access).
See: Dashboard -› s2Member® -› PayPal® Pro Forms -› Capability (Buy Now) Forms

Now, you will want to integrate a custom CRON job to remove Capabilities at certain custom dates that you prefer. The customer is assumed (in this scenario) to have lifetime access. However, your custom CRON job can dictate otherwise.

Example of adding/removing Custom Capabilities from existing Users in WordPress®.

<?php
$user_id = 123;
$user = new WP_User($user_id);
$user->add_cap('access_s2member_ccap_music');
$user->remove_cap('access_s2member_ccap_videos');
?>

See also: Knowledge Base » s2Member® Roles/Capabilities
See also: Knowledge Base » Changing Roles/Capabilities via PHP
See also: API Function: s2member_paid_registration_time()

Setting an automatic EOT Time for a customer via PHP.

<?php
$user_id = 123;
$eot_time = strtotime('+30 days');
update_user_option($user_id, 's2member_auto_eot_time', $eot_time);
?>

See also: http://php.net/manual/en/function.strtotime.php
See also: http://codex.wordpress.org/Function_Reference/update_user_option

Posted: Friday Feb 15th, 2013 at 1:41 am #41779
BoMember
Username: BoMember

Thanks a lot Jason. I’ll dig into it. Keep up the good work, it’s a great plugin! As a European user I am looking forward to the new payment gateway API. I think it will unlock the European market for you guys!

Viewing 2 replies - 1 through 2 (of 2 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.