Charge Documentation

Using Charge Fields

Charge has a fieldtype that can be added to channels to allow for easier subscription management. While you can manage your subscriptions soley via the templates by setting parameters, using the fieldtype allows multiple subscriptions to use a single template tag, keeping your templates DRY and easy to maintain.

The fieldtype also makes it easier for non-technical users to make changes to subscriptions, as subscription settings such as price and actions can be set and edited directly from an entry, rather than via the template tags.

Handling Multiple Subscriptions with Fields

The Fields can allow users to set up multiple subscriptions and these subscriptions could all be displayed on a main page and then each entry could be used for the specifics of their subscription.

For any sort of subscription based approach we first need the Subscription added in the addon. For this example I will be making the 'Silver Subscription' When setting up the subscription note that you can change the person's member group based on if the payment succeeds or not. In the example below - I am keeping them in member if the payment does not work and moving them to the Silver group if things work correctly.

Charge Subscription

Next we need to create a charge action. - An action is what is triggered to move people around different subscriptions and the action is tied to what subscription it triggers.

Charge Action

We create the action with our name

Charge Member Action

Please take note that down at the bottom of this action there is a "Member actions" part - you need to set that to your subscription we just made, this is what links them together.

Now, whenever this action is preformed the user will be set to the silver Subscription and put into those member groups we set earlier.

For the next part is where Charge Fields come in. We will create a charge field and add it to a channel.

If you want to follow along with the example templates that came with the addon name your charge channel shortname "charge_demo"

This allows you to use the template example 'entry_fields' that comes with the template examples of the addon.

Charge Entry Field

In this example - I have choosen that it is a one time payment and that the action to be triggered on successful payment is the silver action we just created. In the image example I have also chosen that everyone pays the same price but you can change if the member group specifics get discounts from that pricing type.

By setting things up in this way will let you add other subscription types in the future to this channel as a new entry and then you could for instance have a "subscriptions" page where all the plans are laid out by looping over that channel and then when users select a plan they want it brings them to the correct sub checkout.

Support

Having problems setting up and/or using Charge? Support is offered from 10am to 4pm EST weekdays. Send us an email at help@eeharbor.com and we will respond as quickly as we can.