jeffsenso/prestashop-skills / skills/prestashop-module-development
prestashop-module-development
VerifiedComplete PrestaShop module development workflow using modern architecture and best practices. Use when: creating new PrestaShop modules, updating legacy modules to modern code, implementing hooks and actions, setting up module configuration pages, adding front office features, handling database operations, implementing security measures, managing translations, creating cart rules and vouchers, building Symfony console commands, or modernizing existing PrestaShop modules from legacy patterns to current standards.
ps9-core-ai/Domain/Order/CONTEXT.md
View on GitHub# Order Domain
## Purpose
Manages the full lifecycle of back-office orders: creation, status changes, product additions/removals, refunds, returns, payments, invoices, shipping, and cart-rule management. Does not own the checkout flow (that belongs to the Cart/Checkout domain).
## Layers
| Layer | Path |
|-------|------|
| Core CQRS | `src/Core/Domain/Order/` — Commands, Queries, QueryResults, ValueObjects, Exceptions; includes sub-domains `Invoice/`, `Payment/`, `Product/` |
| Adapter | `src/Adapter/Order/` — handler implementations, `Refund/`, `Delivery/`, `Checkout/`, `Repository/`, `AbstractOrderHandler.php`, `OrderAmountUpdater.php`, `OrderDetailUpdater.php`, `OrderProductQuantityUpdater.php` |
| Legacy ObjectModel | `classes/order/Order.php` (2701 lines) — do not add logic here |
| Back-office UI | `src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php`, `src/Core/Grid/Definition/Factory/OrderGridDefinitionFactory.php` |
## Non-obvious patterns
- The domain contains three internal sub-domains under `src/Core/Domain/Order/`: `Invoice/`, `Payment/`, and `Product/`, each with their own Commands, CommandHandlers, and Exceptions.
- `AbstractOrderHandler` in the Adapter layer provides shared legacy-ObjectModel helpers (loading Order, Product, Combination, Currency, etc.) used by multiple command handlers.
- Refund logic is split across four dedicated classes in `src/Adapter/Order/Refund/`: calculator, updater, slip creator, and voucher generator — refund commands delegate to this subsystem rather than implementing logic inline.
- `CancellationActionType` defines four mutually exclusive cancellation strategies (cancel, standard refund, partial refund, return) used by `AbstractRefundCommand` subclasses.
- `src/Adapter/Order/Delivery/` and `src/Adapter/Order/GiftOptionsConfiguration.php` handle shop-configuration concerns, not per-order mutations.
- This domain heavily relies on the legacy Cart and `Context::getContext()` stateful approach. A `ContextStateManager` component was developed to manage this — CQRS handlers use it to temporarily set context state during command execution.
## Canonical examples
- `src/Core/Domain/Order/Command/UpdateOrderStatusCommand.php` + `src/Adapter/Order/CommandHandler/UpdateOrderStatusHandler.php`
- `src/Core/Domain/Order/Query/GetOrderForViewing.php` + `src/Adapter/Order/QueryHandler/GetOrderForViewingHandler.php`
## Related
- [CQRS Component](../../Component/CQRS/CONTEXT.md)
- [Grid Component](../../Component/Grid/CONTEXT.md)
- `tests/Integration/Behaviour/Features/Scenario/Order/` — Behat behavior scenarios
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |