Plugin screenshot thumbnail 1/5
Plugin screenshot thumbnail 2/5
Plugin screenshot thumbnail 3/5
Plugin screenshot thumbnail 4/5
Plugin screenshot thumbnail 5/5

Ss Craft Membership plugin for Craft CMS 3.x

A membership site lets you limit access to your site’s content to only paid users.

SS Craft membership plugin will easily integrate with Stripe so you can accept membership payments and protect your content from non subscribed users. It will help you to set up membership integration of your site.

To read plugin documentation SsMembership Documentation.

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later.

Installation

To install the plugin, follow these instructions.

  • In the Control Panel, go to Settings → Plugins and click the “Install” button for SS Craft membership.

SsMembership Overview

It works with Craft cms User groups and permissions. You must create relevant groups and assign the permissions to each group. i.e. if your website need to setup Super and Premium membership, you need to create User Groups like Super and Premium. Now, create a membership plan and assign a user group with it.

Configuring SS Craft membership

Once you’ve installed the SS Craft Membership plugin. Configure Stripe gateway public and secret keys and save the configuration.

Membership Plan

Membership Plan allow manage user groups for when a user subscribes to a plan. On your Craft CMS Dashboard go to Settings -> Membership Plan

Plugin will automatically create a subscription plan on Stripe Dashboard.

Test mode plans no longer availanle in live mode so that test and live mode membership plans are different.

Using SsMembership

{% if currentUser.isInGroup('groupHandle') %}
    You are allowed to access this content.
{% endif %}

.can() method is helpful when you need to check specific permission or craft cms section permission.

{# example 1 #}

{% if currentUser.can('permissionName') %}
    You are allowed to access this content.
{% endif %}
{# example 2 #}

{% if currentUser.can("createEntries:#{section.uid}") %}
    You are allowed to Create a new section. 
{% endif %}

Twig Templating

Subscribing with User Registration

While user registration, add stripe card payment and membership plan dropdown field. Users will automatically subscribe selected plan after successfully registering.

User Registration Form with membership field:

Stripe Payment Field:
{{ craft.ssMembership.paymentField }}
Membership Plan Field:
{{ craft.ssMembership.planField }}

Subscribe with logged in User:

We have understood how subscription works with registration But what if the user already registered? Users can subscribe membership plan after logging in.

Note, if logged-in Users have already subscribed to any of the subscription plans then are not able to subscribe to another membership plan.

{# Make sure user is logged in #}
{% requireLogin %}
{% set plans = craft.ssMembership.getplan() %}
{% if plans is not empty %}
<form method="post" id="ss-membership-form">
    {{ csrfInput() }}
    {{ hiddenInput( 'action', 'ss-membership/subscription/subscribe' ) }}
    {{ hiddenInput( 'firstName', craft.app.user.identity.firstName ) }}
    {{ hiddenInput( 'lastName', craft.app.user.identity.lastName ) }}
    {{ hiddenInput( 'username', craft.app.user.identity.username ) }}
    {{ hiddenInput( 'email', craft.app.user.identity.email ) }}
    <select name="planUid" required>
        <option value="> Select Plan </option>
        {% for plan in plans %}
            <option value="{{ plan.uid|hash }}"> {{ plan.name }} </option>
        {% endfor %}
    </select>

    {# stripe card payment #}
    {{ craft.ssMembership.paymentField() }}

    <button type="submit" class="button link"> Subscribe </button>
</form>
{% endif %}

Cancel subscription:

Cancel the user's subscription immediately. The customer will not be charged again for the subscription.

Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period unless manually deleted. If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.

For cancel current subscription of logged-in User {% requireLogin %}

A canceled subscription can’t be reactivated again.

{# Make sure user is logged in #}
{% requireLogin %}                                        
{% set subscription = craft.ssMembershipSubscription.getSubscription() %}
{% if subscription is not empty %}
    <form method="post">
        {{ csrfInput() }}
        {{ hiddenInput( 'action', 'ss-membership/subscription/cancel' ) }}
        {{ hiddenInput( 'subUid', subscription.uid|hash ) }}        
        <select name="cancelType" class=">
            <option value="immediately"> Immediately </option>
            <option value="period_end"> Cancel at period end </option>
        </select>        
        <button type="submit" class="button link"> Cancel </button>
    </form>
{% endif %}

Price includes 1 year of updates.
$29/year per site for updates after that.

Installation Instructions

To install this plugin, copy the command above to your terminal.

Active Installs
8
Version
1.0.2
License
Craft
Compatibility
Craft 3, Craft 4
Last release
June 8, 2022
Activity (30 days)
0
Closed Issues
1
Open Issues
0
Merged PRs
0
Open PRs