Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

eMember – Can Subscription Duration be set by hour and minute, not just date?

by

Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember Tweaks › eMember – Can Subscription Duration be set by hour and minute, not just date?

Tagged: admin panel, calendar widget, clock widget, Date(), subscription duration, toUTCString

  • This topic has 4 replies, 2 voices, and was last updated 12 years, 9 months ago by leo_osborne.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • July 24, 2012 at 4:15 am #6974
    leo_osborne
    Member

    Hi. I need to be able to set a subscription to end at a specific time of day. The code in the jquery.cookie.js that runs this functionality uses the Date() object and should be able to accept hours, minutes, seconds and milliseconds as input.

    In my shaky understanding (I am not a coder, just a dabbler), the code initially looks for a number from the admin panel to set subscription duration. if it finds this number, it calculates when the number was entered and adds the number as days to that date. if it receives input from the calendar widget, it turns that into a string and sets the “expires” var to this date.

    Can you suggest a way to modify the input in the wp admin panel so time of day can added? Can a clock widget be used in addition to the calendar? Or can it be set up to accept values separated by dashes (ex. yyyy-mm-dd-hh-mm)?

    Also, where does the code that controls the admin panel live? I get the feeling that is where the change will have to be made.

    Thanks,

    Leo Osborne

    the code…..

    var expires = ”;

    if (options.expires && (typeof options.expires == ‘number’ || options.expires.toUTCString)) {

    var date;

    if (typeof options.expires == ‘number’) {

    date = new Date();

    date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));

    } else {

    date = options.expires;

    }

    expires = ‘; expires=’ + date.toUTCString(); // use expires attribute, max-age is not supported by IE

    }

    July 24, 2012 at 5:55 am #47703
    admin
    Keymaster

    The lowest granularity we can go down to is “day” for subscription duration. Anything other than day, month, year is not supported. This field is sometimes tied with a recurring/subscription payment and payment gateways do not allow an hourly/minute granularity.

    July 24, 2012 at 2:36 pm #47704
    leo_osborne
    Member

    Thanks for the quick response.

    That does make sense, since PayPal and the like use days as their smallest unit of time for subscriptions.

    Our situation is a bit different. We are building a site to live stream concerts. Some of the content (opening band) is free, and some of the content (main band) is paid. Since there is only one stream, the free and paid users are separated into different pages with the same embedded player on each.

    We want to be able to allow the free users to watch the opening band only, then block access to the page (or to the player) when the main band starts. By setting the membership to expire a few minutes after the main band is scheduled to perform, free users will be allowed to sample the content and decide if they want to purchase a ticket for the main band.

    For a free membership, PayPal will not be in the loop. Single ticket memberships (and in the future, subscriptions), will use PayPal, so the day granularity will be respected in those cases.

    We want to modify the plug-in. Which file do we need to look at to change the admin panel? What kind of interface can we use that will allow hours and minutes for free memberships and stop at days for paid memberships?

    Can you point us in the right direction?

    Thanks again,

    Leo

    Can you point us in the right direction

    July 25, 2012 at 4:50 am #47705
    admin
    Keymaster

    Hi Leo, I understand what you want to do but we don’t have the architecture in eMember plugin to handle hour/minute expiry granularity. It it not just a matter of changing a file here and there unfortunately. Without the architecture in place it won’t be possible to do this. Please read the 3rd point from our forum rules which will explain more:

    https://support.tipsandtricks-hq.com/forums/topic/forum-rules

    July 26, 2012 at 12:38 am #47706
    leo_osborne
    Member

    Okay. Thanks for the explanation. And the great plug-in. I will look elsewhere for this functionality. Cheers. Leo

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ