Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you create a subscription that ends on a fixed date? #218

Closed
jaswrks opened this issue Jun 2, 2015 · 4 comments
Closed

How do you create a subscription that ends on a fixed date? #218

jaswrks opened this issue Jun 2, 2015 · 4 comments
Assignees

Comments

@jaswrks
Copy link
Contributor

@jaswrks jaswrks commented Jun 2, 2015


KB Article Creation Checklist
  • Write initial draft for this KB Article; label this issue draft and either questions or tutorials
  • Add required YAML configuration
  • Add Tags for this KB Article to the YAML config (see YAML Keys (Explained))
  • Edit and finalize draft for publishing (remove draft label, add draft-finalized label)
  • Assign Issue to yourself and create Markdown file (remove draft-finalized label, add pending)
  • Project Lead: Review and Publish KB Article (remove pending label, add published label)
Additional TODOs

Additional TODO list items go here.


:octocat: View Markdown File | ✏️ Edit Markdown File
📃 Published KB Article: http://s2member.com/kb-article/how-do-you-create-a-subscription-that-ends-on-a-fixed-date/


@patdumond

This comment has been minimized.

Copy link

@patdumond patdumond commented Jun 3, 2015

A user wanted to know how to create a subscription that ended on a fixed date. I created a ProForm page that sold a subscription ending on 31 October 2015.

Note: You must use a plugin such as ezPHP to use PHP codes in your s2Member forms. Please see this s2Member KB article. I use ezPHP which allows me to use the [php]...[/php] shortcodes used below. Not all PHP plugins allow you to use a shortcode.

Use this PHP code on your page to assign the EOT date (it must be placed before the form shortcode -- I put mine at the top of the page):

[php]

$now = strtotime("now");

$fixed_time = strtotime("31 October 2015");

$days_until_fixed_time = round(($fixed_time - $now) / ($seconds_in_one_day = 86400));

[/php]

Create a proforms shortcode using the s2Member control panel:

[s2Member-Pro-PayPal-Form level="1" ccaps="" desc="$0.01 USD / One Time (for 1 year access, non-recurring)" ps="paypal" lc="" cc="USD" dg="0" ns="1" custom="pat.websharks-inc.net" ta="0" tp="0" tt="D" ra="0.01" rp="[php]echo $days_until_fixed_time;[/php]" rt="D" rr="0" rrt="" rra="2" accept="paypal,visa,mastercard,amex" accept_via_paypal="paypal" coupon="" accept_coupons="0" default_country_code="" captcha="0" /]

You will need to change the following attributes in your shortcode:

desc - I did not change mine because it was for testing. Yours could look something like this: desc="$25.00 USD / One Time (Unlimited Access Until 31 October 2015)"

rp - Replace the rp value with the following php code [php]echo $days_until_fixed_time;[/php]

rt - Make sure rt="D". I left mine at "Y" for my first test and that user had a 150 year subscription.

@jaswrks jaswrks changed the title Pat's KB Article How do you create a subscription that ends on a fixed date? Jun 3, 2015
@jaswrks

This comment has been minimized.

Copy link
Contributor Author

@jaswrks jaswrks commented Jun 3, 2015

@patdumond Nice work. I converted your example to a KB article in the leading comment above ↑. Please review when you get a moment and we can correct any problems before this is published.

@raamdev

This comment has been minimized.

Copy link
Contributor

@raamdev raamdev commented Jun 3, 2015

@jaswsinc @patdumond are you aware of these existing KB Articles related to this?

If this is not a duplicate of one of these (it doesn't appear to be--I think it's a slightly different scenario), you may want to link to both of those at the bottom of this KB Article ("See Also:").

@patdumond

This comment has been minimized.

Copy link

@patdumond patdumond commented Jun 3, 2015

Jason,

The only thing that jumped out at me is that you said "you will need to enter this in the HTML tab of the WordPress editor" and it is actually labeled as "Text". Raam is right. This is not the same situation described in those KB articles, but is related, so a link to those articles would not be out of place.

I'll use this article as an example for the next time I need to write one, so it will be more detailed than the comment I left earlier. Closer to a finished product, in other words. Thanks for the opportunity to do this.

Edit 8 June: I just caught a typo here: Forcing an EOT to occur 31 October 2025 -- should be 2015.

Any chance we can get this finalized soon, I had another ticket wanting to know how to do this today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.