Skip to content

issue with script loading and configurabile products swatches #2

@empiricompany

Description

@empiricompany

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

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