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

Gateway Fields

{exp:cartthrob:gateway_fields} outputs gateway-specific HTML form fields for the currently active payment gateway.

This tag is typically used inside checkout templates to render payment fields required by the selected gateway.

See also:

Parameters

This tag has no tag-specific parameters.

Output

Returns HTML markup generated by the active payment gateway integration.

Use this output directly in checkout form templates where gateway fields should appear.

Behavior and Constraints

  1. Output comes directly from ee()->api_cartthrob_payment_gateways->gateway_fields().
  2. Rendered fields depend on the currently selected/active gateway context.
  3. This tag is commonly used in checkout template flows.
  4. For dynamic gateway switching in AJAX or selected-gateway flows, use related patterns with selected_gateway_fields and gateway_fields_url.

Examples

Basic checkout usage:

{exp:cartthrob:checkout_form return="store/order_info"}
    {exp:cartthrob:gateway_fields}
    <button type="submit">Place Order</button>
{/exp:cartthrob:checkout_form}

Twig checkout usage (render raw HTML):

{{ exp.cartthrob.gateway_fields() | raw }}