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

Debug Info

debug_info is an immediate-execution single tag that outputs CartThrob cart/session debug data for troubleshooting.

Use it only in development or restricted admin/testing contexts, because it can expose sensitive cart/customer/session details.

See also:

Parameters

console

When truthy, outputs a <script> that logs debug data to window.console instead of rendering the on-page debug fieldset.

console="yes"

view_all (legacy anchor)

Kept for compatibility with older snippets/templates.
Current DebugInfoTag implementation does not use view_all.

view_all="yes"

Output

Default output (no console parameter):

  1. <fieldset id="ct_debug_info"> with inline styling
  2. localized legend title (cartthrob_profiler_data)
  3. nested tables of debug keys/values

Special formatting behavior in output:

  1. numeric row keys are labeled as Row ID: {n}
  2. inventory = PHP_INT_MAX is shown as unlimited
  3. empty entry_id is shown as (dynamic item)
  4. item price display includes source context notes

With console="yes":

  1. outputs JavaScript that runs window.console.log(data) when console exists
  2. does not render the styled fieldset/table block

Behavior and Constraints

  1. Tag returns no output unless CartThrob setting show_debug is enabled.
  2. If show_debug is super_admins, only group ID 1 users see output.
  3. Debug payload merges:
    1. cartthrob_session->toArray()
    2. cart->toArray()
  4. Top-level and nested keys are natural-sorted before output.
  5. This tag is for diagnostics only and should not be publicly exposed on production pages.

Example

On-page debug output:

{exp:cartthrob:debug_info}

Console logging mode:

{exp:cartthrob:debug_info console="yes"}