Overview
OpenCart 4.x extensions follow a standardized directory structure underextension/{vendor}/. Each extension contains separate directories for admin, catalog, and system files.
Directory Structure
Extension Types
| Type | Purpose | Example |
|---|---|---|
payment | Payment gateways | PayPal, Stripe |
shipping | Shipping methods | Flat rate, UPS |
module | Content modules | Featured products, banners |
total | Order total calculations | Tax, shipping, discounts |
theme | Store themes | Custom designs |
fraud | Fraud detection | IP blocking, max orders |
captcha | CAPTCHA systems | reCAPTCHA, Basic CAPTCHA |
currency | Currency converters | ECB, Fixer.io |
report | Reporting tools | Sales reports, analytics |
File Naming Conventions
Namespace Pattern
Examples
Extension Metadata
install.json
Every extension should includeinstall.json:
Example: Payment Extension
Complete file structure for a payment gateway:Routing
Extensions are accessed via extended routes:Next Steps
Creating Modules
Build custom modules
Payment Gateways
Develop payment extensions
Shipping Methods
Create shipping methods
Event System
Use events in extensions

