Theme Editor
Edit template files and create theme overrides using the built-in Theme Editor in OpenCart 4
Video Tutorial
Video: Using the Theme Editor in OpenCart 4
Introduction
The Theme Editor in OpenCart 4 provides a web‑based interface for editing template files directly from the admin panel. It supports the Twig templating language and lets you modify HTML structure, add custom code, and customize your store’s appearance without FTP access or direct file system modifications. All changes are stored in the database, allowing you to revert or disable them at any time.
Theme Override List

The Theme Override list shows all template overrides currently stored in the database. From here you can:
Add New: Create a new template override
Edit: Modify an existing override
Delete: Remove overrides you no longer need
Filter: Search overrides by store, route, or status
Each entry displays:
Store: Which store the override applies to (default or a specific store)
Route: The template file being overridden (e.g.,
common/header,product/product)Status: Whether the override is active (Enabled) or inactive (Disabled)
Date Added: When the override was created
Actions: Edit or delete buttons
Creating / Editing a Theme Override
When you create or edit a theme override, you fill out a form with the following fields:

Override Configuration
Store: Select which store this override applies to (default or a specific store in multi‑store setups).
Status: Enable or disable the override. Disabled overrides are ignored and the original template is used.
Choose Template: Select the template file you want to override. The list includes:
Default templates: All
.twigfiles fromcatalog/view/template/Extension templates: Templates provided by installed extensions (located in
extension/*/catalog/view/template/)
Code: The Twig template code that will replace the original template content for the selected route.
How Theme Overrides Work
OpenCart 4 uses a template fallback system:
When a page is requested, OpenCart determines which template file should be rendered (e.g.,
catalog/view/template/product/product.twig).Before rendering, the system checks the
themedatabase table for an enabled override that matches the current store and route.If a matching override exists and its status is Enabled, the override’s
codeis used instead of the file content.If no override exists or the override is Disabled, the original template file is rendered.
This mechanism allows you to customize any template without touching the core files, making upgrades safer and reversible.
Template Structure Overview
OpenCart 4 organizes templates in a hierarchical structure:
Store Templates
catalog/view/template/
Frontend store templates
Admin Templates
admin/view/template/
Admin panel templates
Extension Templates
extension/*/view/template/
Extension‑specific templates
Theme Templates
catalog/view/theme/*/template/
Theme‑specific overrides
Twig Template Language Basics
OpenCart 4 uses Twig as its template engine. Below are the essential concepts you need to edit templates successfully.
Best Practices
Common Tasks
Warnings and Limitations
Troubleshooting
Last updated