Java ( custom Java ) conflict preventing shop from processing payments

Hi . .to all . . its Andrew again. :} So for a while - my site is working just fine - woocommerce is great - etc… and imreceived orders - the only problem is - i have an account with braintree - for CC payments - and all was working fine in the past - but since about aug this year . . my site is not allowing customers to enter the details of their credit cards - when they tick this payment option.
So i took it up with braintree . . and then with woo commerce themselves - as they actually own the plugin. - and i did the trouble shoot as they asked . . ( i switched theme to twenty sixteen ) - then i detracted all the plugins except woo commerce and brain tree - but no joy. so then they had a look themselves . .and they reported that the problem is a java conflict . . . and they sent me screen shots - of what they found - and to their understanding - they said it had something to do with themeco - google analytics plugin . . ( please see copy of her email below ) -

so i turned off all the google related plugins - and even deleted them from the system - but the problem persisted.

so after thinking as hard as i could - i did not understand -what was going on - and why this problem is still there.
Then i had an epiphany . . . . . .

I know that going through theme options - i can get to backend -where i can customize the CSS and or JS . . . .
and so i went into this. . . and found CSS code ( which i do not think is the problem ) - but then on looking at the JS code of customs JS . … well there was the code exactly as it was in the image of the error they showed me.

so i sent them the copy - of both files - and i asked them if they can let me know if i can edit the JS - or remove the conflicting code - to hopefully fix the issue . . .

but they tell me - this is a theme situation - and i have to contact them developer.

So can you please have a look at the custom JS - i have at the moment. please see below.
and hopefully get back to me - with what i can remove from this code - to get the payments working again :}}

thanks - andrew -

website - www.nailcrazy.com
problem - when you checkout - and choose CC payment - the site will not let you enter VISA details.

Global JS

(function(i,s,o,g,r,a,m){i[\‘GoogleAnalyticsObject\’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new
Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,\‘script\’,\’//www.google-analytics.com/analytics.js\’,\'ga\’);

ga(\‘create\’, \‘UA-41660438-1\’, \‘theme.co\’);
ga(\‘send\’, \‘pageview\’);

);

(function(i,s,o,g,r,a,m){i[\‘GoogleAnalyticsObject\’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new
Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,\‘script\’,\’//www.google-analytics.com/analytics.js\’,\'ga\’);

ga(\‘create\’, \‘UA-41660438-1\’, \‘theme.co\’);
ga(\‘send\’, \‘pageview\’);

);

the end of this file

PS - im happy to give you access not a problem ::}}
thanks
a

elinda Helt (Automattic)

Oct 2, 18:53 UTC

Hi Andrew

Thanks for doing the testing so far. I took a look a look at the site and found the following JS error in the console:

Image Link: https://cld.wthms.co/ba2H1A

When clicking on that error, it shows that it’s related to Google Analytics

Image Link: https://cld.wthms.co/8puV3U

My assumption is that there is an issue with the plugin X – Google Analytics by Themeco – 1.0.3 and/or with how you added Google Analytics to your site.

I would suggest first deactivating that plugin and see if that resolves things.

If that doesn’t, (and I know you said you did plugin conflict testing), but if that doesn’t help, I’d like to have you make a staging site (if you don’t have one, I recommend https://wordpress.org/plugins/wp-staging/. From there, deactivate ALL plugins except for WooCommerce an PayPal Powered by Braintree and give that a test. If it does not work. let us know.

If it does work, then turn on the other plugins, one at a time, testing after each activation until you find the one that is causing the issue.

Let us know how how it goes!

Melinda H. | Happiness Engineer

Melinda Helt (Automattic)

Oct 3, 12:23 UTC

Hi there

It does sound like this is a conflict within your theme files. We are not able to troubleshoot third-party themes, so I would suggest that you reach out to the theme developer for help with that.

If you added the code to a child theme, I would suggest removing the code and/or checking with the developer.

The reason I suggested temporarily changing your theme is that will tell you for sure if it’s the theme or if it is a plugin. That’s the only true way to test. Then you will know to check with the theme developer.

Hope this helps!

Melinda H. | Happiness Engineer

ps it looks like the code is there twice . . .could this be why /?? - thanks andrew

Hi Andrew,

Thank you for writing in, yes, it could be, please deactivate Google Analytics and see if that resolves the issue.

Also, please check the version of your Google Analytics if it is the latest. You can find the latest version supported here.

I see that you’re using W3 Total Cache, please clear it and clear your other caching feature (if any) as well. To make sure that this is not a caching issue.

Clearing WordPress Cache

Lastly, I see that you’re using a child theme, try switching to parent X theme and see if that resolves the issue if it does, then there could be a modification done on the child theme that is causing the issue.

Let us know how it goes,
Cheers!

HI again - this is a real frustrating situation - … … sadly i have no good news.

so - i had deleted ( not just de-activated all the google analytics plugins ) - as that what we thought was the problem -
so there is no version for me to check.

so from theme options - i delete all the JS that was in Custom JS. - thinking this would fix for sure - but no joy.
then i switched to x theme ( not child ) = and checked again
all this time im purging the w3 all cashes in between - once or twice.

then in X - i cleared also the object cashe . .
( those are the only cashes i know ) - i can purge.

so im stuck.
Please help - thanks -

Hey Andrew,

There’s an error in the console which is probably causing the issue.

It’s coming from the tag manager code you’ve added in Theme Options > JS. The <script></script> tags are not accepted in there. Please remove the code and use the method in this guide to add code to the head and footer of a WordPress site.

I know you tested removing codes in Global JS but would you mind removing that?

Going back to your first post, you said:

WooCommerce support said it was a conflict with Google Analytics extension which you now have tested deleting and still the issue persists. Would you also mind testing switching to the default WordPress theme again to see if their plugin works?

Please clear all caches and deactivate your caching plugin while this investigation is ongoing.

Thanks.

Hi wow - u are good my friend - so im doing step by step but quick queery . .

so im in custom js - did u mean remove only the conflicting line - like this

or all the JS ???
so far i removed that line - and purged w3 cashes - but no joy :[

also - for google analytics - ( i had the themco plugin activated ) - do you mean to install it and activated as well or am i off tracK?

thanks
a

Hi again,

Take a backup of your custom code first and the remove the code entirely from Theme Options > JS so you have no code in there. I checked and your site still shows the code which is triggering an error (see screenshot)

After removing the code make sure to purge all cache as I see the content on your site is being served by the cache. Once the cache is cleared you can deactivate your cache plugins and optimization services if you have any.

Regarding the google analytics plugin, you can temporarily deactivate all plugins except for the Cornerstone while we’re tracing out the cause.

Let us know how this goes!

hey again - so i removed all the JS from custom js . . and purged all cashes - and then i de activated the w3 plugin to test -and problem still persists.

( i have no google analyics plugins turned on yet ) -so can u please see what error is coming up now :} and advise - thanks - a

Hi Melinda,

I checked and can no longer see a js error in the console though it is still not working.

As suggested by my colleague, can you try switching to wordpress default theme(twentyseventeen) and check if the issue is resolved.

If the issue persist then it’s a plugin issue.

Thank you.

hello again - just to report that i switched to twentysixteen and purged cashes - tried to purchase - but no joy.
so the issue persists and i will have to get back to woocommerce people = and continue with them i gues - big thanks for your help

Hi @nailcrazy,

The one responsible for the card payment is the Braintree Woocommerce payment method, you should contact them for this issue.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.