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

Subscription Select

Outputs encrypted subscription option sets so selected values cannot be trivially tampered with.

Parameters
name (required)

Name of the generated <select> input.

Common values include:

  • subscription_interval_units
  • subscription_interval_length
  • subscription_start_date
  • subscription_end_date
  • subscription_status
  • subscription_name
  • subscription_description
  • subscription_plan_id
options

Pipe-delimited options to encode.

options="days|weeks|months|years"

Label overrides are supported with value:label syntax.

options="1355133947:Today|1355233947:Tomorrow"
selected

Selected option value.

default

Fallback selected value.

row_id

When selected/default are missing, uses subscription metadata from this cart row (if available).

add_blank

yes/no. When truthy, prepends a blank option labeled ---.

id

HTML id attribute.

class

HTML class attribute.

onchange

HTML onchange attribute.

extra

Additional raw attributes appended to the <select>.

Notes
  • For name="subscription_plan_id", plan options are resolved against available plans.
  • For name="subscription", the generated field name is internally mapped to SUB.
Example
{exp:cartthrob:subscription_select
    name="subscription_interval_units"
    options="days|months"
    selected="{interval_units}"
    class="form-select"
}