Paypal Plugin Redirect Conditional Statement

wmuckell 11 Apr, 2012
I have a form which I am using the Paypal Redirect Plugin.

I have a situation that if someone selects one value in a Radio Button Group I want it to bypass going to paypal and instead give a thank you message and a different email to the normal one.

Any advice would be appreciated.
andy130 11 Apr, 2012
I have same question. please answer thx
wmuckell 12 Apr, 2012
Would be really helpful if I can get some help on this, it is really quite urgent.
GreyHead 12 Apr, 2012
Hi wmuckell and andy130,

I would use my Event Switcher [GH] action for this. It lets you use a little PHP to select between up to four different Events or continuing with the On Submit event.

Here I'd probably use one of the events to handle the Thank You plus Email and leave the PayPal option in the main On Submit event. Use the Show Stopper action to end the Thank You + Email sequence otherwise it will continue on into the PayPal actions.

Bob
wmuckell 12 Apr, 2012
Bob

The zip file cannot be openned on a mac? It says the structure is incorrect. ???


W
GreyHead 12 Apr, 2012
Hi wmuckell,

Yes that seems to be a Mac bug nothing much that I can do about it :-(

But you don't need to unzip it, use the Install Action icon in the toolbar to install it on your site.

Bob
wmuckell 12 Apr, 2012
I unzipped on a windows machine and uploaded to my site. But I don't see it in the Chronforms administrator? Am I doing something stupid here. It failed on trying install using Action installer, firstly taking ages to upload and install, but I think that is a server issue out of my control. How do I manually get it into the chronoforms
GreyHead 12 Apr, 2012
Hi wmuckell,

It's only a 4kb file so taking a long time to uplaod does suggest a server problem.

If you have it unzipped then use FTP to copy the event_switcher_gh folder into the administrator/components/com_chronoforms/form_actions folder.

There should be four files in the folder:
event_switcher_gh.ctp
event_switcher_gh.php
index.html
readme.txt

Only the first two are critical for the action to work.

Bob
wmuckell 12 Apr, 2012
Still bit of a problem.

Put this code in the event switch which I post for any correction
<?php if ($form->data['partner']==""){
return "event_a";
}else{
return "event_b";
}
?>


However when I add the events as seen in the screen prints and then save, the events within Event A and Event B disappear? Why is this

[attachment=1]Screen Shot 2012-04-12 at 12.48.27.png[/attachment]
[attachment=0]Screen Shot 2012-04-12 at 12.49.04.png[/attachment]
GreyHead 12 Apr, 2012
Hi wmuckell,

Hmmm. I don't know. I updated the code earlier this week to fit in with some changes in the latest release of ChronoForms, maybe I broke something in the process and didn't spot it in my testing. I'll take a look later this afternoon.

Bob
GreyHead 12 Apr, 2012
Hi wmuckell,

Just an interim update. I can see the problem. It looks as though the events are being saved OK (I can see them in the database table) but aren't re-loading. I've asked Max to see if he can suggest where the problem might be as I can't see anything obvious in my code.

Bob
wmuckell 12 Apr, 2012
Bob,

Thanks can you let me know via this forum when you have figured it out.

Ta

Warren
GreyHead 12 Apr, 2012
Hi Warren,

Max found my error - I had prettifed a few lines by adding some line-breaks and they needed to be in a particular layout - without the pretty line-breaks.

The copy on my site has been updated and I've emailed you a copy.

Apologies for the inconvenience.

Bob
wmuckell 12 Apr, 2012
Bob,

As always both you and Max are legends!

Thanks for all your help

Warren
This topic is locked and no more replies can be posted.