• Resolved IndikatorDesign

    (@indikatordesign)


    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?

    1. 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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @indikatordesign

    I hope you’re well today and thank you for contacting us!

    Note please: as per this forum rules we cannot discuss pro (premium) products and features here. But that’s just for future reference – these particular issues are “universal” and apply also to free version so let me respond below.

    1. Hidden fields value

    Since 1.24 release for security reasons values of the hidden fields are additionally sanitized and validated. If you change them like this directly in form markup, you will see values in page source but upon form submission they will be stripped off and replaced with whatever was set for that hidden field in form configuration.

    The simplest solution for that is to replace hidden fields with “input” type fields on the form and then just hide those fields with CSS (note: with CSS, not with “visibility” settings of the field). If you update field IDs accordingly in your code, it should work.

    2. Payment data

    Payments are handled directly by the chose payment gateway and we actually do not have access to any data that’s in PayPal or Stripe field – those fields are rendered and data is handled entirely by PayPal/Stripe APIs respectively.

    A workaround for that is to NOT use “fixed amount” payment setting in payment field configuration.

    Instead put an additional field on the form (e.g. of “calculation” type) and put your payemnt amounts in that field, then use that field as a source of “variable” payment amount in payment settings.

    This way payment will work exactly the same way but the value of the field will be included in your data in custom code so you’ll get access to that amount.

    Best regards,
    Adam

    Thread Starter IndikatorDesign

    (@indikatordesign)

    Thanks a lot, for your clarification. I will give it a try.

    But there is another thing. I need to add a password field to a complex form. Since you cannot choose a password field from the field settings, I tried to use a text field. The problem:

    This string:

    JL)!t&Fq0dE%%hWoq3jG7

    becomes this string and I cannot disable sanitizing:

    JL)!t&Fq0dE%%hWoq3jG7

    Not sure why it adds “amp;“, but it do not work.

    This hasn’t any affect: https://wpmudev.com/forums/topic/forminator-workaround-for-password-field/

    Thanks

    Plugin Support Laura – WPMU DEV Support

    (@wpmudevsupport3)

    Hi @indikatordesign,

    Hope this message finds you well and thanks for the update.

    The & is the HTML for & ampersand symbol

    I did test this snippet from the ticket you share and I did submit this:

    JL)!t&Fq0dE%%hWoq3jG7

    And get the same value submitted:

    https://prnt.sc/Esf72XlGtQYf

    I shared my test form for only that field so you can compare it here: https://pastebin.pl/view/58489bb7

    Also, the value was also saved as it is in the database.

    Kindly take a look and let us know your comments.

    Kind regards,
    Laura

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @indikatordesign

    We haven’t heard from you in a while, I’ll go and mark this thread as resolved. If you have any additional questions or require further help, please let us know!

    Kind Regards,
    Kris

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘No payment data in submission’ is closed to new replies.