Advanced Subscription Start Date

By default, when users subscribe for your subscription plan, the start date of the subscription will be the datetime which they subscribe for the plan. However, sometime, you would want to change this default behavior and it could be controlled by Subscription Start Date Option parameter of the plan. It has the following options:

  • Register Date: That's default behavior. With this option, start date of the subscription will be the datetime which users subscribe for your plan.
  • Fixed Date: This option can be used if you want all subscriptions of the plan will be started at the fixed datetime you want. When you choose this option, you need to enter that fixed date time you want into Fixed Subscription Start Date parameter
  • Determine By Customer: This option can be used if you want to allow your subscribers to choose the start date of the subscription himself. That mean each subscriber can have his own subscription start date. When you choose this option, you need to:
  • Create a Date custom field to allow subscribers to choose his own Subscription Start Date. You might want to set Hide On Membership Renewal to Yes so that he can only choose the date for new subscription only, not renewal
  • Then select that custom field in Subscription Start Date Field setting of the plan.

Trigger onMembershipActive On Subscription Start Date

By default, even if you configure your plan to allow custom subscription start date, Membership Pro will still trigger onMembershipActive event as soon as their subscription is active (they complete payment for their subscription or admin publish the subscription in case the subscriber uses offline payment for the subscription). That mean they will be assigned to the configured Joomla User Groups, Subscribed to mailing lists... at the date they sign up, not on the actual subscription start date (in short, they will have active subscription permissions earlier than they should)

In most case, that's OK. But if you have problem with that behavior (for example, you use their Joomla groups to give discount on Events Booking, on shopping cart...), you might want to change this behavior so that the onMembershipActive event will only be triggered on the actual subscription start date. To have it works like that:

  1. Go to Extensions -> Plugins, find and enable System - Membership Pro Trigger Active Event plugin.
  2. When this plugin enabled, it will be run several times a day (depends on if your site has visitor and value of Cache Time (Hours) parameter). Each time it runs, it will check for subscriptions with custom subscription start date and starting on that day, and trigger onMembershipActive to give the subscriber the right permissions.

Use Cron Job

By default, Membership Pro uses a system plugin to trigger onMembershipActive if you use System - Membership Pro Trigger Active Event mentioned in above section. That mean it requires someone access to the site (search engine bots are also counted) to trigger the process. Sometime, it is not reliable. To address that limitation, you can setup cron job from your hosting account to trigger the process instead. Please see detailed instructions below:

  1. Go to Extensions -> Plugins, find that plugin System - Membership Pro Trigger Active Event, click on it to edit. You should see a parameter called Trigger Active Event Code . Enter a secret string there

  2. Setup a cron job to make a request to this URL using CURL (note that you should use the CURL so that the variable can be passed in the GET request, see https://stackoverflow.com/questions/11375260/cron-command-to-run-url-address-every-5-minutes for detailed instructions

https://domain.com/index.php?trigger_active_event_code=SECRETCODE

  • Replace https://domain.com/ with URL of your site
  • Replace SECRETCODE with the secret string which you entered in the Trigger Active Event Code parameter

That will make the process only processed when there is a request made to that URL (which should be secret as no real users will access to that URL). It will make it more reliable compare to replying a system plugin.

curl