2.4 KiB
2.4 KiB
Repository Guidelines
Project Structure & Module Organization
This repository is a PrestaShop-based store with customizations across core-like folders and modules.
controllers/,classes/,src/: main PHP application logic (legacy + Symfony-style code).modules/: feature modules (custom and vendor-like). Most front-end build/test tooling lives here.themes/andthemes/leo_gstore/: storefront templates, assets, and theme behavior.override/: PrestaShop overrides; keep changes minimal and well-justified.app/config/,config/: environment and platform configuration.changelog/: dated change notes (for examplechangelog/2026-03-19.md).
Build, Test, and Development Commands
There is no single root build command; use module-scoped workflows.
php -l path\to\file.php: quick PHP syntax check before commit.cd modules\ps_facetedsearch && npm install && npm run dev: install deps and run watch build.cd modules\ps_facetedsearch && npm run build: production JS/CSS bundle.cd modules\ps_facetedsearch && npm test: run Mocha tests (tests/**/*.spec.js).cd modules\gsitemap && composer install: install PHP dev dependencies for that module.
Coding Style & Naming Conventions
- Follow existing PrestaShop conventions: PHP classes in
PascalCase, methods incamelCase, constants inUPPER_SNAKE_CASE. - Keep indentation/style consistent with surrounding file (legacy files vary; do not reformat unrelated code).
- Use descriptive module/template names (example:
AdminSearchController.php,search-results.tpl). - Prefer changes in
modules/orthemes/over editing vendor code invendor/orphpmailer/.
Testing Guidelines
- Test at the smallest valid scope: module-level first, then manual store/admin verification.
- JS tests use
*.spec.js(seemodules/ps_facetedsearch/tests). - Run syntax checks for edited PHP files and exercise affected BO/FO pages (cart, product page, checkout, admin config).
- No global coverage gate is enforced; add/update tests when touching tested modules.
Commit & Pull Request Guidelines
- Prefer clear, typed commits:
feat: ...,fix: ...,chore: .... - Avoid vague messages like
updateorSave. - Keep commits focused to one concern and include touched paths in PR description.
- PRs should include: purpose, risk/rollback notes, manual test steps, and screenshots for UI/theme changes.
- For user-visible behavior changes, add/update a dated file in
changelog/.