This should be pretty straightforward, but I haven't found the correct search term yet. I want to pass a price value to Paypal based upon a select list value. Therefore I need to set value {amount} = 'x' if value {item} = 'a', and value {amount} = 'y' if value {item} = 'b'. Got a link?
Forums
Conditional or linked field values
Hi Greg R,
Please try a Custom Code action before the Redirect action with PHP like this:
Bob
Please try a Custom Code action before the Redirect action with PHP like this:
<?php
switch ( $form->data['item'] ) {
case 'a':
$form->data['value'] = x;
break;
case 'b':
$form->data['value'] = y;
break;
}
?>
Bob
Bob, thanks for that. I apologize for going off topic, but what I did in the interim, is set up a Dynamic Dropdown action to control a second dropdown, which would then hide with CSS. The point of this as I mentioned is to pass a dollar amount to Paypal. When I tested this, my $30 item ends up at $150 on the Paypal checkout page. My $300 item ends up at $900. Do you have any idea what might be happening? I am passing the values '30' and '300' respectively.
Ok, fantastic, now a Paypal patch for v4 is mentioned, as I am validated but randomizer is still happening?
Ok, perhaps I should have approached this whole thing differently. I'm trying to follow your tutorial here, http://www.chronoengine.com/faqs/57-cfv4/cfv4-actions/2583-how-to-use-the-paypal-redirect-action.html but I'm not sure I even need to email from the ipn action? Doing so requires a database save and a database load. I just want to email the info, then redirect them to Paypal to pay.
This topic is locked and no more replies can be posted.