Feat: migrate Core OPC to native module#18
Open
ThbPS wants to merge 94 commits into
Open
Conversation
Collaborator
ThbPS
commented
Mar 26, 2026
| Questions | Answers |
|---|---|
| Description? | This PR migrates the latest One Page Checkout changes implemented in Core OPC into the native module. It centralizes OPC JS events and shared selectors, reorganizes AJAX checkout handlers by domain, and keeps the module aligned with Core behavior without changing public routes or JSON contracts. |
| Type? | improvement / refacto |
| BC breaks? | no |
| Deprecations? | no |
| Fixed ticket? | N/A. |
| How to test? | Verify checkout behaviors are unchanged: address refresh, carrier refresh, payment refresh, guest init, final submit, and address modal flows. |
Feat: finish opc migration
- Add segmentio/analytics-php dependency and PHP bootstrap (Segment::init) - Bootstrap from BO configuration context when module is enabled - Add Segment documentation and adjust tests accordingly
… rule
phpstan-strict-rules flags bare array-access expressions whose result is
discarded. Replace $arr['key']; with $arr->offsetGet('key'); — method
calls are not subject to the same rule while still forcing CartLazyArray
to eagerly compute tax-sensitive properties.
…-lazy-array fix: eager-evaluate tax-sensitive cart properties before temp address cleanup
Move Segment PHP write key out of the repository by reading it from PS_OPC_SEGMENT_WRITE_KEY. This prevents local/preprod environments from sending events to the production Segment source when the prod key is not present.
Read Segment write keys from environment variables and select the correct one using APP_ENV. - APP_ENV=prod|production -> SEGMENT_PROD_KEY - otherwise -> SEGMENT_PREPROD_KEY
kevin-carangeot
approved these changes
Apr 9, 2026
Use _PS_MODE_DEV_ to select which Segment write key to load from env. - _PS_MODE_DEV_=true -> SEGMENT_PREPROD_KEY - _PS_MODE_DEV_=false -> SEGMENT_PROD_KEY Also stop tracking .env and provide .env.dist template.
…cher-sync fix(opc): SPE-110 sync pay button amount on voucher changes
- add gift wrapping support - make submit validation state survive reloads and failed submit roundtrips - harden address, carrier, payment and guest flows in the frontend
Introduce Analytics::trackEvent() which bootstraps Segment lazily and tracks events in best-effort mode. Remove Segment bootstrap from hookActionAdminControllerSetMedia so analytics init no longer depends on a PrestaShop hook. Update docs and unit tests accordingly.
… module-specific templates
[SPE-129] Imported needed templates from hummingbird and replaced includes with…
…s can toggle payment button
[SPE-133] Adds OPC submit event
[SPE-134] Added payment_html comparison
[SPE-115] - Problème d'affichage et sauvegarde des champs de la modale
Include the changes from PrestaShopCorp/hummingbirdFork#43 in the module-owned OPC address templates.
Fix: missing OPC checkout templates
Improvement/decouple hummingbird
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.