Support » Plugin: PrestaShop Integration » 2 problems with javascript ignition in header

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author aytechnet



    This plugin is light on CSS/JS integration : it only adds the CSS and JS if the corresponding configuration enable it.

    It does not try to be clever by reconfiguring PrestaShop JS or WordPress JS. (only JS can be tedious as some libraries may conflict together).
    So if you add a plugin in WordPress that requires JQuery, the plugin will make WordPress fetch it even if it is already loaded by PrestaShop. You need to fix by hand theses problems : generally it is better to use only PrestaShop JS and deactivate the WordPress one (because PrestaShop will not work anymore if you use an already well up-to-date Jquery, which WordPress generally is bundled with). So you may need to use : wp_deregister_script to disable the WordPress one.

    For loading PrestaShop one : the easiest way will be to edit FrontController class to add the needed Javascript, it is ugly but PrestaShop Integration plugin create a dummy Controller class which inherit the FrontController of PrestaShop. So adding the necessary stuff in FrontController will make it available for WordPress as well. It would be nicer to add a specific hooks in functions.php of your WordPress theme (so it is a feature request).

    Kind Regards,

    Thank you Fran├žois,

    I have deregistered jQuery but I have still a difference between the root and the single post js+css ( and ) and the category listing js+css ( – which seems to be the right one).

    How can I have the same js+css in both?


    ok, I have found a little more info to solve the problem:

    – in the root and the single post the js and css loaded are the prestashop ones and the wordpress one are not loaded;
    – in the category listing js and css are the wordpress ones and the prestashop ones are not loaded.

    Is it possible to load in both cases the prestashop and the wordpress js+css at the same time?


    ok, I have found the error: in the configuration page in the field “PrestaShop path:” I have written “../” because I have wordpress in a subdirectory called blog.

    I tried to find the way to write an absolute path but with no success.

    What’s the right way to insert the absolute path?

    Best Regards,

    ok, resolved…
    … it was a code snippet left on another integration trial…

    Now everything works well!



Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘2 problems with javascript ignition in header’ is closed to new replies.