No payment data in submission
-
Hey there,
some weeks ago I used a free trial for your Pro Extensions. I tried “forminator pro”. Then it was to do a lot in another project and I cancelled it.
Maybe I will give it a another try, cause it is really powerful and I like the approach to go with something like this instead of Woo for digital products.
But I have 2 crucial problems why I cannot use it at the moment. Maybe there is a fix. Then I can reactivate my membership, otherwise it makes no sense.
I still have the Pro Plugin form this time, but not in an actual version. Maybe it is fixed now?
- I need to add some values on the fly to some hidden fields. For example an affiliate ID, so that we can recognise the affiliate after transmission. I use the filter “forminator_field_markup” to hook into the existing values. Than I use something like this:
public function changeForm( $html, $field, $that ) { if ( 1234 == $that->model->id ) : switch ( $field['element_id'] ) : case 'hidden-1': if ( isset( $_COOKIE['ref_id'] ) ) $replace = 'value="' . esc_attr( $_COOKIE['ref_id'] ) . '"'; break; case 'hidden-5': if ( isset( $_COOKIE['another'] ) ) $replace = 'value="' . esc_attr( $_COOKIE['another'] ) . '"'; break; endswitch; endif; if ( isset( $replace ) ) $html = str_replace( [ 'value=""', 'value="%X%"' ], $replace, $html ); return $html; } // end changeForm
Where
%X%
is a placeholder set for the hidden field.The problem: the value will not be added. Is there a better possibility?
2. The biggest problem. If the form is sent to purchase something, I hook into “forminator_form_ajax_submit_response” and check for success. Then I retrieve the submitted values from the form, because I need to give permissions to the users if the payment is successfully. If it is s new user, a new account is generated etc. And it works really nice with name, email etc..
BUT the payment data are not transferred. So I cannot get the amount, and that is really a problem. Especially if you work with coupons.
Also the values from calculations are not transferred. Is there a way to fix that? Or is there a better hook available where I can check for a success payment before?
public function formResponse( $response, $formID ) { if ( '1234' == $response['form_id'] ) : if ( true == $response['success'] ) : $p = $_POST; // no payment values in $p // no payment values in $response // do whatever return $response; } // end formResponse
Thanks for your help.
- The topic ‘No payment data in submission’ is closed to new replies.