feat: add Thelia 3 support (bi-compatible with Thelia 2) - #7
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.