Forums

Conditional or linked field values

Greg R. 07 Mar, 2014
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?
GreyHead 08 Mar, 2014
Hi Greg R,

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
Greg R. 08 Mar, 2014
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.
Greg R. 08 Mar, 2014
Ah... would this be because I am using the free trial version?🙂
Greg R. 10 Mar, 2014
Ok, fantastic, now a Paypal patch for v4 is mentioned, as I am validated but randomizer is still happening?
Greg R. 10 Mar, 2014
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.
GreyHead 26 Mar, 2014
HI GregR,

If you just want to send an email then ReDirect to PayPal I suggest that you use the ReDirect User and ReDirect URL actions. You only need IPN if you need to have immediate confirmation that the payment has succeeded (or not).

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