WordPress.org

Ready to get started?Download WordPress

Forums

PrestaShop Integration
[resolved] 2 problems with javascript ignition in header (7 posts)

  1. andrearuffini
    Member
    Posted 1 year ago #

    Hi,
    I have 2 problems with javascript:
    - first: how can I load wordpress specific javascripts in header?
    - second: when I click on a category to access all posts with the same category the plug-in do not load prestashop javascript but instead the wordpress specific ones; css instead are correctly loaded.

    If you want to see the pages:
    - store.marioscrafts.com/blog/category/eventi/

    Thanks,
    Andrea

    http://wordpress.org/extend/plugins/prestashop-integration/

  2. aytechnet
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,

    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,
    Fran├žois.

  3. andrearuffini
    Member
    Posted 1 year ago #

    Thank you Fran├žois,

    I have deregistered jQuery but I have still a difference between the root and the single post js+css (http://store.marioscrafts.com/blog/ and http://store.marioscrafts.com/blog/design-mostra-marios-ancora-ospite-di/ ) and the category listing js+css (http://store.marioscrafts.com/blog/category/blog/ - which seems to be the right one).

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

    Regards,
    Andrea

  4. andrearuffini
    Member
    Posted 1 year ago #

    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?

    Andrea

  5. andrearuffini
    Member
    Posted 1 year ago #

    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,
    Andrea

  6. andrearuffini
    Member
    Posted 1 year ago #

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

    Now everything works well!

    Andrea

  7. andrearuffini
    Member
    Posted 1 year ago #

    Resolved

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.