Events Made Easy › Forums › How do I … › Redirect on Successful Booking
Tagged: paypal, redirect, Send Booking
- This topic has 16 replies, 4 voices, and was last updated 10 years, 2 months ago by Franky.
-
AuthorPosts
-
Thu 20 Feb 2014 at 18:48 #44172AnonymousInactive
Frank,
Just wanted to say that our non profit organization has been using your plugin for a little while and we are very grateful that you are continuing support for your fantastic plugin.
A lot of the demographic that visits our site to donate or pay for events are not very computer savy.
The majority of events that we hold are free. I have successfully gotten the PayPal setup and booking properly right. But in this event ideally when you click the “Send Booking button” it will redirect to Paypal immediately.
In your plugin on event basis I am able to add extra HTML to the “Successfully Booking Page”
I Figured I could probably use an html Redirect..
<script language="javascript">
window.location.href = "http://PayPal.com//////"
</script>But because of the smart way this plugin is set up (autofill details ie quantity where the payment should be going) I have no idea how I can use a hook/function – (php knowledge is abysmal) to pull the data from the form and plug it into the URL to redirect to.
I found a forum post from two years ago where the requester had asked if it was possible that when the user clicked “Send Booking” It would just take them to PayPal directly.
At the time you said that it was not possible. – Probably because the Button has to report to the EME Database before going off to Paypal.
I am more then happy to make a donation on behalf of Restorative Partners to see if we can get this implemented. If we wanted to make the redirect from the “Succesfuly Sent booking page” Fancy I can provide you with a GIF countdown timer.
Dillon Chi
This is my organizations events page.
The plugin is set up to the url /events/ because we wanted to display the events differently from the shortcodes that were available I created the Static page:
http://restorativepartners.org/upcoming-events/
Placed a slider on it that linked to the events generated by your plugin.
Thu 20 Feb 2014 at 22:16 #51276FrankyKeymasterWell, there’s an easy way to do redirection now:
in the EME settings, section “RSVP: price options”, there’s an option called “Payment form header format”. There you can add any code you like. The default is “The booking price in .. is ..”, but you can easily put there the following javascript:
<script type="text/javascript">
addEvent(window, 'load', function() { setTimeout("document.forms['paypal_form'].submit()", timeout);})
</script>With “timeout” being a value in milliseconds. Play around with that to auto-submit the paypal button.
Fri 30 May 2014 at 14:37 #52280AnonymousInactiveHi,
I recently implemented your elegant plugin – pretty much out of the box, only with paypal payment. I have tried unsuccessfully to redirect users straight to paypal after they entered their registration details by using the above javascript code in Settings > Payment > Payment form header format. I have played with different values for timeout – now I have 10 as a value there – but it never redirected to PP. I can see the javascript code in the sourece code of the #eme-rsvp-message page, but it does not redirect anywhere.
<div id='eme-payment-formtext' class='eme-payment-formtext'><script type="text/javascript"> addEvent(window, 'load', function() { setTimeout("document.forms['paypal_form'].submit()", 10); } ) </script></div><div id='eme-payment-form' class='eme-payment-form'><br><form method="post" name="paypal_form" id="paypal_form" action="https://www.paypal.com/cgi-bin/webscr">
Do I need to make changes in the eme php files too for this to work?
Thanks,
Sandi
Fri 30 May 2014 at 18:26 #52287FrankyKeymasterUsing this in the payment form header should work (just tested this):
<script type="text/javascript"> jQuery(document).ready( function($) { $( "#paypal_form" ).submit(); }); </script>
Sat 31 May 2014 at 03:19 #52291AnonymousInactiveThanks – it works!
Sandi
Sun 7 Sep 2014 at 21:26 #52775AnonymousInactiveI’m trying to set up an event in which a person can RSVP and pay tuition. I’ve set up the event along with the script above in the payment form header. I also ticked the boxes beside (Enable registration for this event); (Require approval for registration); (Auto-approve registration upon payment); as well as paypal in the payment method section. When I test the form, it adds the user to the list of participants but doesn’t redirect to paypal for payment. I also see code at the top of the page like this:
function postwith (to,p) { var myForm = document.createElement(“form”); myForm.method=”post” ; myForm.action = to ; for (var k in p) { var myInput = document.createElement(“input”) ; myInput.setAttribute(“name”, k) ; myInput.setAttribute(“value”, p[k]); myForm.appendChild(myInput) ; } document.body.appendChild(myForm) ; myForm.submit() ; document.body.removeChild(myForm) ; } postwith(‘#eme-rsvp-message’,{“eme_eventAction”:”pay_booking”,”eme_message”:”Your booking has been recorded”,”payment_id”:”12″,”eme_payment_nonce”:”c482f57cd0″}); ” />
Any ideas? Thanks!
Mon 8 Sep 2014 at 23:16 #52782FrankyKeymasterThis means that there is a bug in your jquery script somewhere that blocks future javascripts from being executed. Look in your browser console for javascript errors and fix those.
Mon 8 Sep 2014 at 23:27 #52783AnonymousInactiveThanks for your reply but I’m not a developer so I’m not sure what any of that means. I installed the plugin and tried to set it up and it’s not working as I expect it to out of the box.
Tue 9 Sep 2014 at 00:25 #52784FrankyKeymasterAdding extra jquery-code like mentioned here is not “out of the box”. If you’re unfamiliar with that, don’t do it and remove it.
Tue 9 Sep 2014 at 00:56 #52785AnonymousInactiveThanks for your patience. I had added that code after searching for a solution to the problem initially. I have just now removed the code from the form header and re-submitted the form. I get similar results. The form just resets; the user is added to the list of participants. I get email asking for approval. The code at the top of the page that appears is as follows:
function postwith (to,p) { var myForm = document.createElement(“form”); myForm.method=”post” ; myForm.action = to ; for (var k in p) { var myInput = document.createElement(“input”) ; myInput.setAttribute(“name”, k) ; myInput.setAttribute(“value”, p[k]); myForm.appendChild(myInput) ; } document.body.appendChild(myForm) ; myForm.submit() ; document.body.removeChild(myForm) ; } postwith(‘#eme-rsvp-message’,{“eme_eventAction”:”pay_booking”,”eme_message”:”Your booking has been recorded”,”payment_id”:”16″,”eme_payment_nonce”:”b7196874b4″});
30 Sep 2014 – 18:00SalisburyThis is a test class signup. If you are seeing this right now, I’ve done something I didn’t want to do. Anyhow, I’m gonna be hosting some classes and that’s what this is all about. If you see this and there is a payment button, please consider giving me money out […]
” />Tue 9 Sep 2014 at 00:57 #52786AnonymousInactiveOh and also, the user is never given the opportunity to pay via paypal.
Tue 9 Sep 2014 at 11:24 #52789FrankyKeymasterThis means that there’s probably an issue with the theme, preventing further submissions (like an empty first line in the html-code).
Can you post an example link?Tue 9 Sep 2014 at 16:24 #52790AnonymousInactiveOk thanks for looking at this. If I get this working I plan to make a donation.
Here’s a link to the form.
http://www.skinnywheels.com/events/18/test-class/Tue 9 Sep 2014 at 16:46 #52791FrankyKeymasterOk, I think I found the problem at your side. The html created includes some facebook headers (I think), like this
<meta name="description" property="og:description" content="
And bizarrely, the javascript function to redirect to the paypal button is after that last opening-quote. Therefore it is being shown on screen …
Do you have anything configured in EME that creates these facebook headers (it might be a bug)?
Or another plugin that creates those headers?If you don’t know, please mail me an admin account at liedekef@telenet.be so I can check myself.
Tue 9 Sep 2014 at 23:29 #52793FrankyKeymasterOk, the issue has been found: the theme added the description as extra meta-info in the header of the page, but doesn’t strip out html-tags, resulting in all kind of weird stuff …
Since you use yoast, I disabled the theme option “Include Built In SEO”, and it works now. You should make a bug report with your theme maker for this.
Of course you need to work on the CSS for the balloon in the Google map and such, but that’s besides the point.Wed 10 Sep 2014 at 04:03 #52800AnonymousInactiveThank you very much! I’ll just copy what you said to the theme maker. Donation coming to you. Thanks for the help.
Wed 10 Sep 2014 at 06:36 #52802FrankyKeymasterThanks! I am also looking at another way to add the javascript to the page, so that it won’t interfere with similar themes.
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.