Skip to content

feat: add Thelia 3 support (bi-compatible with Thelia 2) - #7

Merged
anoziere merged 5 commits into
thelia-modules:twigfrom
mabruchet:feat/thelia3-migration
Aug 5, 2026
Merged

feat: add Thelia 3 support (bi-compatible with Thelia 2)#7
anoziere merged 5 commits into
thelia-modules:twigfrom
mabruchet:feat/thelia3-migration

Conversation

@mabruchet

Copy link
Copy Markdown

No description provided.

Maxime Bruchet and others added 5 commits July 29, 2026 11:28
Removes the Smarty templates, the three Thelia 2 hook classes and the
isThelia3() gates. The tax engine is injected by type again, so the
structural TaxContextProviderInterface is gone with them.

Translation domains follow the Thelia 3 template directories
(payplugoney.fo.flexy, payplugoney.bo.default-twig). Thelia derives them by
scanning templates/<type>/*, so deleting the default/ directories would have
unregistered the catalogues the Twig templates already relied on.

The front-office stylesheet moves from a Smarty hook template to a plain
asset next to the images it references. Front-office templates now translate
through |payplugoney_trans: |trans resolves against the Symfony translator,
which does not carry module catalogues outside /admin, and the Smarty {intl}
tag used to hide that.
- Back-office logo was a hardcoded asset('assets/modules/payplugoney/...')
  path that nothing populates, so it 404'd. The hook now asks the assets
  resolver, which is what actually deploys the file, and the template skips
  the <img> when resolution fails.
- Correct a claim repeated across comments and the README: Thelia 3 does have
  front-office hooks (ThemeHookInterface + theme_hook()). Only the Smarty ones
  are gone, and a hook fires solely where the active theme declares the point —
  vallereuil-scierie declares none, which is the real reason for the route and
  API based integration.
- OneyEligibilityChecker::toEuros() replaces four open-coded "/ 100", matching
  the class's stated role as the single conversion point.
- Use the inherited $this->translator instead of the Translator singleton.
- Document why OneyService cannot be final: it is injected as a lazy proxy,
  which Symfony builds by subclassing it.
The previous commit claimed Thelia 3 offers usable front-office hooks. It does
not. ThemeHookInterface exists and autoconfigures a thelia.theme_hook tag —
two services carry it — but nothing consumes the tag and no theme_hook() Twig
function is registered anywhere in core, either theme, or any installed module.
The interface is inert, so the route and API based integration is the only
option, not a fallback.
@anoziere
anoziere merged commit d57db97 into thelia-modules:twig Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants