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

Removed jQuery dependencies from swatches in RWD theme #3824

Merged
merged 7 commits into from
Apr 18, 2024

Conversation

empiricompany
Copy link
Contributor

@empiricompany empiricompany commented Feb 11, 2024

Description (*)

With this PR, it is possible to extend RWD Theme by inheriting the swatches functionality without the need to unnecessarily load jQuery.

Fixed Issues (if relevant)

  1. Fixes OpenMage/magento-lts#<issue_number>

Manual testing scenarios (*)

  1. Comment out jQuery lib in the page.xml file.
            <block type="page/html_head" name="head" as="head">
                <action method="addJs"><script>prototype/prototype.js</script></action>
                <!-- <action method="addJs"><script>lib/jquery/jquery-1.12.4.min.js</script></action>
                <action method="addJs"><script>lib/jquery/noconflict.js</script></action> -->
  1. Test swatches in product list and PDP.
    In both cases image gallery must swap with selected option, in PDP price must change if there is a supplement.

PS: It should work in both cases, with and without jQuery.
It is normal to have a lot of console errors related to jQuery used in other JavaScript.

Questions or comments

It has been very helpful for creating lightweight themes. In the future, if we can also eliminate PrototypeJs from the libraries used for configurable products as well, it would be awesome.

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)
  • Add yourself to contributors list

@github-actions github-actions bot added the Template : rwd Relates to rwd template label Feb 11, 2024
@empiricompany empiricompany changed the title Rewrite configurable swatches rwd feature without jQuery Remove jQuery dependencies from swatches in RWD theme Feb 11, 2024
@fballiano
Copy link
Contributor

I starting to test this PR and so far seems to work great. I'd prefer to have it on next tho although technically it's not a breaking change, opinions?

@empiricompany
Copy link
Contributor Author

In my themes, that don't depend on jquery, I always have to make these changes

@fballiano fballiano changed the title Remove jQuery dependencies from swatches in RWD theme Removed jQuery dependencies from swatches in RWD theme Apr 18, 2024
Copy link
Contributor

@fballiano fballiano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from my tests I couldn't see anything wrong with this PR

@fballiano fballiano merged commit ca663ca into OpenMage:main Apr 18, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Template : rwd Relates to rwd template
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants