Thanks for your interest in improving OpenCart! This guide explains the workflow, tooling, and expectations we follow in this repository so your pull requests can be reviewed and merged quickly.
- Search first: look through existing issues, discussions, and the forum before opening a new ticket.
- Security reports: never open public issues for vulnerabilities. Follow the instructions in
README.md("Reporting a bug" section) and contact the moderator team privately. - Large features: discuss significant changes in an issue or discussion thread before coding to confirm direction and scope.
OpenCart 4.1 requires PHP 8.0+.
Use the supplied Makefile wrappers around docker compose:
make init # first run only – copies docker/.env.docker.example
make build # build PHP/Apache/MySQL images
make up # start the stack (add `profiles="redis"` etc. to include extras)
make php # open a shell in the PHP container as www-data
make logs # tail all service logs
make down # stop and remove containersOnce the stack is running, visit http://localhost, complete the installer (creates upload/config.php + upload/admin/config.php), and delete upload/install/.
If you run OpenCart without Docker you must still provide:
- PHP 8.0+ with extensions:
curl,gd,zip(seeINSTALL.mdfor OS-specific notes). - MySQL (or compatible) database.
- Web server pointing to
upload/as the document root.
Install PHP dependencies locally by running:
composer install --no-interactionThis installs libraries into upload/system/storage/vendor/ as configured in composer.json.
Run the same checks as CI before opening a PR (see .github/workflows/Lint.yml). From the repo root:
# Syntax lint (skips bundled vendor code)
find upload -type f -name "*.php" ! -path 'upload/system/storage/vendor/*' -exec php -l -n {} +
# Static analysis (level 6, uses tools/phpstan.phar)
php tools/phpstan.phar analyze --no-progress
# Code style (php-cs-fixer)
php tools/php-cs-fixer.phar fix --dry-run --diff --ansiIf php-cs-fixer reports issues, run it again without --dry-run to apply the fixes and commit the result.
- Follow the custom MVC-A pattern (
controller,model,view,language) described indocs/developer/and summarized in.github/copilot-instructions.md. - Use the loader/registry services (
$this->load,$this->config,$this->db, etc.) instead of manual includes. - Reference existing models (e.g.,
catalog/model/catalog/product) before writing raw SQL. - Namespace files under
Opencart\{Application}\...according to their location (catalog,admin,extension).
- Fork the repository and clone your fork.
- Create a branch from
master, e.g.feature/cart-apiorfix/seo-url-regression. - Commit clearly: use imperative subject lines and include context in the body when needed.
- Keep diffs focused: avoid formatting-only changes unless that is the purpose of the PR.
- Rebase onto the latest
masterbefore opening or updating your PR to keep history clean.
When opening a PR:
- Fill out the template (if provided) with motivation, testing notes, and any regressions mitigated.
- Reference related issues using
Fixes #1234where appropriate. - Attach screenshots or short clips for UI changes.
String translations are managed through Crowdin (crowdin.yml). Please submit translation updates via the OpenCart Crowdin project instead of direct pull requests. PRs that edit upload/catalog/language/* or upload/admin/language/* files will generally be closed in favor of the official localization workflow.
- Install/upgrade:
INSTALL.md,UPGRADE.md. - Docker details:
README.mdanddocker/directory. - Framework internals:
docs/developer/**(module guide, loader usage, etc.). - Coding standards: https://github.com/opencart/opencart/wiki/Coding-standards
- Module development: https://docs.opencart.com/en-gb/developer/module/
The project follows MAJOR.MINOR.FEATURE.PATCH (see README.md). If your change breaks backward compatibility or introduces new extension points, call it out explicitly in the PR description and update CHANGELOG.md when requested by maintainers.
- Add regression tests when practical (e.g., covering model/controller edge cases).
- Explain reproduction steps in the PR and link any forum/issue references.
- Confirm whether the fix impacts both
catalog/andadmin/contexts.
Core stays intentionally slim. Consider whether your idea belongs in an extension under upload/extension/ and follow the module guidelines. Avoid modifying system/ core classes unless directed; prefer events or extension hooks.
Be respectful in issues, PRs, discussions, and community forums. The maintainer team may close reports that are abusive, spammy, or unrelated to OpenCart core.
We appreciate every contribution—documentation, bug fixes, features, translations, and triage all help keep OpenCart healthy. Thank you for helping us build an excellent e-commerce platform!