Overview
Themes in OpenCart control the visual appearance and user experience of your storefront. OpenCart uses a flexible theme system that allows you to install multiple themes and switch between them, customize templates, and create unique designs for different stores.Theme System Architecture
OpenCart themes are built using:- Twig Templates: Template files with
.twigextension for rendering HTML - CSS Stylesheets: Styling files located in
catalog/view/stylesheet/ - JavaScript: Client-side functionality and interactivity
- Extensions: Theme plugins that extend functionality
Theme Locations
- Core Templates
- Extension Templates
- Stylesheets
Templates for the default theme are stored in:These include:
- Product pages
- Category listings
- Checkout pages
- Common elements (header, footer)
Installing Themes
Access Theme Extensions
Navigate to Extensions → Themes in your admin panel to view available themes.The system scans for theme controllers in:
Install Theme
Click the Install button next to your desired theme. This:
- Registers the theme in the database
- Adds admin permissions for the theme
- Registers autoloader paths
- Calls the theme’s
install()method if it exists
Theme Configuration
Basic Theme Settings
The basic theme controller shows how themes are configured:Multi-Store Configuration
Themes can be configured separately for each store:Each store can use a different theme or different settings for the same theme.
Template Customization
OpenCart allows you to override specific templates without modifying core files.Template Override System
Navigate to Template Manager
Go to Design → Template to access the template customization interface.
Select Template to Override
Choose from available templates:
- Core catalog templates
- Extension templates (prefixed with
extension/) - Stylesheets
Edit Template Code
Modify the template Twig code in the editor. The system:
- Validates the template exists
- Stores your override in the database
- Applies it to the selected store
Template Structure
Theme File Management
Reading Template Files
The template controller loads existing template code:Template Database Storage
CSS Customization
Main Stylesheet
The primary stylesheet is located at:Custom CSS
Add custom CSS through:- Template overrides - Inline styles in template files
- Custom stylesheets - Upload to stylesheet directory
- Theme settings - Some themes include custom CSS fields
Theme Development Best Practices
1. Use Template Overrides
2. Store-Specific Themes
3. Test Before Deploying
- Test templates in a staging environment
- Verify responsive design on multiple devices
- Check cross-browser compatibility
- Validate HTML and CSS
4. Performance Optimization
Theme Management API
Controller Methods
Model Methods
Troubleshooting
Theme Not Displaying
Template Override Not Working
- Verify template status is enabled
- Check route path matches exactly
- Ensure store_id is correct
- Validate Twig syntax
CSS Not Loading
- Check file path and permissions
- Clear browser cache
- Verify stylesheet.css exists
- Check for CSS syntax errors
Related Documentation
- Layout Configuration - Configure page layouts
- Banner Management - Add promotional banners
- SEO Configuration - Optimize for search engines

