Move plugindetect.js javascript frontoffice registration from hook displayBeforeBodyClosingTag to displayHeader#38
Conversation
mcaldex
commented
Feb 5, 2026
| Questions | Answers |
|---|---|
| Description? | Fixes the console error "Uncaught ReferenceError: PluginDetect is not defined" caused by the fact that the PluginDetect library .js file cannot be added to the frontoffice using the displayBeforeBodyClosingTag hook |
| Type? | bug fix |
| BC breaks? | no |
| Deprecations? | no |
| Fixed ticket? | |
| How to test? | see browser console the first time you open the frontoffice while this module is enabled: you should see the "Uncaught ReferenceError: PluginDetect is not defined" does not popup anymore. |
…splayBeforeBodyClosingTag to displayHeader
|
@kpodemski hi, I hope this makes sense. thanks |
|
anyways, at the end of the day, this fixes only the insertion of some Guest's properties such as: I'm not sure it those properties are useful anyways, but this still fixes the error in the browser's console which is the main reason I digged a bit and found this issue on my prestashop. |
|
@Touxten @Quetzacoalt91 hey, lmk what you guys think. |
Quetzacoalt91
left a comment
There was a problem hiding this comment.
The changes look good to me, however it would be better to have an issue first to confirm there is an issue to fix.
Add newline at the end of the file for consistency.
Add missing newline at end of file
paulnoelcholot
left a comment
There was a problem hiding this comment.
Hello @mcaldex,
I tested your PR but I have somes problem. I don't found the error "Uncaught ReferenceError: PluginDetect is not defined" with or without your PR. And with your PR, when I inspect the code I don't found plugindetect.
Did I miss something?
Thanks!
PR-2026-03-26_14.22.27.mp4
|
Hi @paulnoelcholot , that's because the error will show up only if there's no id_guest set in the cookie, thus it will only appear on the very first time you open up the frontoffice with your browser. |