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):
<fieldset id="ct_debug_info">with inline styling- localized legend title (
cartthrob_profiler_data) - nested tables of debug keys/values
Special formatting behavior in output:
- numeric row keys are labeled as
Row ID: {n} inventory = PHP_INT_MAXis shown asunlimited- empty
entry_idis shown as(dynamic item) - item
pricedisplay includes source context notes
With console="yes":
- outputs JavaScript that runs
window.console.log(data)when console exists - does not render the styled fieldset/table block
Behavior and Constraints
- Tag returns no output unless CartThrob setting
show_debugis enabled. - If
show_debugissuper_admins, only group ID1users see output. - Debug payload merges:
cartthrob_session->toArray()cart->toArray()
- Top-level and nested keys are natural-sorted before output.
- 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"}