New Landing How can we help? Atelier Notice: get_cart was called incorrectly.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Posted in: Atelier
  • #208644
    Chris
    Member
    Post count: 6

    Hi,

    I am encountering this notice, which I believe may be caused by the theme or Swift Framework:

    Notice: get_cart was called <strong>incorrectly</strong>. Get cart should not be called before the wp_loaded action.

    I only see this notice in AJAX responses for some reason. I found it while debugging Contact Form 7–an infinite load animation after submitting the form. I found an AJAX JSON error because the above notice is showing up outside of the JSON response (WP_DEBUG is turned on). However, I’m not having any luck figuring out what is calling get_cart() before the wp_loaded action, or why this notice doesn’t show up when I normally fetch pages. Here are my active plugins:

    Advanced Custom Fields
    Akismet
    Contact Form 7
    Custom Permalinks
    Custom WooCommerce Pricing
    Custom WooCommerce Sorting
    Ebay HTML for WooCommerce
    Google Product Feed for WooCommerce
    Newsletter
    oAuth Twitter Feed for Developers
    Swift Framework
    WooCommerce
    YITH WooCommerce Wishlist
    Yoast SEO

    I tried disabling the custom WooCommerce plugins to no avail (the ones for pricing, sorting, Ebay HTML, and the Google product feed). None of them interacts with get_cart() or the WC_Cart class. I also tried disabling the Wishlist plugin with the same result. So it looks like the issue may be with the theme or Swift Framework somewhere. Do you think that you could help me find a solution?

    Thanks,

    Chris

    #209192
    David Martin – Support
    Moderator
    Post count: 20834

    Hi Chris,

    This is not something I can initial replicate locally.

    Can you list the steps to replicate this? Have you turned wp_debug to false as I cannot initially see any errors.

    Thanks,
    David.

    #209292
    Chris
    Member
    Post count: 6

    Hi David,

    I had to set WP_DEBUG to false because I’m moving forward to launch the site in spite of the issue, and I have needed to test functionality without this notice displaying (it shows twice). If at some point I discover where the problem lies, I will report it here. FYI, I didn’t notice the problem until upgrading to 1.67.

    To replicate the problem, all I need to do is set WP_DEBUG to true and submit a contact form. Then the notice is displayed only with the JSON response, not in the main body of the page.

    Sincerely,

    Chris

    #209704
    David Martin – Support
    Moderator
    Post count: 20834

    Hi Chris,

    Thanks, I’ll need to test this further and pass this on to the developer for future update.

    – David.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register