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

Plan Select Field

Renders a <select> dropdown of available subscription plans.

Parameters
name

Form field name. Defaults to plan_id.

include_price

y/n. When enabled, each option label includes formatted plan price.

selected

Selected option value.

default

Fallback selected option if selected is not provided.

add_blank

Adds a blank option at the top of the list. Value is used as the blank label.

id

HTML id attribute.

class

HTML class attribute.

onchange

HTML onchange attribute.

data_style

Rendered as data-style attribute.

aria_label

Rendered as aria-label attribute.

data_placeholder

Rendered as data-placeholder attribute.

Rendered as data-live-search attribute.

title

Rendered as title attribute.

extra

Additional raw attributes appended to the <select>.

Example
{exp:cartthrob:plan_select_field
    name="plan_id"
    id="plan_id"
    class="form-select"
    include_price="y"
    add_blank="Choose a plan"
    data_live_search="true"
    selected="{plan_id}"
}