How theme plugins work
Themes are ordinary plugins of type"theme". They are loaded by PluginLoader from modules/themes/{slug}/ through the same two-phase lifecycle as addons.
The checkout controller resolves which template to render by applying three filter hooks:
Directory structure
The manifest.json file
The entrypoint class
Brand theme data
The checkout controller callsBrandThemeService::getBrandTheme(int $merchantId) and passes the result as the brand Twig variable:
Twig template development
CSP nonce integration
Full hook reference for themes
Security requirements
- Always use
{{ variable }}(escaped) in Twig, never{{ variable|raw }}for user data - Every
<script>tag must carry the nonce from the container - No
eval()or OS commands - Validate color fields with hex regex
- Use
checkout.csp.sourcesfilter for external domains
Installation and activation
- Package the plugin directory as a ZIP
- Upload via Admin > Appearance > Themes > “Install Theme”
- Activate via the Themes list
- Set as active theme via Admin > Appearance > Themes > “Set Active”
The
active_theme value must match your manifest slug exactly. A mismatch means the system falls back to the built-in own-pay theme.