drupalro / drupal.org.ro

Site-ul drupal.org.ro.
1 stars 3 forks source link

Community paid membership #7

Open cristiroma opened 10 years ago

cristiroma commented 10 years ago

Implement paid membership for the community website

claudiu-cristea commented 10 years ago

At some point I've defined the membership in the way described bellow. At that point I found no other solution in Drupa Commerce to create memberships. I'm pasting that solution here, maybe it helps:

Description

When a user wants to enroll with the associations he buys membership(s). A membership is just 1 year subscription to the association. When he chose to buy, he'll be asked for quantity. "Quantity" == "Number of Years". So, after a checkout and a successful payment he will get a valid transaction.

But we need to transfer/deliver him the membership(s). That's why we are introducing the membership node-type. Membership will be created when finishing successfully a transaction using Rules and following next rules:

  1. A membership is a node-type.
  2. A user gets a number of membership equal with the quantity of bought subscriptions.
  3. The membership node author will be set to the user who bought the membership.
  4. Membership nodes are created via Rules, when a user completes successfully a transaction.
  5. Fields attached to membership node:
    • transaction: Entity reference, referencing the transaction that bought this membership.
    • expires: A timestamp defining the membership expiration. It's the same day but next year. (Check what happens in February 28)
  6. The membership node created time will be set using the following rule:
    • User owns no previous membership nodes: REQUEST_TIME.
    • User owns previous membership nodes: The latest membership node expires value plus 1 day.
  7. The expires value will be set to created time plus 1 year. Basically the same day of the next year.
  8. A tab will be exposed in the user profile (user/%user/membership) with the time descending list of memberships. Columns: date start, date end, link to transaction.
  9. Users having expired memberships will receive a status message asking them to update their membership and linking to buy membership page.
  10. Notifications. Notify users by mail when:
    • One month before the last membership is about to expire.
    • One week before the last membership is about to expire.
    • When the membership has expired.
    • Each 1 month after the last membership expired. ~This may be stopped by the user by choosing "Quit association" (find a better english) somewhere in their profile. NOTE: This needs a discussion first.~