Forums

Event Switcher Activation

DINAWebMan 08 Oct, 2013
I have installed Event Switcher and it shows up as Custom Action. I have dragged it onto my event and added the following code:
<?php

if ($form->data['PaymentType'] == 'Invoice') {
return 'event_a';
}elseif{($form->data['PaymentType'] == 'Credit Card')
return 'event_b';
}elseif{($form->data['PaymentType'] == '')
return 'event_c';
}
?>

I have hard coded an input field for PaymentType and made its value Invoice. I get the next item in my main event which is a Thanks message. It is as though the Event Switcher was not activated.
GreyHead 08 Oct, 2013
HI DINAWebMan,

I think that you have the { misplaced in the elseif lines. Please try:
} elseif ( $form->data['PaymentType'] == 'Credit Card' ) { 

Bob
DINAWebMan 09 Oct, 2013
I hate user errors especially mine. Thanks for the time. It is working like a charm.
This topic is locked and no more replies can be posted.