• Resolved ceralis

    (@ceralis)


    Hello

    this code doesn’t work anymore

    Can you help me?

    <?php

    /**

    • Create a custom error message
      */

    add_filter(‘forminator_custom_form_submit_errors’, ‘my_custom_form_validation’, 10, 3);

    function my_custom_form_validation($submit_errors, $form_id, $field_data_array) {

    // Skip if is not the correct form
    if((int)$form_id !== 235465){
    return;
    }
    $num1 = (int) $_POST[‘number-6’];
    $num2 = (int) $_POST[‘number-7’];
    $num3 = (int) $_POST[‘number-5’];
    $num4 = (int) $_POST[‘number-4’];
    $num9 = (int) $_POST[‘number-9’];
    $num10 = (int) $_POST[‘number-10’];
    $num11 = (int) $_POST[‘number-11’];
    $num12 = (int) $_POST[‘number-12’];

    // Custom error if ID already submited
    if($num1 + $num2 + $num3!= 6 && $num4>0){
    $submit_errors[][ ‘number-6’] = ( ‘Le total doit être égal à 6Kg, Merci de modifier vos quantités’ ); $submit_errors[][ ‘number-7’] = ( ‘Le total doit être égal à 6Kg, Merci de modifier vos quantités’ );
    $submit_errors[][ ‘number-5’] = __( ‘Le total doit être égal à 6Kg, Merci de modifier vos quantités’ );
    }

    // Custom error if ID already submited
    if($num10 + $num11 + $num12!= 3 && $num9>0){
    $submit_errors[][ ‘number-10’] = ( ‘Le total doit être égal à 3Kg, Merci de modifier vos quantités’ ); $submit_errors[][ ‘number-11’] = ( ‘Le total doit être égal à 3Kg, Merci de modifier vos quantités’ );
    $submit_errors[][ ‘number-12’] = __( ‘Le total doit être égal à 3Kg, Merci de modifier vos quantités’ );
    }

    // Always return $submit_errors
    return $submit_errors;

    }

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @ceralis

    I hope you are doing well today.

    I pinged our SLS Team to check did we deprecated some of the old hooks or filters. Please note that custom coding is outside the scope of support to provide such a thing. We will post an update here as soon as more information is available.

    Kind Regards,
    Kris

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi again @ceralis

    Please corrent in those lines:

    if((int)$form_id !== 235465){
    return;
    }

    return; to ?return $submit_errors;

    Kind Regards,
    Kris

    Thread Starter ceralis

    (@ceralis)

    Hello

    Thanks for your feedback, I’ve just modified it but the alert message still doesn’t appear.

    Plugin Support Zafer – WPMU DEV Support

    (@wpmudevsupport15)

    Hi @ceralis,

    I hope you are doing well today!

    As the update in the code did not fix the issue, I’m afraid this will be outside the scope of support we can provide. For that, you’ll need to hire a developer to provide the required custom code for you. WordPress provides a jobs directory here https://jobs.wordpress.net/, if you need further advice about it, feel free to email [email protected].

    Subject: ATTN: WPMU DEV support – wp.org”

    Kind regards,
    Zafer

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @ceralis,

    Since we haven’t heard from you for a while. I’ll mark this thread as resolved for now. Please feel free to re-open this thread if you need any further assistance.

    Regards,

    Nithin

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.