How do you debug a B2C Commerce storefront during development?
Suggested answer
B2C Commerce provides several debugging approaches at different layers:
1. Storefront Toolkit — a browser overlay activated by appending ?dwft=true or via Business Manager toggle. Shows cache status, content slot assignments, pipeline/controller execution times, and a live log tail for the current request.
2. Prophet Debugger (VS Code extension) — connects to the B2C Commerce Script Debugger API to enable step-through debugging of server-side JavaScript. Set breakpoints in controller and model files and inspect variables in the VS Code Debug panel.
3. Custom logging — use var Logger = require('dw/system/Logger'); then Logger.error('Message: {0}', value); to write to log files. Logs are accessible via Business Manager under Administration > Site Development > Development Setup > Log Files or via WebDAV.
4. ISML errors — ISML template errors appear inline in the browser during development mode and in the error log in production.
Practice content for interview preparation; not an official vendor answer. Verify details against current product documentation.
Community comments (0)
No comments yet.
Sign in or create a free account to add a comment. Comments are moderated before they appear.