Hi Bob,
Can you provide me a link to one of your forms.
I guess it’s hard for me to explain why this wouldn’t be working as intended.
I will try to use the example you provided above as an explanation. From my understanding you have two hidden interest groups just below the form fields.
Those interest groups are Member Level, and Book.
If a user is currently a member (let’s say ‘free member‘), but not interested in a book then on your subscriber list you see them listed under subscribers, with the interest group ‘Free Member’ assigned to the ‘Member Level’ interest group and nothing assigned to the ‘Book’ interest group.
Now, let’s say they want to go back to update the details in the form and want to now select a book, while leaving their membership level untouched.
When the form is rendered, the form/MailChimp has no idea what membership level the user viewing the form is – so it will default to the first displayed radio button, in this case ‘Prospect’. If the form field is hidden, then the user who submits to form will then be re-assigned to the membership level, ‘Prospect’.
The ONLY way around this would be to display a form back to the user with ONLY the book level selectable (or pre-selected) – so that NO DATA related to a membership level is submitted with the form.
Your other option, which is a bit more involved and would require a developer (unless your comfortable writing code). What you can do in this instance is on form submission fire off an API request to MailChimp to retrieve the current users data, and only repopulate the data that you need to update.
—
In short, if you wanted to update one interest group while leaving the other as is, the only simple solution would be to attach the field you want updated while excluding the interest group you want left alone.
My question to you, if a new user is signing up for your mailing list, but you have the member level and book interest groups hidden, how are you deciding what the member level is? Based on the page they are using the sign up from?
However, there is one parameter in the API request that allows you to completley replace interest groups associated with a given subscriber, or to simply add them on to the existing ones. By default, the interest groups get replaced. You may want to try altering this parameter so that the interest groups are added onto, instead of replaced.
replace_interests - bool - (optional) - optional flag to determine whether we replace the interest groups with the groups provided or we add the provided groups to the member's interest groups (optional, defaults to true)
Here is the snippet of code that handles new subscribers to a mailing list:
https://github.com/yikesinc/yikes-inc-easy-mailchimp-extender/blob/master/plugin_core/public/partials/shortcodes/process/process_form_submission.php#L82-L90
I recommend that you alter this bit of code to the following, and testing again – this may be a simple solution:
$subscribe_response = $MailChimp->call('/lists/subscribe', array(
'api_key' => $api_key,
'id' => $list_id,
'email' => array( 'email' => sanitize_email( $_POST['EMAIL'] ) ),
'merge_vars' => $merge_variables,
'double_optin' => $optin_settings['optin'],
'update_existing' => $optin_settings['update_existing_user'],
'send_welcome' => $optin_settings['send_welcome_email'],
'replace_interests' => 0
) );
If you want to email me at Evan@yikesinc.com, I can alter some of the existing code and send over an altered version of the current plugin. If that does indeed help, we can implement a filter in that location to allow you to tweak the settings without altering the code base.
Let me know either way, I’m more than happy to work with you try and find a solution to your problem.
Thanks!
Evan