Closed mixer28 closed 10 years ago
Hi,
Can you please provide us with a link to the form in question.
Thanks, Evan
Hey,
It looks like the plugin is still trying to redirect using the old version (javascript). In one of our newer updates we removed the JavaScript redirect and replaced it with the standard WordPress PHP redirect for stability reasons.
I am looking into the issue now. I'll have a look at version 4.3 and see if that JavaScript redirect is in there.
I will report back here.
Thanks, Evan
That's great thanks. Everything else seems to work with the form - just not the redirect.
Hey Mixer28,
Can you replace the redirect inside of the plugin? The redirect function is locaed inside of class.yksemeBase.php and it looks like this:
jQuery(document).ready(function() {
// jquery redirect on form submission
var formRedirectPage = 'http://care.safebuy.org.uk/thank-you/';
var formID = '65395ae55d';
jQuery('#yks-mailchimp-form_0-'+formID).submit(function() {
var i = 0;
setInterval(function(){
if ( jQuery('.yks-success').is(':visible') ) {
i++;
if ( i == 1 ) {
window.location.replace(formRedirectPage);
}
}
}, 1000);
});
});
Can you try changing that line over to:
jQuery(document).ready(function() {
// jquery redirect on form submission
var formRedirectPage = '<?php echo $redirect_url ?>';
var formID = '<?php echo $form_id[1] ?>';
jQuery('#yks-mailchimp-form_0-'+formID).submit(function() {
setInterval(function(){
if ( jQuery('.yks-success').is(':visible') ) {
window.location.replace(formRedirectPage);
clearInterval();
}
}, 1000);
});
});
I believe that should fix the problem. The previous function was running in a loop and was never able to properly redirect you. I believe the new function should help resolve that.
Let me know if you need help.
Thanks, Evan
Hey Mixer28,
I just implemented this into the plugin, and pushed out a new version (4.3.1) to the repository. Try and download this newest version, and let me know if you are still having troubles with the page redirect upon form submission.
Thanks, Evan
Hi
Thanks for the update.
I tried manually adding the code and it didn't make it redirect.
So I downloaded the new version of the plugin and uploaded class.yksemeBase.php to the server and it still does not redirect I'm afraid
hmm,
I'm looking into it now. We will get this resolved today.
Evan
It still seems to be looping and never implementing the page redirect. I'm looking into it.
I will post back here shortly.
Hi Mixer28,
Can you try replacing the function in the plugin with this one:
<script>
jQuery(document).ready(function() {
// jquery redirect on form submission
var formRedirectPage = '<?php echo $redirect_url ?>';
var formID = '<?php echo $form_id[1] ?>';
jQuery('#yks-mailchimp-form_0-'+formID).submit(function() {
var interval = setInterval(function() {
if ( jQuery('.yks-success').is(':visible') ) {
window.location.replace(formRedirectPage);
clearInterval(interval);
return;
}
//do whatever here..
}, 2000);
});
});
</script>
I'm not sure if it will work, but seems to be ok on my localhost testing environment.
Thanks, Evan
thanks again! I tried this but it didn't work :( Just to be sure I am copying the code correctly here is a link to the file. https://www.dropbox.com/s/v8j9dggo9gpvzj3/class.yksemeBase.php
Hey Gareth,
Just to mention, there are two location where the redirect function is being called. You may have changed it in the one spot, but not the second. I checked the file and I see the code that looks like this (line 1880 and line 1965):
<script>
jQuery(document).ready(function() {
// jquery redirect on form submission
var formRedirectPage = '<?php echo $redirect_url ?>';
var formID = '<?php echo $form_id[1] ?>';
jQuery('#yks-mailchimp-form_0-'+formID).submit(function() {
setInterval(function(){
if ( jQuery('.yks-success').is(':visible') ) {
window.location.replace(formRedirectPage);
clearInterval();
}
}, 1000);
});
});
</script>
Try replacing those two lines with this one:
<script>
jQuery(document).ready(function() {
// jquery redirect on form submission
var formRedirectPage = '<?php echo $redirect_url ?>';
var formID = '<?php echo $form_id[1] ?>';
jQuery('#yks-mailchimp-form_0-'+formID).submit(function() {
var interval = setInterval(function() {
if ( jQuery('.yks-success').is(':visible') ) {
window.location.replace(formRedirectPage);
clearInterval(interval);
return;
}
//do whatever here..
}, 2000);
});
});
</script>
You'll notice it's set up a little differently so that when the redirect function fires, we return it to escape the Interval function (this is to prevent an infinite loop, which I believe may have been partially the problem).
Also, I've updated the repository with this function, so if you download the .zip from the repo and just upload this one file (and overwrite the existing one) it should properly implement the new redirect function.
You can also copy and paste the contents of this file (which is the live file in the repo) and overwrite the file you are using : http://plugins.svn.wordpress.org/yikes-inc-easy-mailchimp-extender/tags/4.3.1/classes/class.yksemeBase.php
Let me know when you get it swapped out or overwrite the file and I'll take a look at the page again.
Thanks, Evan
I've tried this again and it does not work. I have overwritten the orgininal file on dropbox so you can see if I can updated the code correctly.
thanks
Hey can you email me at Evan@yikesinc.com , I'd like to take a closer look at this issue. I can't seem to replicate it on my end.
I'll get it resolved for you. It may be a very site specific issue, theme related or otherwise.
Thanks, Evan
We were able to resolve this issue through Email support.
Thanks for your patience, @mixer28, while we worked out the issue, have a great night!
Evan
Hi
I have entered for the form to redirect and selected the page to redirect to and saved However on numerous tests once the form is filled in it stays on the page and just displays the sumbission has completed etc, I need it to jump to a different thank you page for tracking purposes. Plugin Version 4.3 Wordpress Version 3.9.1 Browser Information Google Chrome 35.0.1916.153 on Windows Please can you help?
thanks!
Gareth