prestashop/ps_onepagecheckout

PrestaShop module ps_onepagecheckout

Maintainers

Package info

github.com/PrestaShop/ps_onepagecheckout

Type:prestashop-module

pkg:composer/prestashop/ps_onepagecheckout

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 7

dev-main 2026-03-19 17:23 UTC

README

About

ps_onepagecheckout is the native PrestaShop module that provides the one-page checkout experience.

Warning

This module is under heavy development. It is not production-ready and should not be used in live environments.

Compatibility

PrestaShop: 9.0.0 or later.

What the module owns

  • checkout process injection through actionCheckoutBuildProcess,
  • 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.

Code map

Contributing

Before opening a PR:

  1. Regenerate the module autoload when PHP classes move or are added.
  2. Rebuild front assets when changing files under views/js, and commit the generated bundles from views/public (including .LICENSE.txt files).
  3. Run the relevant PHP tests for the area you touched.
  4. Use the decision log and implementation rules as the source of truth for sensitive changes.

Local development

PHP autoload

From the repository root:

composer dump-autoload -d

Front assets

From ps_onepagecheckout/views:

npm install

# Development: rebuild assets on every change under views/js
npm run watch

# Production build: generate bundles consumed by the module
npm run build

When you change any file under views/js:

  • run npm run build to regenerate:
    • views/public/opc-guest-init.bundle.js
    • views/public/opc-address.bundle.js
    • their corresponding *.LICENSE.txt files,
  • and commit both the source changes and the updated files in views/public.

The CI workflow js.yml runs npm run build to ensure the assets remain buildable, and the shared build-release workflow packages the module using the files present in the repository (including the generated bundles).

Testing

PHP test configuration lives in tests/php:

  • unit suite: modules/ps_onepagecheckout/tests/php/phpunit.xml
  • integration suite: modules/ps_onepagecheckout/tests/php/phpunit-integration.xml
  • static analysis helpers: modules/ps_onepagecheckout/tests/php/phpstan.sh

Run PHPUnit in the same isolated Docker environment locally and in GitHub Actions:

./scripts/run-tests.sh unit
./scripts/run-tests.sh integration

The runner expects a prepared PrestaShop checkout in ../prestashop by default. Override it with PS_ROOT_DIR_HOST=/path/to/prestashop when needed. Integration tests provision MySQL automatically inside Docker.

For end-to-end checks, use the dedicated runbook:

Project references

License

This module is released under the Academic Free License 3.0.