Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zasilkovna / Packeta module does not work with this theme #657

Open
M4RtY opened this issue Oct 26, 2024 · 1 comment
Open

Zasilkovna / Packeta module does not work with this theme #657

M4RtY opened this issue Oct 26, 2024 · 1 comment

Comments

@M4RtY
Copy link

M4RtY commented Oct 26, 2024

Hello,
I have found out interesting issue that is related to the Hummingbird theme. This is official module, and I was trying to install it on "clear" themes (classic and hummingbird). When I switch to classic theme, this module works like a charm, when I activate the hummingbird theme, I am getting the JS errors in console.

Replication steps:

  1. Install module from this repository (official) https://github.com/Zasilkovna/prestashop
  2. Activate the module and connect to delivery option
  3. Create the order and initiate the "Packeta" module
  4. Open console and check the logs

Stacktrace:

Uncaught TypeError: module is null
    initializePacketaWidget https://eshop:8890/modules/packetery/views/js/front.js?v=2.1.20:101
    onShippingLoadedCallback https://eshop:8890/modules/packetery/views/js/front.js?v=2.1.20:403
    <anonymous> https://eshop:8890/modules/packetery/views/js/front.js?v=2.1.20:66
    u https://eshop:8890/themes/core.js:37
    l https://eshop:8890/themes/core.js:37
    setTimeout handler*204/</Deferred/then/a/< https://eshop:8890/themes/core.js:37
    c https://eshop:8890/themes/core.js:37
    fireWith https://eshop:8890/themes/core.js:37
    fire https://eshop:8890/themes/core.js:37
    c https://eshop:8890/themes/core.js:37
    fireWith https://eshop:8890/themes/core.js:37
    ready https://eshop:8890/themes/core.js:37
    Q https://eshop:8890/themes/core.js:37
    204 https://eshop:8890/themes/core.js:37
    204 https://eshop:8890/themes/core.js:37
    204 https://eshop:8890/themes/core.js:37
    a https://eshop:8890/themes/core.js:37
    <anonymous> https://eshop:8890/themes/core.js:37
    <anonymous> https://eshop:8890/themes/core.js:311
    <anonymous> https://eshop:8890/themes/core.js:311

Conclusion:
I know this error comes from the module itself, but it seems that JS is not loaded from the module as expected or there is some conflict. The interesting part is that this module works like a charm with Classic theme, only hummingbird theme is affected. It was not needed to register JS from the module for classic theme and I presume, it should be able to work with the hummingbird theme as well without any compilations.

@SharakPL
Copy link
Contributor

SharakPL commented Nov 8, 2024

Probably another example of a bad result from an unnecessary switch to BEM. I'm guessing the module's scripts use .some-class-selector but in Hummingbird it got changed to .some--class__selector causing expected object to be null. Check the .js scripts of the module and update the selectors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants