Support » Plugin: WooCommerce » Contact form 7 spins with woocommerce enabled

  • Resolved ethical

    (@ethical)


    we have a number of forms on the site and recently they stopped working they just spin on submission. Ive updated to all latest version of both plugins and whet through testing all the plugins on the site one by one.

    the result was when i deactivate woocommerce, the forms submit fine.

    ive downloaded and reinstalled CF 7 plugin manually to see.
    ive resaved permalinks

    CF7 version: 5.4
    Woocommerce version: 5.1.0 however issue existed with the previous version as well, i upgraded to see if it got solved but it did not

    in chrome inspector I see these errors
    /wp-json/contact-form-7/v1/contact-forms/1813/refill?_locale=user 403
    api-fetch.min.js?ver=a783d1f442d2abefc7d6dbd156a44561:2

    ———————-

    Response {type: "basic", url: "/wp-admin/admin-ajax.php?action=rest-nonce", redirected: false, status: 400, ok: false, …}body: (...)bodyUsed: falseheaders: Headers {}ok: falseredirected: falsestatus: 400statusText: ""type: "basic"url: "https://www.horseguardcanada.ca/wp-admin/admin-ajax.php?action=rest-nonce"__proto__: Response
    (anonymous) @ index.js?ver=5.4:1
    Promise.catch (async)
    p @ index.js?ver=5.4:1
    (anonymous) @ index.js?ver=5.4:1
    (anonymous) @ index.js?ver=5.4:1
    load (async)
    b @ index.js?ver=5.4:1
    (anonymous) @ index.js?ver=5.4:1
    (anonymous) @ index.js?ver=5.4:1

    ————–

    please let me know what i can do to get this working with contact form 7 again.

    will cross post in CF 7 support

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 18 total)
  • Thread Starter ethical

    (@ethical)

    i should add if i add this function

    add_filter( 'wpcf7_load_js', '__return_false' );

    the forms work but that doesnt really seem like a viable solution?

    I can confirm that I’m having the same issue, & it only occurs when I have Woocommerce active..

    errors I get in the console:
    wp-json/contact-form-7/v1/contact-forms/5/refill?_locale=user 403
    wp-admin/admin-ajax.php?action=rest-nonce 403

    Thread Starter ethical

    (@ethical)

    would love a reply from either plugin as to a real solution?

    Also seeing this.

    For some reason the issue is resolved now, but I didn’t change anything regarding CF7 or WC

    Thread Starter ethical

    (@ethical)

    not for me, i should add the forms work fine if logged in as admin on wordpress, but not for the public

    @ethical this:

    forms work fine if logged in as admin on wordpress, but not for the public

    makes it sound like it may be a caching issues, since some caching plugins don’t cache for admin users who are logged in.

    Thread Starter ethical

    (@ethical)

    its not caching, forms dont work with ALL OTHER plugins deactivated and caches cleared first before deactivating.

    i also dont cache JS on this site either and adding in that Js code makes the forms work so…

    • This reply was modified 1 year, 8 months ago by ethical.

    I am only seeing it on the actual product page where cf7 is in the footer. Regardless if I put an email address in or not..and just click submit it just spins forever. Archive page, homepage (even the same module in the footer that is also on the product page), and other pages cf7 is on it works fine.

    EDIT: I found issues on the My Account page as well as others but only when I am logged out. I don’t see any issues when I am logged in.

    • This reply was modified 1 year, 8 months ago by deandid.

    Ok, my problem was that I had a password protection on my site and I believe admin ajax connects as guest so it couldnt access whatever files it was trying to access.

    Thread Starter ethical

    (@ethical)

    no password protection here and nothing related to woocommerce on the form page.

    Having same issue. About to go live with a website and the client noticed it.

    Only facing this if user isn’t logged in. Definitely not a caching issue as stated in the thread.

    I tried disabling all other plugins, but it is definitely related to WooCommerce. Not sure if it existed in previous versions and went unnoticed.

    Chrome Inspector errors:
    POST: /wp-json/contact-form-7/v1/contact-forms/10574/feedback?_locale=user (403)
    GET: /wp-admin/admin-ajax.php?action=rest-nonce (400)

    @sharbelz

    I tried disabling all other plugins, but it is definitely related to WooCommerce. Not sure if it existed in previous versions and went unnoticed.

    The problem doesn’t affect the previous version of CF7 v5.3.2 because that version doesn’t use “nonces”. Nonces were added by the CF7 author in v5.4, which is why people with caches are seeing the forms becoming dysfunctional after 24-hours. In your case, instead of an issue with the cache, WooCommerce is interfering with the CF7 nonce.

    So it looks like the use of nonces is causing more than on headache for CF7 v5.4 users.

    @ethical

    not for me, i should add the forms work fine if logged in as admin on wordpress, but not for the public

    So the problem appears two fold for you. One, the bug in WooCommerce is interfering with the CF7 v5.4 nonce. There appears to be a workaround for WooCommerce on the GITUB page link above.

    Second, your cache will cause will cause the CF7 nonce to expire after 24-hours. So you’ll either have to re-cache the for page every 24-hours or permanently uncache the form page.

    So far, there appears to be at least three was to kill CF7. The third being the deferment of JavaScript.

    No wonder so many people are have issues! Because it’s possible to have all three conflicts layer on top of each other. This explains why some people keep having issues even with the workarounds I found.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Contact form 7 spins with woocommerce enabled’ is closed to new replies.