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

Plugin Settings (tag pair)

plugin_settings outputs saved settings values for a selected CartThrob plugin.

Use this when you need plugin configuration values in templates (for example a shipping, tax, or payment plugin setting).

See also:

Parameters

type

Plugin group to inspect.

Supported values:

  • payment
  • shipping
  • tax

    type=”payment”

plugin

Plugin identifier to load settings for.

Both short and class-style names are supported by current lookup logic (for example stripe or Cartthrob_stripe, depending on plugin type and stored config values).

plugin="stripe"

Variables

Settings are returned as template variables from the plugin settings array.

There is no fixed universal variable list; keys depend on the plugin’s own settings definition.

Examples of plugin-specific keys seen in code:

  • shipping single_flat_rate: rate
  • tax standard: default_tax
  • payment ct_offline_payments: processing_status

Behavior and Constraints

  1. This is a tag pair intended for variable output from plugin settings.
  2. Both type and plugin parameters are required.
  3. If either required parameter is missing, the tag uses noResults('plugin_settings') flow.
  4. type routing is strict:
    1. payment => payment plugin lookup
    2. shipping => shipping plugin lookup
    3. tax => tax plugin lookup
  5. Payment lookup:
    1. plugin must be in enabled_gateways
    2. settings are loaded from Cartthrob_{plugin}_settings, fallback {plugin}_settings
  6. Shipping lookup:
    1. plugin must match active shipping_plugin
    2. settings are loaded from Cartthrob_shipping_{plugin}_settings, fallback {plugin}_settings
  7. Tax lookup:
    1. plugin must match active tax_plugin
    2. settings are loaded from Cartthrob_tax_{plugin}_settings, fallback {plugin}_settings
  8. If plugin lookup fails, output is lang('plugin_not_found').
  9. If settings are found, tag parses one variable row from that settings array.

Usage note from codebase review:

No direct installer/stub template usage for this template tag was found in current repository templates. It is available in code and useful for advanced/custom template flows.

Examples

Shipping plugin settings (single flat rate):

{exp:cartthrob:plugin_settings type="shipping" plugin="single_flat_rate"}
    Shipping base rate: {rate}
{/exp:cartthrob:plugin_settings}

Tax plugin settings (standard):

{exp:cartthrob:plugin_settings type="tax" plugin="standard"}
    Default tax: {default_tax}
{/exp:cartthrob:plugin_settings}

Payment plugin settings (offline payments):

{exp:cartthrob:plugin_settings type="payment" plugin="ct_offline_payments"}
    Processing status: {processing_status}
{/exp:cartthrob:plugin_settings}