Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
6650a0e
feat: migrate Core OPC to native module
ThbPS Mar 26, 2026
d3c9b4c
fix: CI tests
ThbPS Mar 26, 2026
4993b28
feat: migrate Core addresses handling to native module
ThbPS Apr 7, 2026
c32624c
feat: handle OPC final submit
ThbPS Apr 8, 2026
7a3ded7
Merge pull request #21 from PrestaShop/feat/finish-opc-migration
ThbPS Apr 8, 2026
597a8bd
feat(analytics): add Segment PHP client bootstrap
dylanDenizonPresta Apr 8, 2026
2689530
fix(opc): SPE-109 eager-evaluate cart lazy properties before temp add…
julienr114 Apr 8, 2026
78b3f28
fix(opc): use offsetGet() to satisfy PHPStan strict no-noop-statement…
julienr114 Apr 8, 2026
75235c8
style: apply PHP CS Fixer (constructor, blank lines)
dylanDenizonPresta Apr 8, 2026
01fde55
Merge pull request #22 from PrestaShop/SPE-109/fix-opc-tax-stale-cart…
ThbPS Apr 9, 2026
25aa8a2
fix(analytics): read Segment write key from env
dylanDenizonPresta Apr 9, 2026
c0c74c4
fix(refacto): unreachable condition
ThbPS Apr 9, 2026
456428e
fix(analytics): select Segment key by APP_ENV
dylanDenizonPresta Apr 9, 2026
a080b46
docs(analytics): document APP_ENV key selection
dylanDenizonPresta Apr 9, 2026
6514452
chore: add .env with Segment keys and APP_ENV
dylanDenizonPresta Apr 9, 2026
2cd46f6
fix(opc): SPE-110 sync pay button amount on voucher changes
julienr114 Apr 10, 2026
a782952
test(opc): update import assertion to match merged runtime imports
julienr114 Apr 10, 2026
0c4f2ca
fix(analytics): select Segment key by _PS_MODE_DEV_
dylanDenizonPresta Apr 13, 2026
2f699d8
chore: remove .env.dist
dylanDenizonPresta Apr 13, 2026
b8a3178
fix Env
dylanDenizonPresta Apr 13, 2026
9009007
Merge pull request #25 from PrestaShop/fix/SPE-110-opc-pay-button-vou…
ThbPS Apr 14, 2026
2914058
feat(opc): improve checkout robustness and error recovery
ThbPS Apr 15, 2026
8782545
Merge branch 'SPE-72/opc-migration' into SPE-108/feat/ui-errors-manag…
ThbPS Apr 15, 2026
94e38d6
fix: js assets merge conflict
ThbPS Apr 15, 2026
b44dfa2
fix: linter & unit test
ThbPS Apr 15, 2026
fe6e0c3
refactor(analytics): init Segment on-demand
dylanDenizonPresta Apr 16, 2026
b2acee4
Merge branch 'SPE-72/opc-migration' into SPE-105/segment-php-bootstrap
dylanDenizonPresta Apr 17, 2026
f4e3460
Fix md translation
dylanDenizonPresta Apr 17, 2026
f57f5f4
Merge pull request #23 from PrestaShop/SPE-105/segment-php-bootstrap
dylanDenizonPresta Apr 17, 2026
1a0199a
clean branch based on spe-25
sylardiere Apr 20, 2026
366238e
persist custom form field
sylardiere Apr 20, 2026
41e3e3f
[SPE-83] feat(analytics): track OPC critical errors (#28)
dylanDenizonPresta Apr 20, 2026
b9767c8
Merge pull request #35 from PrestaShop/SPE-25-clean
sylardiere Apr 20, 2026
559dc15
use DeliveryOptionsProvider when improved shipment is enabled
sylardiere Apr 20, 2026
cc14aff
lint
sylardiere Apr 21, 2026
90dbd66
Merge branch 'SPE-72/opc-migration' into SPE-30
sylardiere Apr 21, 2026
d1b8507
Merge pull request #34 from PrestaShop/SPE-30
sylardiere Apr 21, 2026
e665a3f
Merge branch 'SPE-72/opc-migration' into SPE-115
sylardiere Apr 22, 2026
67f4365
Merge branch 'SPE-72/opc-migration' into SPE-108/feat/ui-errors-manag…
ThbPS Apr 23, 2026
f0d92ad
fix: linter
ThbPS Apr 23, 2026
949e547
[SPE-81] feat(analytics): track OPC module lifecycle and checkout lay…
dylanDenizonPresta Apr 23, 2026
7dd97de
[SPE-82] feat(analytics): track Checkout Started and Checkout Complet…
dylanDenizonPresta Apr 23, 2026
52ca523
Merge branch 'SPE-72/opc-migration' into SPE-108/feat/ui-errors-manag…
kevin-carangeot Apr 23, 2026
7ec4b73
fix: trackEvent params
kevin-carangeot Apr 23, 2026
fedb052
fix: refresh carrier prices on gift wrapping toggle
kevin-carangeot Apr 23, 2026
120c99b
fix(analytics): fix trackCheckoutStarted/Completed calling trackEvent…
dylanDenizonPresta Apr 23, 2026
c993115
Merge pull request #37 from PrestaShop/fix/SPE-82-phpstan-trackEvent-…
ThbPS Apr 23, 2026
faf1907
Merge branch 'main' into SPE-72/opc-migration
ThbPS Apr 23, 2026
18cd18b
fix: correct shipping price when toggling gift wrapping without a sav…
kevin-carangeot Apr 24, 2026
12a65fc
POC Decouple OPC from Hummingbird
kpodemski Apr 28, 2026
0520d6e
fix: refresh carrier prices on gift wrapping toggle
kevin-carangeot Apr 28, 2026
498e2be
Merge branch 'SPE-72/opc-migration' into SPE-108/feat/ui-errors-manag…
kevin-carangeot Apr 29, 2026
b33e2f6
fix: cs fixer
kevin-carangeot Apr 29, 2026
ac51422
fix(opc): centralize ajax error handling and submit persistence
ThbPS May 4, 2026
661f860
fix: UTs & linter
ThbPS May 4, 2026
7006d2c
test: add unit stub for checkout provider interface
ThbPS May 4, 2026
381fadc
fix: [SPE-126] Address Duplication + Display of country
kevin-carangeot May 4, 2026
75269d3
fix: [SPE-127] Duplicate hook address fields for billing section
kevin-carangeot May 5, 2026
8c0caf4
fix(opc): restore module-owned checkout templates and handle displayC…
ThbPS May 5, 2026
a7f3f4a
Merge pull request #29 from PrestaShop/SPE-108/feat/ui-errors-managment
ThbPS May 5, 2026
2643607
fix: [SPE-128] Re-apply use_same_address constraints after address li…
kevin-carangeot May 5, 2026
e92de1d
fix: bundle
kevin-carangeot May 5, 2026
311922c
Merge branch 'SPE-72/opc-migration' into SPE-115
kevin-carangeot May 5, 2026
d98a841
fix: bundle
kevin-carangeot May 5, 2026
99d1173
Imported needed templated from hummingbird and replaced includes with…
L3RAZ May 19, 2026
bc06004
Added hook for overriding checkout template
L3RAZ May 19, 2026
525fd78
Address feedback
L3RAZ May 20, 2026
ae3d9d7
removed is_one_page_checkout_enabled checks for classes
L3RAZ May 20, 2026
3e7ebb8
Replaced template copies with import from theme
L3RAZ May 20, 2026
794575f
Added back form-fields-row and removed file param from form-field
L3RAZ May 20, 2026
7b25d8f
Merge pull request #46 from PrestaShop/SPE-129
ThbPS May 21, 2026
8a44e26
Added wrappers for payment button and conditions checkboxes so core.j…
L3RAZ May 19, 2026
9a0d13b
Added OPC submit event
L3RAZ May 20, 2026
267636c
Implemented function export instead of event emits
L3RAZ May 22, 2026
9b406c3
Apply feedback
L3RAZ May 26, 2026
a619f90
Merge pull request #47 from PrestaShop/SPE-133
L3RAZ May 26, 2026
cbfedef
Added payment_html comparison
L3RAZ May 20, 2026
b46af43
Reworked payment option loader to not overwrite payment dom
L3RAZ May 21, 2026
82ff114
Reintroduced fetchPaymentMethods because it no longer emits duplicate…
L3RAZ May 21, 2026
0112a5e
Apply feedack
L3RAZ May 22, 2026
d17513c
Added new event for refreshing button state after payment fetch
L3RAZ May 22, 2026
a66f238
Merge pull request #48 from PrestaShop/SPE-134
L3RAZ May 26, 2026
8631944
Merge pull request #33 from PrestaShop/SPE-115
ThbPS May 26, 2026
c58ff4d
fix: prefix OPC form field row classes
ThbPS May 26, 2026
ece5419
fix: port Hummingbird address modal fields fix
ThbPS May 26, 2026
33c315d
Merge pull request #41 from PrestaShop/spe-125/fix/missing-templates
ThbPS May 26, 2026
d30d99b
Merge branch 'SPE-72/opc-migration' into improvement/decouple-humming…
ThbPS May 26, 2026
961ce6e
fix: build js bundles
ThbPS May 26, 2026
2c12b60
fix(unit-tests): legacy classes stubs
ThbPS May 26, 2026
6739602
ci: run PHPStan against PS develop
ThbPS May 26, 2026
5719f62
fix: prepare PHPStan module
ThbPS May 26, 2026
9338d5a
fix: PHPStan tests cache
ThbPS May 26, 2026
dab7c87
Merge pull request #54 from PrestaShop/improvement/decouple-hummingbird
ThbPS May 26, 2026
a8e25b9
Merge branch 'main' into SPE-72/opc-migration
L3RAZ Jun 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SEGMENT_PREPROD_KEY=S3Vk6KAg6wilMfSKfr4JKNGgPYD7L97W
SEGMENT_PROD_KEY=Xn1VxRGYASE3pFBODAmSOs3qkXQ6mKW5
49 changes: 21 additions & 28 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
presta-versions: ['latest']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -48,11 +44,24 @@ jobs:
- name: Checkout
uses: actions/checkout@v5

- name: Checkout PrestaShop core develop
uses: actions/checkout@v5
with:
repository: PrestaShop/PrestaShop
ref: develop
path: prestashop-core

- name: Install PrestaShop core dependencies
working-directory: prestashop-core
run: composer install --no-interaction --prefer-dist

- name: Install dependencies
run: composer install

- name: Execute PHPStan on PrestaShop (Tag ${{ matrix.presta-versions }})
run: ./tests/php/phpstan.sh ${{ matrix.presta-versions }}
- name: Execute PHPStan on PrestaShop develop
env:
PS_ROOT_DIR_HOST: ${{ github.workspace }}/prestashop-core
run: ./tests/php/phpstan.sh latest

unit-tests:
name: Unit tests
Expand All @@ -62,9 +71,9 @@ jobs:
matrix:
prestashop:
# Keep the checkout ref and Docker image tag aligned when adding more supported versions.
- label: latest
image_tag: latest
core_ref: ''
- label: 9.1.0
image_tag: 9.1.0
core_ref: 9.1.0
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -74,15 +83,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v5

- name: Checkout PrestaShop core (default branch)
if: ${{ matrix.prestashop.core_ref == '' }}
uses: actions/checkout@v5
with:
repository: PrestaShop/PrestaShop
path: prestashop-core

- name: Checkout PrestaShop core (${{ matrix.prestashop.core_ref }})
if: ${{ matrix.prestashop.core_ref != '' }}
uses: actions/checkout@v5
with:
repository: PrestaShop/PrestaShop
Expand All @@ -106,9 +107,9 @@ jobs:
matrix:
prestashop:
# Keep the checkout ref and Docker image tag aligned when adding more supported versions.
- label: latest
image_tag: latest
core_ref: ''
- label: 9.1.0
image_tag: 9.1.0
core_ref: 9.1.0
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -118,15 +119,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v5

- name: Checkout PrestaShop core (default branch)
if: ${{ matrix.prestashop.core_ref == '' }}
uses: actions/checkout@v5
with:
repository: PrestaShop/PrestaShop
path: prestashop-core

- name: Checkout PrestaShop core (${{ matrix.prestashop.core_ref }})
if: ${{ matrix.prestashop.core_ref != '' }}
uses: actions/checkout@v5
with:
repository: PrestaShop/PrestaShop
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/translations/*.php
/node_modules
/tests/e2e/node_modules
/tests/e2e/artifacts
/tests/e2e/.env
/vendor
/views/node_modules
/.php_cs.cache
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ PrestaShop: `9.0.0` or later.
- front office AJAX endpoints for guest initialization and address form refresh,
- back office configuration for enabling or disabling one-page checkout,
- checkout layout configuration assets and templates shipped by the module,
- checkout runtime flag exposure for the order page.
- checkout runtime flag exposure for the order page,
- optional Segment PHP client bootstrap (`segmentio/analytics-php`) on module configuration pages (see [`docs/SEGMENT.md`](./docs/SEGMENT.md)).

## Code map

Expand All @@ -41,11 +42,12 @@ Before opening a PR:

## Local development

### PHP autoload
### PHP dependencies and autoload

From the repository root:
From the repository root, install Composer dependencies (required for `segmentio/analytics-php` and the module autoload):

```bash
composer install -d
composer dump-autoload -d
```

Expand Down Expand Up @@ -101,6 +103,7 @@ For end-to-end checks, use the dedicated runbook:

- implementation rules: [`docs/RULES.md`](./docs/RULES.md)
- architectural decisions: [`docs/DECISIONS.md`](./docs/DECISIONS.md)
- Segment (configuration & usage): [`docs/SEGMENT.md`](./docs/SEGMENT.md)
- translations (i18n): [`docs/TRANSLATIONS.md`](./docs/TRANSLATIONS.md)
- contributors: [`CONTRIBUTORS.md`](./CONTRIBUTORS.md)

Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
}
],
"require": {
"php": ">=8.1"
"php": ">=8.1",
"segmentio/analytics-php": "^3.0"
},
"require-dev": {
"prestashop/php-dev-tools": "^4.3"
Expand All @@ -27,7 +28,8 @@
},
"classmap": [
"ps_onepagecheckout.php",
"controllers/"
"controllers/",
"src/Checkout/Ajax/"
]
},
"scripts": {
Expand Down
75 changes: 70 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions controllers/admin/AdminPsOnePageCheckoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ public function initContent()
{
parent::initContent();

if (!$this->viewAccess()) {
return;
}

$configurationContent = $this->getBackOfficeConfigurationContent();
if ($configurationContent !== '') {
$this->content .= $configurationContent;
Expand All @@ -36,6 +40,11 @@ protected function getBackOfficeConfigurationContent(): string
return $this->module->getBackOfficeConfigurationContent();
}

public function viewAccess($disable = false)
{
return $this->hasLegacyViewAccess((bool) $disable) && $this->hasModuleConfigurePermission();
}

public function getTwig(): ?Environment
{
try {
Expand All @@ -50,4 +59,14 @@ public function getTwig(): ?Environment

return $legacyControllerContext->getTwig();
}

protected function hasLegacyViewAccess(bool $disable = false): bool
{
return parent::viewAccess($disable);
}

protected function hasModuleConfigurePermission(): bool
{
return $this->module->getPermission('configure', $this->context->employee ?? null);
}
}
Loading
Loading