This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 3
Paypal options
Started 14 years ago by jpello | 4 posts |
-
Hello,
I am trying to create a form and the users would like to have the option of Check or Paypal.
Is it possible to only have the form direct them to paypal if they select a dropdown that says "paypal", rather than EVERYONE being directed?
In regards to check processing, we were just going to email them an address for that...
Any help or suggestions would be great- thanks
Posted 14 years ago # -
This should work if you are using the "Show Review Page Before Submitting" option. It may also work without the "Show" option enabled. In file post-functions.php
At around line 2254 change from:
//if there is no error message or elements, send true as status if(empty($error_elements) && empty($process_result['custom_error'])){ $process_result['status'] = true; if($form_page_total > 1){ //if this is multipage form $_SESSION['mf_form_loaded'][$form_id][$page_number] = true;To:
//if there is no error message or elements, send true as status if(empty($error_elements) && empty($process_result['custom_error'])){ $process_result['status'] = true; // Start custom modification by Firstname Lastname 15-Aug-2012 15:26 ---------------------------------------------- // This is to make all table data available to other PHP programs. $_SESSION['is_valid_user'] = true; $_SESSION['form_data'] = $table_data; // End custom modification by Firstname Lastname 15-Aug-2012 15:26 ---------------------------------------------- if($form_page_total > 1){ //if this is multipage form $_SESSION['mf_form_loaded'][$form_id][$page_number] = true;At around line 3037 change from:
$merchant_redirect_url = 'https://www.paypal.com/cgi-bin/webscr?'.http_build_query($paypal_params,'','&'); }//end paypal standard } if($payment_has_value){ return $merchant_redirect_url; }else{ return ''; }To:
$merchant_redirect_url = 'https://www.paypal.com/cgi-bin/webscr?'.http_build_query($paypal_params,'','&'); }//end paypal standard } // Start custom modification by Firstname Lastname 15-Aug-2012 15:26 ---------------------------------------------- // If pay by check is selected, then do not redirect to the PayPal site. if ($form_id == 163 && $_SESSION['form_data']['element_4_2'] == 1) { $payment_has_value = false; } // End custom modification by Firstname Lastname 15-Aug-2012 15:26 ---------------------------------------------- if($payment_has_value){ return $merchant_redirect_url; }else{ return ''; }Of course you'll need to use your own form ID and element name. The experts may want to chime in and offer a better solution.
This is for version 3.3.
Posted 14 years ago # -
I have tested this with version 3.4 and it does not function properly. I'm not asking anyone for a fix. I just wanted to let users know it doesn't work with version 3.4.
Posted 13 years ago # -
Yes, there were some changes which affect this behavior.
However, the good news is you don't need to do custom modification again to do the above.Using the skip pages logic on 3.4, you can let your users to select the payment method, between paypal and check or stripe and check.
MachForm Founder
Posted 13 years ago #
Reply
You must log in to post.
