Prestashop: How to remove jquery UI from FO?

Created on 13 Sep 2018  路  1Comment  路  Source: PrestaShop/PrestaShop

Is your feature request related to a problem? Please describe.
OK. So this might be simple but:
I don't need (and frankly don't want) to load +250kb jquery UI in the front office as my theme (a modified Classic) doesn't use it. How do I remove it without altering core code?
Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Most helpful comment

Ok, to answer my own question, it seems that I actually need one componetnt of jQuery UI, the "autocomplete" component to be exact, required by the search bar module. So, if anyone else is wondering if you can switch 250kb of js for 35kb - you can. To do so:

  1. Go here and download a custom build of jqueryUI that contains only the autocomplete component (uncheck all, then check only autocomplete - dependecies will be auto selected).
  2. Download the build (I chose no theme).
  3. Copy it in themes/YOUR_THEME/js/jquery/ui/ with the name jquery-ui.min.js, so the final path is themes/YOUR_THEME/js/jquery/ui/jquery-ui.min.js
  4. If you want to also remove jquery ui style sheets... well, you could copy some empty (/**/)style sheets in themes/YOUR_THEME/js/jquery/ui/base/minified/jquery-ui.min.css and themes/YOUR_THEME/js/jquery/ui/base/minified/jquery.ui.theme.min.css. Or maybe there is a better way, let me know.

>All comments

Ok, to answer my own question, it seems that I actually need one componetnt of jQuery UI, the "autocomplete" component to be exact, required by the search bar module. So, if anyone else is wondering if you can switch 250kb of js for 35kb - you can. To do so:

  1. Go here and download a custom build of jqueryUI that contains only the autocomplete component (uncheck all, then check only autocomplete - dependecies will be auto selected).
  2. Download the build (I chose no theme).
  3. Copy it in themes/YOUR_THEME/js/jquery/ui/ with the name jquery-ui.min.js, so the final path is themes/YOUR_THEME/js/jquery/ui/jquery-ui.min.js
  4. If you want to also remove jquery ui style sheets... well, you could copy some empty (/**/)style sheets in themes/YOUR_THEME/js/jquery/ui/base/minified/jquery-ui.min.css and themes/YOUR_THEME/js/jquery/ui/base/minified/jquery.ui.theme.min.css. Or maybe there is a better way, let me know.
Was this page helpful?
0 / 5 - 0 ratings