WordPress.org

Ready to get started?Download WordPress

Forums

FoxyShop
[resolved] Foxyshop disabling manual jquery enqueu (9 posts)

  1. KerriM
    Member
    Posted 2 years ago #

    Hi, I'm having an issue where if I have the Foxyshop plugin enabled, jQuery will not load via wp_enqueue_script. It doesn't seem to matter wether or not I have the "Automatically Insert jQuery 1.7.2 from Google CDNIf" checked or unchecked in the Foxyshop settings.

    I have the enqueue function set to load on init, if that makes a difference. I also tried adding it directly to my header file, just to see if that worked, and still no luck. It will only load when I disable Foxyshop.

    http://wordpress.org/extend/plugins/foxyshop/

  2. KerriM
    Member
    Posted 2 years ago #

    I forgot to add the jQuery is loading on the actual FoxyShop pages, just not any of the other pages of the site.

    Also, I just discovered this: I had been using the "Skip FoxyCart Includes on These Pages:". When I removed the page IDs from this field, jquery began loading again.

  3. sparkweb
    Member
    Plugin Author

    Posted 2 years ago #

    So is this fixed now? You can use ID's or slugs in the skip includes box and it will keep jQuery out of those pages as well. This feature is designed for use with the checkout template where you don't want to load jQuery or the FoxyCart includes.

  4. KerriM
    Member
    Posted 2 years ago #

    Actually, no it's not fixed—I've just "worked around" it by not excluding pages (which I would like to). If I addd jQuery via enqueue (in my functions.php, independently of foxy shop), then exclude pages (via page ID or slug) in the FoxyShop settings, this also overrides the jQuery I've added myself in functions.php, so I can't get jQuery at all on those pages.

  5. sparkweb
    Member
    Plugin Author

    Posted 2 years ago #

    Why do you need the FoxyCart includes to be removed on some pages? Just to speed things up?

    If you want jQuery to be included at all times, in your functions.php file where you are adding the action to insert jQuery, set it with a priority of 16:

    add_action('wp_enqueue_scripts', 'your_function_to_insert_jquery', 16);

    This will be executed after FoxyShop removes the jQuery insert.

  6. KerriM
    Member
    Posted 2 years ago #

    Yeah, just for that reason — I'm a little anal about loading unnecessary stuff :-/
    Thanks — I hadn't thought about setting the priority!

  7. sparkweb
    Member
    Plugin Author

    Posted 2 years ago #

    Remember that by loading the FoxyCart includes on every page you can get a minicart on each page or a customized Cart link with the cart count. Or you could even hide it and only display it when there is something in the cart.

  8. KerriM
    Member
    Posted 2 years ago #

    Shop is treated as a sort of separate entity for this site. I know, this is a very specific use case.

    I added a priority of 16 for the jQuery enqueue (and also changed it to execute on 'wp_enqueue_scripts' instead of 'init', as I originally had it— actually, I tried both), and my enqueque jQuery is still stripped if I add that a page to the FoxyCart settings. I tried an even later priority, just in case. Still no luck.

    This is no big deal for this site, but I'm just not sure why it's happening.

  9. sparkweb
    Member
    Plugin Author

    Posted 2 years ago #

    I'm not sure either. Since it's not a big deal I guess we could let it go. Sorry....

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.