From: Steve Sutton Date: Mon, 18 Dec 2017 14:47:37 +0000 (-0500) Subject: I have the custom fields being saved now. X-Git-Tag: v1.0.0^2~175^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=8f3cba86cf702ece4bac1bfbe7e318d73861c1d1;p=WP-Plugins%2Fglm-member-db-registrations.git I have the custom fields being saved now. Calling the apply_filters for the submit of custom fields when the registrant is being added or updated by way of ajax. --- diff --git a/gulpfile.js b/gulpfile.js index 17baa4d..d9f8e11 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,7 +1,7 @@ var gulp = require('gulp'), concat = require('gulp-concat'), uglify = require('gulp-uglify'), - // jshint = require('gulp-jshint'), + jshint = require('gulp-jshint'), plumber = require('gulp-plumber'); // notify = require('gulp-notify'); diff --git a/models/admin/ajax/regFront/registrant.php b/models/admin/ajax/regFront/registrant.php index 12fa5b7..37b16ea 100644 --- a/models/admin/ajax/regFront/registrant.php +++ b/models/admin/ajax/regFront/registrant.php @@ -344,11 +344,6 @@ class GlmMembersAdmin_registrations_ajax_registrant extends GlmDataRegistrations '%s' ); $accountId = $this->wpdb->insert_id; - $queryParams = parse_url( $modelData['customFields'] ); - - // Store the custom field data - $_REQUEST = $queryParams; - apply_filters( 'glm-members-customfields-form-submit', '', 'glm_reg_customfields_reg_event_attendee_' . $modelData['reg_event'], $accountId, true); // Here validated would be false. // Because it is new account. } @@ -500,6 +495,20 @@ class GlmMembersAdmin_registrations_ajax_registrant extends GlmDataRegistrations $registrant['reg_time_text'] = $regTimeText; } + // Parse str for the custom field data + parse_str( $modelData['customFields'], $queryParams ); + + // Store the custom field data + $_REQUEST = $queryParams; + trigger_error(print_r($_REQUEST,1)); + apply_filters( + 'glm-members-customfields-form-submit', + '', + 'glm_reg_customfields_reg_event_attendee_' . $modelData['reg_event'], + $regRequestRegistrantId, + true + ); + return $registrant; } diff --git a/views/front/registrations/registration.html b/views/front/registrations/registration.html index e698e4c..9c8ff3f 100644 --- a/views/front/registrations/registration.html +++ b/views/front/registrations/registration.html @@ -357,6 +357,7 @@ var app = { 'parentFormId': '', 'formData': false }; + console.log( 'formData:', formData ); $.ajax({ type: 'POST', url: ajaxUrl,