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 I display the EOT on my Login Welcome Page? #53

Closed
raamdev opened this issue Jan 21, 2015 · 10 comments

Comments

@raamdev
Copy link
Contributor

commented Jan 21, 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)

Markdown File: http://wsharks.com/1EUWFst
Published KB Article: http://s2member.com/kb-article/how-do-i-display-the-eot-on-my-login-welcome-page/


@raamdev

This comment has been minimized.

Copy link
Contributor Author

commented Jan 21, 2015

@yaronelh

This comment has been minimized.

Copy link

commented Jun 8, 2015

Here you are talking about displaying EOT. but sometimes you would like to display the EOT remaining on the trial period.

It took me a long time to find and create this code since I'm not a developer,

Trial ends in $days_remaining days, (remaining days are added to your subscription when upgrading)"; ?>
@raamdev

This comment has been minimized.

Copy link
Contributor Author

commented Jun 8, 2015

@yaronelh Thanks for the feedback! I'll update this KB Article soon.

@raamdev raamdev reopened this Jun 8, 2015
@raamdev raamdev assigned raamdev and unassigned jaswrks Jun 8, 2015
@raamdev

This comment has been minimized.

Copy link
Contributor Author

commented Aug 4, 2015

@jaswsinc In lieu of the new [s2Eot /] shortcode ([s2Eot /] Shortcode Documentation) I have updated this KB article to reflect using the new shortcode instead of providing a PHP example.

However, @yaronelh's example above provides an interesting scenario that the [s2Eot /] shortcode does not yet cover. Do you think it makes sense to add such functionality into the [s2Eot /] shortcode (calculating the remaining trial period), or would a whole new shortcode for that purpose be in order? It seems to me the latter, as the [s2Eot /] shortcode already feels rather heavy.

Thoughts?

@jaswrks

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2015

or would a whole new shortcode for that purpose be in order? It seems to me the latter, as the [s2Eot /] shortcode already feels rather heavy.

I agree. That's a great idea. A new shortcode sounds like a good idea also.


@yaronelh Here's another way to generate this:

<?php
$eot = s2member_eot();
if ($eot['time'] && $eot['tense'] === 'future') {
  echo 'Trial expires in '.esc_html(human_time_diff(time(), $eot['time'])); // e.g., Trial expires in 5 days.
}

See also: s2member_eot() documentation


Here's an example that checks for a fixed EOT time instead of a possible next payment time. Also, this runs an additional check that looks to see if the user has ever paid you.

<?php
$eot = s2member_eot();
if ($eot['time'] && $eot['tense'] === 'future' && $eot['type'] === 'fixed' && !get_user_option('s2member_last_payment_time')) {
  echo 'Trial expires in '.esc_html(human_time_diff(time(), $eot['time'])); // e.g., Trial expires in 5 days.
}

See also: s2member_eot() documentation

@raamdev

This comment has been minimized.

Copy link
Contributor Author

commented Aug 5, 2015

A new shortcode sounds like a good idea also.

@jaswsinc I was about to create a new GitHub issue for a new [s2Eot-Trial /] shortcode, but I realized that separating that functionality from the existing [s2Eot /] shortcode is going to make things challenging: What if I want to show:

  • Days until Trial Ends

OR

  • Fixed-Term Subscription End Date

OR

  • Next Payment Date

How would we achieve that without PHP if we had two shortcodes? It seems to me now like the Trial EOT should be part of the existing [s2Eot /] shortcode. Thoughts?

@jaswrks

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2015

That's a good point. The calculation itself is almost the same as the EOT calculation really.

However, I'd like this to be smart enough to know which billing cycle the customer is in. Otherwise, just saying "Trial ends in X days" could actually mean, "Next payment required in X days"; i.e., the trial itself could already be over.

Or, in some cases the trial is actually not a free period, it's just the initial period that might have been for a different amount. Thus, checking the last payment time is not going to be enough.

I guess what I'm saying is that we need a new API Function to expose total_billing_cycles and billing_cycles_remaining, and then we need to find a way to work that into a shortcode.

@raamdev

This comment has been minimized.

Copy link
Contributor Author

commented Aug 5, 2015

@jaswsinc @yaronelh I've forked discussion on the topic of showing the Trial Remaining Time to this feature request: wpsharks/s2member#670

I'm going to close this GitHub issue now in favor of continuing discussion on wpsharks/s2member#670.

@raamdev raamdev closed this Aug 5, 2015
@yaronelh

This comment has been minimized.

Copy link

commented Aug 5, 2015

Thanks for making a short code like [s2Eot /] Haven't tried it yet but it's on my list.
I'll follow this thread to see if my implementation is still valid (Works in all scenarios), or If a better way becomes available.

Also there is a small bug I wanted to report, Is it okay if I open an issue and you close it if it's not really a bug.

@raamdev

This comment has been minimized.

Copy link
Contributor Author

commented Aug 5, 2015

Is it okay if I open an issue and you close it if it's not really a bug.

@yaronelh Yes, definitely. :-) Please open a new issue with details here: http://github.com/websharks/s2member/issues/new

@raamdev raamdev removed their assignment Apr 28, 2016
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.