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

Template Tags: HTML Helpers

These tags generate reusable HTML UI elements and list data that are commonly used in CartThrob forms and checkout templates.

Select Dropdown Fields

Use these tags when you want CartThrob to output a ready-to-use <select> field.

  • country_select Output a country <select> with configurable name, selected value, sort order, and country-code format options (also used on Checkout page).
  • state_select Output a state/province <select> (optionally filtered by country code) with configurable label/value format (also used on Checkout page).
  • month_select Output a month <select> (commonly used for payment expiration month fields).
  • year_select Output a year <select> from a configurable start year and range.
  • gateway_select Output a payment gateway selector from gateways enabled in store/payment settings (also used on Checkout page).
  • selected_gateway_fields Output gateway fields for the currently selected gateway (or a gateway passed in request/parameters) (also used on Checkout page).
  • gateway_fields Output gateway fields for the currently active gateway context (or a gateway passed in request/parameters) (also used on Checkout page).

Freeform Lists

Use these tag pairs when you want full control over markup (for example <ul>, custom <select>, radios, or cards).

  • countries Loop through country codes and country names.
  • states Loop through state/province values (optionally filtered by country_code).
  • years Loop through a generated year range.

Other