• Resolved anisf18

    (@anisf18)


    Hello Guys, I want to ask
    I am using GamiPress for points on my website, and I have a registration form using Zoho Form, but I downloaded the Zoho Form as plain HTML and placed it in the ACF Code Editor.

    How can I ensure that when users submit the form I created with the code editor, they will receive points from GamiPress?

    Thanks before

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Tino Calvo

    (@tinocalvo)

    Hi @anisf18 ,

    If you are using this form to register new users, you can use the event “User registers”.

    Also, you can use the ACF events to detect changes in custom fields to register the information of the Zoho Form.

    Currently we don’t have events for Zoho Forms, so please consider using one of the soultions above.

    The events related to form submissions are available in the forms integrations that you can find in the next list: https://gamipress.com/add-ons/#integrations .

    Hope it helps!

    Thread Starter anisf18

    (@anisf18)

    Hello @tinocalvo

    I am using a custom Zoho Form for event registration, and because some customizations are needed for data parsing, I am using ACF to customize the Zoho Form.

    Does that mean it’s not possible to create a trigger when users click submit?
    For example, if I give the submit button an ID to trigger the GamiPress point slug.

    Thread Starter anisf18

    (@anisf18)

    I tried using acf/save_post like this:

    function detect_acf_changes_and_register_zoho_form($post_id)
    {
    // Ensure the form is from ACF
    if (isset($_POST['acf'])) {
    // Retrieve data from the ACF field, for example, from the 'register_section' group
    $register_section = get_field('register_section', $post_id);

    if ($register_section) {
    // Retrieve the subfield 'register_form' from the group or repeater
    $zoho_form_data = $register_section['register_form'];

    // Ensure the form data is not empty
    if ($zoho_form_data) {
    // Function to save or register Zoho Form
    register_zoho_form_data($zoho_form_data);

    // Award points to the user with the correct point slug
    $current_user_id = get_current_user_id();

    if ($current_user_id) {
    // Replace 'event_registration_points' with the appropriate point slug
    gamipress_award_points_to_user($current_user_id, 150, 'my_slug_point');
    error_log("Points awarded to user ID: " . $current_user_id);
    } else {
    error_log("No user is logged in.");
    }
    }
    }
    }
    }
    add_action('acf/save_post', 'detect_acf_changes_and_register_zoho_form', 20);

    But it still doesn’t work, and I also tried using Automatic Point Update, but when I select the post I created in ACF and update it, the selection goes back to empty again.

    Plugin Author Tino Calvo

    (@tinocalvo)

    Hi @anisf18 ,

    I’m sorry but we do not offer support for custom developments.

    Although, maybe you want to check our documentation to create your own events:

    Hope it helps!

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