CartThrob 10 documentation for ExpressionEngine commerce teams Visit CartThrob.com
CartThrob.com

Plans

The plans tag outputs data related to available global subscription plans.

Editing a Plan

Plan edits supply terms for new subscribers and customers moving to that Plan through change_plan_form; they no longer replace an existing Subscription’s renewal terms. Renewals use the name, description, billing interval, trial terms and permissions stored on the Subscription at purchase. In 5.x, current Plan values were merged over the Subscription at each rebill, but the Subscription’s stored price always took precedence: changing a Plan price did not change existing customers’ prices in either version. Saving Plan permissions still explicitly synchronizes permission assignments for existing subscribers; see Editing Plan Permissions.

Parameters
limit

The number of plans to display. Defaults to 100.

plan_id

Filter to one or more plan IDs. Pipe-delimited values are supported.

plan_id="3|7|9"
sort

The plan field to order by. Defaults to id and sorts descending.

sort="id"
Variables

id

Plan ID

status

Outputs the current status of this subscription plan.

name

The descriptive name of the plan.

description

A description of the plan.

total_occurrences

The total number of occurrences that will be billed with this plan. Leaving Total Occurrences blank in the Control Panel or entering 0 means unlimited billing occurrences.

trial_occurrences

The total number of times the trial price should be billed switching to the standard price.

trial_occurrences_numeric

The numeric number of trial periods; 0 means no trial. Use this to decide whether to describe a trial, including a free trial whose price is zero. These trial periods apply to Plans. On a product using a Subscription Settings field, the trial price applies to the first payment only; that field has no trial billing interval.

trial_interval_length and trial_interval_units

The length and unit of each trial period. These can differ from the regular billing interval. Units are days, weeks, months or years; see Billing intervals.

interval_length

This is the rebill periodicity. Generally this will be 1 (for once a month). By default it will be 1.

interval_units

This is the rebill period: days, weeks, months or years. Defaults to months if not set. See Billing intervals.

allow_modification

Integer boolean (1 or 0) indicating whether new Subscriptions created from this Plan should allow the customer to use change_plan_form. New Plans default to 1. The change-plan form ultimately checks the value stored on the individual Subscription.

price

The formatted amount of the subscription plan.

trial_price

The formatted trial price of the subscription plan.

price_numeric

The numeric subscription amount.

trial_price_numeric

The numeric trial price.

price_per_day

Formatted per-day cost derived from price, interval_length, and interval_units.

member_has_plan

Integer boolean (1 or 0) indicating whether the logged-in member currently has a subscription on this plan.

{if no_results}

Rendered when no plans match your filter.

Plan-only checkout forms

A plan-only add_to_cart_form needs no entry_id. CartThrob 10.0.1 accepts a signed form that has no product entry; it still rejects a submission that supplies a real entry_id for a plan-only form.

Example
{exp:cartthrob:plans plan_id="3|7" sort="id" limit="10"}
    {id}
    {name}
    {description}
    {total_occurrences}
    {allow_modification}
    {interval_units}
    {interval_length}
    {trial_occurrences}
    {price}
    {price_per_day}
    {member_has_plan}

    {if no_results}
        No plans are currently available.
    {/if}
{/exp:cartthrob:plans}