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

issue with script loading and configurabile products swatches #2

Open
empiricompany opened this issue Jun 6, 2024 · 0 comments
Open

Comments

@empiricompany
Copy link

Configurable product PDP is broken.

If I reload the page with scroll, I have no errors, and the swatches do not have attached events.

If I reload the page with a scroll > 0, I get this error in the console:

Uncaught ReferenceError: spConfig is not defined
    <anonymous> https://openmage-latest.loc/default/test-configurable.html line 916 > eval:3
    createResponderForCustomEvent https://openmage-latest.loc/js/prototype/prototype.js:7289
    fireEvent_DOM https://openmage-latest.loc/js/prototype/prototype.js:7148
    fire https://openmage-latest.loc/js/prototype/prototype.js:7137
    _methodized https://openmage-latest.loc/js/prototype/prototype.js:456
    fireContentLoadedEvent https://openmage-latest.loc/js/prototype/prototype.js:7324
    createResponder https://openmage-latest.loc/js/prototype/prototype.js:7273
    onload https://openmage-latest.loc/default/test-configurable.html:918
    FbLoadScripts https://openmage-latest.loc/default/test-configurable.html:913
    FbLoadScripts https://openmage-latest.loc/default/test-configurable.html:905
    EventListener.handleEvent* https://openmage-latest.loc/default/test-configurable.html:928
    <anonymous> https://openmage-latest.loc/default/test-configurable.html:928
[test-configurable.html line 916 > eval:3:67](https://openmage-latest.loc/default/test-configurable.html%20line%20916%20%3E%20eval)

Probably, scripts are not executed in the correct order or some events, like DOMContentLoaded, are not fired correctly.

I have encountered a similar problem in this proof of concept extension here:

https://github.com/empiricompany/openmage_pagespeed/blob/master/app/code/community/Pagespeed/Js/Model/Observer.php

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

1 participant