Memberships
Use our Forums to find examples and answers to your questions. If you have advanced requirements for your project, contact us and our staff can help you find a solution.
FoxEE divides memberships and subscriptions into two separate entities.
A membership is something that you purchase a subscription for. For example typical types of membership are Technical Support, Private access to certain weblogs, etc. You purchase a subscription for a period of time, for a defined price for a membership.
A subscription can be configured with the following attributes:
- a one time expiring item
- a re-occurring charged item that will continue until cancelled
- an optional free trial time period before the first charge (only for re-occuring subscriptions)
When a subscription is purchased, the following workflow is preformed:
- Determine the ExpressionEngine User
- If the user was logged in at time of purchase, then it is recorded
- The member’s database is queried to determine if the payment email address matches any known user
- Finally, as a last resort, a new ExpressionEngine member is created and an email is sent to the member with their account name and password.
The Subscriptions Manager
The subscription manager is the system that monitors over subscriptions, initiating emails and expiring the subscription itself. Within EE, the recommended way to have this program run is to use the ExpressionEngine Cron plug-in, which will allow the system manager to run at an interval that you define. Install the plug-in and then use the code below to have the FoxEE Subscription Manager run everyday at 1am.
{exp:cron minute="0" hour="1" day="*" month="*" module="foxee:process_subscriptions"}{/exp:cron}
Using Memberships in your Templates
Two tag sets can be used to act on your memberships.
{exp:foxee:memberships} loops through all defined memberships for a member
{exp:foxee:member} will act on a specific membership
{exp:foxee:memberships}
By default, the above will list all active memberships owned by the member.
Parameters:
id - a specific subscription (weblog entry_id) or 'all' to display all of the memberships belonging to a customer.
- {exp:foxee:memberships id="2"}
- Special stuff only for members apart of this subscription
- {/exp:foxee:memberships}
id=’all’
adding id=’all’ will list active and expired subscriptions owned by the member
Conditionals:
Fields:
{membership_name} - title of the subscription
{subscription_expiry_date} - expiry date of the subscription
{subscription_start_date} - Only active if a trial period is used
{exp:foxee:member}
Act on a specific membership.
example:
- {exp:foxee:member id="2"}
-
- what you want the member to see if they don"t have access
- {/exp:foxee:member}
Fields:
{membership_name} - title of the subscription
{subscription_expiry_date} - expiry date of the subscription
{subscription_start_date} - Only active if a trial period is used
Adding A subscription
In case you wish to user to be able to click on a link and create a non-purchasing subscription, you can use the following tag:
{exp:foxee:addsubscription membership_id=1 [expiry="2009-12-31"] }
expiry is optional, and if omitted, it will last forever.
