Skip to main content
OpenCart is built on a powerful extension system that allows you to add, modify, and customize functionality without altering the core codebase. Extensions enable you to add payment gateways, shipping methods, modules, themes, and much more.

What Are Extensions?

Extensions are modular components that extend OpenCart’s functionality. They follow a structured architecture and can be installed, configured, and uninstalled through the admin panel without affecting other parts of your store.

Extension Types

OpenCart supports multiple extension types, each serving a specific purpose:

Payment

Payment gateway integrations for processing customer transactions

Shipping

Shipping method calculators for delivery cost estimation

Module

Display modules for product listings, banners, and content blocks

Theme

Visual themes that control your store’s appearance

Total

Order total modifiers for taxes, discounts, and fees

Report

Analytics and reporting extensions for business insights

Dashboard

Admin dashboard widgets for quick overview

Fraud

Anti-fraud detection systems

Extension Architecture

All extensions in OpenCart follow a consistent MVC (Model-View-Controller) structure:
extension/
└── [vendor]/
    ├── admin/
    │   ├── controller/    # Admin panel logic
    │   ├── model/         # Database interactions
    │   ├── view/          # Admin templates
    │   └── language/      # Admin translations
    └── catalog/
        ├── controller/    # Frontend logic
        ├── model/         # Data access
        ├── view/          # Frontend templates
        └── language/      # Store translations

Namespace Convention

Extensions use PHP namespaces following this pattern:
Opencart\Admin\Controller\Extension\[Vendor]\[Type]\[Name]
Opencart\Catalog\Controller\Extension\[Vendor]\[Type]\[Name]
The default OpenCart extensions use Opencart as the vendor namespace, located in upload/extension/opencart/.

Managing Extensions

Installation

  1. Navigate to Extensions → Extensions in the admin panel
  2. Select the extension type from the dropdown
  3. Find your extension in the list
  4. Click the Install button (green plus icon)
  5. Click Edit to configure the extension settings

Configuration

Each extension has its own configuration page accessible through:
Admin Panel → Extensions → Extensions → [Type] → Edit
Common configuration options include:
  • Status: Enable or disable the extension
  • Sort Order: Control the display/execution order
  • Geo Zone: Limit availability to specific regions
  • Extension-specific settings

Uninstallation

Uninstalling an extension may remove associated data. Always backup your database before uninstalling extensions.
To uninstall:
  1. Go to Extensions → Extensions
  2. Select the extension type
  3. Click the Uninstall button (red minus icon)

Built-in Extensions

OpenCart comes with a comprehensive set of default extensions:
  • Bank Transfer: Accept direct bank transfers
  • Cash on Delivery (COD): Payment upon delivery
  • Cheque: Accept check payments
  • Free Checkout: For zero-value orders
  • Flat Rate: Fixed shipping cost
  • Free Shipping: No shipping charge
  • Item-based: Cost per item quantity
  • Pickup: In-store pickup option
  • Weight-based: Cost calculated by weight
  • Account: Customer account links
  • Banner: Image slider and banners
  • Bestsellers: Popular products display
  • Category: Category navigation
  • Featured: Highlighted products
  • Latest: Recently added products
  • Special: Products on sale
  • And more…

Extension Development

When developing custom extensions:

Controller Structure

Every extension controller extends the base controller class:
namespace Opencart\Admin\Controller\Extension\YourVendor\Payment;

class YourPayment extends \Opencart\System\Engine\Controller {
    public function index(): void {
        // Load language files
        $this->load->language('extension/yourvendor/payment/yourpayment');
        
        // Set page title
        $this->document->setTitle($this->language->get('heading_title'));
        
        // Load view
        $this->response->setOutput($this->load->view('extension/yourvendor/payment/yourpayment', $data));
    }
    
    public function save(): void {
        // Save configuration
        $this->load->model('setting/setting');
        $this->model_setting_setting->editSetting('payment_yourpayment', $this->request->post);
    }
}

Key Methods

  • index(): Display the configuration page
  • save(): Process and save settings
  • install(): Run when extension is installed (optional)
  • uninstall(): Run when extension is uninstalled (optional)

Configuration Storage

Extension settings are stored in the setting table with keys prefixed by type:
payment_{code}_{setting}
shipping_{code}_{setting}
module_{code}_{setting}

Extension Marketplace

OpenCart has an official marketplace where you can:
  • Browse thousands of third-party extensions
  • Purchase premium extensions
  • Download free extensions
  • Read reviews and ratings
  • Get support from developers
Visit the marketplace at: https://www.opencart.com/index.php?route=marketplace/extension

Best Practices

Use Namespaces

Always use proper namespace conventions to avoid conflicts with other extensions

Language Files

Store all text strings in language files for easy translation

Permission Checks

Validate user permissions before modifying data

Error Handling

Implement proper validation and error handling

Next Steps

Explore specific extension types:

Build docs developers (and LLMs) love