Family Plan Membership

Print

Introduction

This is an advanced tutorial.

A very popular request regarding CBSubs GPL is to have some type of family plan, where the family plan subscriber can provide similar benefits to one or more family members.

A similar concept can also be extended to a company plan that would allow the company plan subscriber to provide once again similar benefits to some company employees.

Such a feature has not been implemented yet in CBSubs GPL, mainly because its requirements are not well defined yet. This is the first part of a tutorial series (second part is here) that will present use case implementations of family plan concept requirements and how these can be implemented using CB Solution add-ons.

This first tutorial will describe a family plan use case and its implementation using CBSubs GPL, CB Conditionals, and CB Auto Actions.

Use Case Description

A family plan is defined as a CBSubs GPL plan (in our example it is set to a 1 year duration for a fixed fee) that provides specific website access privileges to the family plan subscriber. However, the family plan subscriber can also specify one family member (to keep our example simple) that can get similar access privileges as the family plan subscriber.

Let us assume that we actually have the following 3 CBSubs GPL plans:

A Family Plan subscriber can specify (a new or existing) user (but not themselves of course) that is to be given a free Family Member Plan subscription. The free Family Member Plan subscription is set to expire when the Family Plan subscription expires.

Once the Family Member plan is allocated (offered) by the Family Plan subscriber no changes can be made until the family plan expires and is then repurchased (thus causing the entire process to restart).

If the Family plan is renewed before expiration then the Family Member assigned subscriber is also automatically renewed once again expiring when the Family plan is set to expire.

Elements used in use case implementation

The following building block elements are used to implement this use case:

Screenshots

In addition to the detailed configuration information provided earlier, here are a series of screenshots of the various configuration areas.

CB Fields on Family Plan tab

CB Field Manager view with fields of Family Plan tab.

CB Fields on Accept Family Plan tab

CB Field Manager view with fields of Accept Family Plan tab.

CB Fields on Superadmin tab

CB Field Manager view with fields of Superadmin tab.

 

CBSubs GPL Plans Overview

CBSubs Plans icon area.

CBSubs Family Plan Fields Integration

CBSubs Family Plan fields integration settings.

CBSubs Family Plan SQL Actions Integration

CBSubs Family Plan SQL Actions Integration.

 

CBSubs Family Member Plan Fields Integration

CBSubs Family Member Plan Fields Integration Settings.

CBSubs Family Member Plan SQL Actions Integration

CBSubs Family Member Plan SQL Actions Integration Settings.

CB Auto Actions Overview

CB Auto Actions Overview page.

 

CB Auto Action 1 Basic Settings

CB Auto Action 1 Basic Settings.

CB Auto Action 1 Advanced Settings

CB Auto Action Advanced Settings for Check proposal to register user 1.

CB Auto Action 2 Basic Settings

CB Auto Action 2 Basic Settings.

 

CB Auto Action 2 Advanced Settings

CB Auto Action 2 Advanced Settings.

CB Auto Action 3 Basic Settings

CB Auto Action 3 Basic Settings.

CB Auto Action 3 Advanced Settings

CB Auto Action 3 Advanced Settings.

 

CB Auto Action 4 Basic Settings

CB Auto Action 4 Basic Settings.

CB Auto Action 4 Advanced Settings

CB Auto Action 3 Basic Settings.

CB Auto Action 5 Basic Settings

CB Auto Action 5 Basic Settings.

 

CB Auto Action 5 Advanced Settings

CB Auto Action 5 Advanced Settings.

CB Auto Action 6 Basic Settings

CB Auto Action 6 Basic Settings.

CB Auto Action 6 Advanced Settings

CB Auto Action 6 Advanced Settings.

 

Workflow Walk-through

A typical walk-through of the use case workflow follows:

  1. User purchases a Family Plan subscription and is automatically given an extra Family Plan tab that allows him/her to either assign an existing user (giving the username) or to create a new user (giving the First Name, Last Name, Email, Password, Username). For clarity lets assume that the user that purchased the Family Plan has a username of family. Notice that the Family Plan tab has the 'Family plan expiration date' set (by XXX), the 'Family member 1 status' set to 'OPEN' (by XXX) and the 'Family plan member 1 history' populated with initial activity (by XXX).
  2. User with username=family edits his/her profile and selects the CREATE option in the 'Mode to handle family member 1' drop-down field and then populates the various fields needed to create a new user.
  3. After user family saves profile, if data provided validates ok (the provided email and username are not used), then an OK to proceed message is shown in the 'Status Message 1' field and the 'Create user 1' check-box field will appear (initially unchecked with value No)
  4. User family can then edit his/her profile and click on the 'Create user 1' check box and then save the profile (clicking on the Update button). This will trigger the execution of CB Auto Action 3 (Register family member 1) and also after this the execution of the CB Auto Action 4 (which listens to the onAfterUserRegistration event).
  5. The family user profile is now updated showing additional information in the 'Family plan member 1 history' field and also showing the 'Family member 1 status' set to ALLOCATED.
  6. The new user with username 'member' has been created and has been configured to show the 'Accept Family Plan' tab which contains the 'Expiration date' field set to the expiration date of the family plan subscription, the 'Accept family plan' check-box field unchecked, the 'Family plan granted' field displaying information about which user offered this family member plan and the 'Family plan ownder id' field containing the userid of the family plan member purchaser. At this moment the member user profile has no CBSubs subscription activated.
  7. User member can edit his/her profile and click on the 'Accept family plan' check-box and save the profile.
  8. User member now has an active 'Family member plan' subscription that is set to expire on the exact same moment that the Family Plan subscription expires.
  9. The family profile has an updated 'Family Plan' tab that has 'Family member 1 status' set to ACTIVATED and also an updated 'Family plan member 1 history' field.
  10. At this point the famiy member plan is set to expire at the same time the Family Plan expires. If in the meantime the Family plan user (family) renews early his/her Family plan subscription, then the expiration date of the already assigned family member plan subscription will also be automatically updated (see SQL renewal action of Family Plan). If the family plan expires and a new family plan subscription is activate the workflow is brought back to the initial status.

Worflow Walk-through screenshots

And here are the corresponding screenshots that follow the previously detailed walk-through:

Workflow walk-through step 1

Workflow walk-through step 1.

Workflow walk-through step 2

Workflow walk-through step 2.

Workflow walk-through step 3

Workflow walk-through step 3.

 

Workflow walk-through step 4

Workflow walk-through step 4.

Workflow walk-through step 5

Workflow walk-through step 5.

Workflow walk-through step 6

Workflow walk-through step 6.

 

Workflow walk-through step 7

Workflow walk-through step 7.

Workflow walk-through step 8

Workflow walk-through step 8.

Workflow walk-through step 9

Workflow walk-through step 9.

 

Conclusion

This advanced tutorial has covered many different aspects of CBSubs and CB Auto Actions. The use case can be extended and modified to satisfy different requirements.

The goal is to reach a set a requirements for the family membership request in order to be able to generate the specifications for this new feature.

This tutorial is based on CB 1.9.1 and CBSubs 3.0.0. Please note that database structures are not part of CB / CBSubs specifications and that subsequent CB / CBSubs versions can have different database schemes. When direct accessing databases, it is recommended to have a staging site where upgrades are tested before being applied to live sites.

Lets discuss this on our forums here.