Updating add contact processing
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 4 Dec 2018 18:37:10 +0000 (13:37 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 4 Dec 2018 18:37:10 +0000 (13:37 -0500)
Need to ad the billing account update filter apply call inside the
addnew case for creating contacts. Or the billing info is not saved.

models/admin/contacts/index.php

index 3e98fef..d059439 100644 (file)
@@ -285,6 +285,12 @@ class GlmMembersAdmin_contacts_index extends GlmDataContacts
                 if ($contactInfo['status'] && !$newContactEmailExists && !$newContactUsernameExists && !$misMatchedWpUsers) {
                     $contactInfoID = $contactInfo['fieldData']['id'];
                     $customFieldResults = apply_filters( 'glm-member-db-save-custom-fields', $contactInfoID );
+                    if ( isset( $_REQUEST['ref_dest'] ) && $_REQUEST['ref_dest'] ) {
+                        $member_id = filter_var( $_REQUEST['ref_dest'], FILTER_VALIDATE_INT );
+                        if ( $member_id ) {
+                            $billingFieldResults = apply_filters( 'glm-members-billing-contact-save-data', $member_id );
+                        }
+                    }
 
                     // If there's an existing WordPress user matching the E-Mail address but that has a different username
                     if ($contactCheck['wordpressEmail']