JS error interfering with woocommerce Cart & Gravity Forms

Hello, I have taken this issue up with Gravity Forms, who said I needed to take it up with Woocommerce, who said I need to take it up with the Theme authors…

Here’s the issue:
I have built a gravity form that has conditional elements.

When the form is attached to a woo product the form doesn’t display:

I have created duplicated product and form, but changed the form to remove the conditional elements:

Here is a screencast explaining how the conditional form works in form preview, but not in the product:

What Woocommerce said was:
This because your theme is causing a JavaScript error on the product page, as you can see below:
https://attachment.freshdesk.com/inline/attachment?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MzMwMDg3MTYzNTEsImRvbWFpbiI6ImVsZW1lbnRzdGFyay5mcmVzaGRlc2suY29tIiwiYWNjb3VudF9pZCI6NzE1MjQ1fQ.gk5trfEArJmH4FSzgZlFsHfJvCQ2Niy4_lJ7NJDRheo

Please lmk what the fix is to resolve this issue.
Kind regards,
Rob

Hi There,

Could you please try downgrading your WooCommerce plugin to the version 3.3.3?

Our X isn’t compatible with the WooCommerce 3.3.4 yet:

Regretfully, we cannot provide support for third party plugins or scripts as our support policy in the sidebar states due to the fact that there is simply no way to account for all of the potential variables at play when using another developer’s plugin or script. Because of this, any questions you have regarding setup, integration, or troubleshooting any piece of functionality that is not native to X will need to be directed to the original developer.

Thank you for your understanding.

Thanks. I appreciate your stance on on supporting 3d party plugins. I would also say that woocommerce and gravity forms, which are addons to x, should be fully forward compatible, or license holders should have a fair expectation that you’re working to become compatible in the near future.

  1. So, when do you expect the latest versions to be compatible with X?
  2. I have rolled back woo to 3.3.3 and the same issue exists, which you can see on the stage site: https://dev.crestedbuttedevo.com/shop/pre-registration/

I appreciate your support.
Kind regards,
Rob
P.S. I have looked at another of my websites that is using X 6.0.4 https://shop.rockymountaingetaways.com/product/epic-pass-18-19/() and the woocommerce, gravity forms, and the gravity form addon for woocommerce are all the same versions (now that I have rolled woo back to 3.3.3), yet the conditional forms seem to be working fine over on this other site but not on crestedbuttedevo.com?
Why is that?

1 Like

Hi there,

I did check the case and I could not find a reason why this might happen. There are too many factors here which we can not be of a help as we do not have detailed in and out knowledge of the Gravity Forms and the Woocommerce plugins.

Another point that I want to mention is I think the support you get from the Woocommerce is not accurate, the file which is causing the issue is not in the theme at all! It is one of the Woocommerce files. Here is the link:

https://crestedbuttedevo.com/wp-content/plugins/woocommerce/assets/js/frontend/cart-fragments.min.js?ver=3.3.4

As you can see it is inside the Woocommerce plugin and not our theme.

You can easily test if this is theme related or not by changing our theme to for example 2016 default theme of the WordPress. If the problem persists then it is not related to our theme.

Thank you for your understanding.

HI Rob, hope it’s ok with the X guys to reply on here like this but I solved a problem with a similar set up (woo/gravity/gravity product add-on/conditional logic) last night. I might be able to help or point you in the right direction. Tag me (Gina Ware) on the X Facebook group, or message me there and I’ll try and help. The problem wasn’t with X or Woo, it’s Gravity and with luck I can show you how to find it.

I think this is a support forum so I welcome your solution… could you please share it here?
Thanks in advance,
Rob

Hi @AppellaGW

You are welcome to share your solution that worked on your website here on this thread.

Thanks!

Can I ask, are you using Gravity forms Woocommerce Product Add-ons?

What I did was I had some products working and some not. I opened one of each. I performed the action (in my case trying to add a product to cart) on each, (so one was successful, one not). Then left-clicking in Chrome I got the page source for each.

The thing is that when Gravity is performing with a wooproduct it’s validation and error messages don’t show, they are hidden but you can see where they are in the code.

Then I found the part of the code that pertained to the error - in this case the part loading gravity forms - copied that out for each (colour coded so I wouldn’t get confused) and put them into an online tool to compare them and search for the differences. And trawled through them till I found the hidden error message and what was different between them - didn’t take as long as I thought, it was near the top of the GF code. That told me where to look, what section of my form.

When I went to the form I found that on the faulty product the section had a greyed out options box - it was the product head part that you put in with the gf woo product add-on. Don’t know how it happened, it was fine previously but it had - some upgrade or something. So I replaced that to an exact replica of the working one and everything was fine.

You could also have your conditional logic entries a bit wrong. What I would be looking for is if maybe you’ve moved one of the blocks around or done something to it that messed up the dependencies. It doesn’t take much to upset CL processes.

Hope this helps - comparing the code is what revealed it to me. I could see a js error in my console too but it wasn’t telling me anything and my hosts looked for errors showing that side and that didn’t say anything either. You’ve got 3 big plug-ins interacting there on top of wordpress so it’s hard to isolate but I think that is the only way.

Hope that helps you find it. I might be wrong but I think that’s a reasonable way to chase it down.

Hello @AppellaGW,

Thank you for this detailed explanation of what works for you to this issue. Hope this helps @Rob_Strickland.

Yes, thank you. For me I disabled Swiss knife plugin and the problem resolved.
Regards,
Rob

1 Like

Oh good, glad it’s working. Easier solution than trawling through all that code!