This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Condition loop in post-functions.php


  1. chickc
    Member

    I have this in post-functions.php

    $processed_column_name[] = $column_name;
    
    									if(!empty($amount) && ($amount !== '0.00')){
    									  $payment_has_value = true;
    
    									  $paypal_params['item_name_'.$i] = $item_name;
    									  $paypal_params['amount_'.$i] 	  =round($amount);
    									  $i++;
    									}

    I want get it this $paypal_params['amount_'.$i] = round(0.5*$amount) for only one condition form_id=7739 and radio button id=10 has value 1, first choice. All other van go further .How to do that?

    Posted 10 years ago #
  2. yuniar

    At the top of that block of code, you can add this code:

    $entry_values = mf_get_entry_values($dbh,$form_id,$entry_id);

    that would get all the values of your field into "$entry_values" as an array.

    You can then use the array to create the if statement, something like this:

    if($entry_values['element_10'] == 1 && $form_id == 7739){
        $paypal_params['amount_'.$i] = round(0.5*$amount);
    }

    MachForm Founder

    Posted 10 years ago #

RSS feed for this topic

Reply