Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 02-27-2017 15:13:11

Blitzen
Member
From: USA
Registered: 01-01-2005
Posts: 936

Ajax not working at Payment Method Selection

Hi
Our client has two of your CCP8 installed.
One has ajax working and the other.

Checkout ajax is enabled at both stores/websites.

The place where it fails is at the "Payment Method Selection" on the full site.

For the okay site, when the radio button is selected, ajax loads the data for that payment method just fine.
This is what we want.

For the other site that doesn't work, nothing happens when the radio button is selected.
A button is there to click if anything above is changed. When that is clicked, the page reloads with the changed data for the payment method.
We do not want that. We want how the other site is working.

Now, in the good checkoutn, I noticed that there is an event attached to the form id=ecom--coform that is in frontend.js.
In the bad one, there is no event attached to the form.

I copied these files from the working site to the broken one - This did not fix it.
ECOM_OLP.php
ECOM_Checkout.php
coformfoot.php
olpform.php
common.js
frontend.js

The gateway payment fields were also copied (except the login info that differs for each site).

Can you tell me exactly where this ajax may be broken?

Last edited by Blitzen (02-27-2017 17:59:53)

Offline

 

#2 02-28-2017 08:18:14

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Ajax not working at Payment Method Selection

For the other site that doesn't work, nothing happens when the radio button is selected.
A button is there to click if anything above is changed. When that is clicked, the page reloads with the changed data for the payment method.
We do not want that. We want how the other site is working.

If you're seeing a button there that says Update instead of seeing Ajax updates, that is the fallback for when Ajax is disabled, or cannot be activated by the browser (ie it's either off or not working due to something else).

Identify if issue is with JS:  So, is any Ajax working on the site at all?  Like the cart overlay, or predictive search, or updates on the cart page?  If not, you likely have a JS problem, either introduced with bad JS in your skin, or copying in outdated JS files over system JS files.  If that is working, give checkout a good reload in your browser.  Does it work after that?

Identify if the system has Ajax functionality off: You said no event was tied to the form in the non-working version.  This sounds like Ajax is off.  Check the Ajax checkout setting under store settings.  I know you said this was on, but it might not be.


Nick Hendler

Offline

 

#3 02-28-2017 17:28:05

Blitzen
Member
From: USA
Registered: 01-01-2005
Posts: 936

Re: Ajax not working at Payment Method Selection

Thanks for the response.

AJAX/overlay works at the top of checkout when selecting, say guest checkout and submitting billing info. Yes, the data are saved to the db, too.

It stops when the Payment Method shows up.

Good reload after reboot and this issue continues, even on different browsers, computers, IP.

Ajax is on in admin.
$enableajax = 1 during checkout and I do not see it reset during checkout.
$payment_ok = 1
$checkout_payment_ok = 1.

Do you have any other ideas where this might be broken?

Last edited by Blitzen (02-28-2017 18:52:46)

Offline

 

#4 03-01-2017 07:52:34

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Ajax not working at Payment Method Selection

Have you tried disabling the payment method you're working with and enabling a known working one?  Thinking the method you're using has an error in it's form content section. 

Also, if using FireBug, in the Console, you can watch the Ajax request fire off and view the response.  If there's a coding error or something like that, instead of seeing a nice JSON response in the panel, you'll see an error.

Turning off Ajax in checkout will expose any errors in coding nicely as well.


Nick Hendler

Offline

 

#5 03-01-2017 19:06:36

Blitzen
Member
From: USA
Registered: 01-01-2005
Posts: 936

Re: Ajax not working at Payment Method Selection

The same payment methods are used on both the working and broken sites (except for login credentials).

I captured the eval in frontend.js and see a difference.
This was after submitting the billing info and when the "Payment Method Selection" shows up.

GOOD
jQuery('#ecom--coform--aa5fe2942c190c9ff4d2135f031ae5d9--1').change(function(){setTimeout(function(){return ajaxExec({'primary': 'ContentWithTitle', 'overlay': '1', 'callback': 'ajaxExecResult', 'formid': 'ecom--coform'});}, 100);});

BAD
jQuery('#ecom--coform--6d463b0c8e5b54ec3a04a0446d3e3941--1').change(function(){return ajaxExec({'primary': 'ContentWithTitle', 'overlay': '1', 'callback': 'ajaxExecResult', 'formid': 'ecom--coform'});});

Where is that  statement set/created?
--------------------------------------------
There are others that differ between the sites.
I hope if the above is resolved will resolve these, below.
Here are the BAD ones

jQuery('#ecom--coform--disccode').keyup(function(){if (window.mytimeout) {window.clearTimeout(window.mytimeout);}return ajaxExec({'primary': 'ContentWithTitle', 'overlay': '1', 'callback': 'ajaxExecResult', 'formid': 'ecom--coform'});}, 1200);});

jQuery('#ecom--coform--gateway_select--1').change(function(){return ajaxExec({'primary': 'ContentWithTitle', 'overlay': '1', 'callback': 'ajaxExecResult', 'formid': 'ecom--coform'});});

jQuery('#ecom--coform--gateway_select--2').change(function(){return ajaxExec({'primary': 'ContentWithTitle', 'overlay': '1', 'callback': 'ajaxExecResult', 'formid': 'ecom--coform'});});

Last edited by Blitzen (03-01-2017 19:55:14)

Offline

 

#6 03-02-2017 08:00:55

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Ajax not working at Payment Method Selection

The install you're working on and failing is a lower version than the one that's working.  It's missing some coding added in an update to add timeouts to mostly all JavaScript events tied to formfields.  I'm not sure how out of date the install is, but you at least need to copy over all the {private}/core/CORE/includes/formfield_*.php files from the working install to resolve this issue.


Nick Hendler

Offline

 

#7 03-02-2017 11:19:25

Blitzen
Member
From: USA
Registered: 01-01-2005
Posts: 936

Re: Ajax not working at Payment Method Selection

That worked. Much thanks for your time.
Make it a wonderful day. You deserve it!

Offline

 

#8 03-02-2017 16:19:21

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Ajax not working at Payment Method Selection

Thanks!


Nick Hendler

Offline

 

Board footer