Skip to content

module brakes website fatal JS error → dropdown menus break. #151

Description

@helmand2023

Hello,

We identified a JavaScript bug in the DPD Baltics PrestaShop module that causes frontend failures on PrestaShop 8.x and 9.x.

Issue summary:
Your module loads this script:

/modules/dpdbaltics/views/js/front/modules/supercheckout.js

Inside this file, the code references the legacy PrestaShop global variable:

currentController

Example (around line 33):

if (currentController !== 'supercheckout') {
return;
}

In PrestaShop 8 and PrestaShop 9, the global variable “currentController” no longer exists.
This results in the following fatal JavaScript error:

Uncaught ReferenceError: currentController is not defined

Impact:
This error stops all remaining JavaScript execution on every front-office page.
It breaks theme dropdowns, hover menus, Creative Elements (Elementor) widgets, and other critical frontend scripts.

Root cause:
The script assumes that PrestaShop still defines the variable currentController.
This was removed in PS 1.7.7+ and does not exist in PS 8 or PS 9.

Required fix (for PS 8/9 compatibility):
Please add this fallback at the top of supercheckout.js:

if (typeof window.currentController === 'undefined') {
window.currentController = '';
}

This prevents the ReferenceError and restores correct frontend JavaScript behavior.

File requiring modification:

modules/dpdbaltics/views/js/front/modules/supercheckout.js

Request:
Please include this fix in the next release of the DPD Baltics module to ensure compatibility with PrestaShop 8 and 9.

Thank you!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions