1) Activated the non-toolset non-Toolset User Field "mailchimp_woocommerce_is_subscribed" on the Manage non-Toolset User Fields with Toolset Forms screen(see screenshot)
here in dev: hidden link
here in www: hidden link
2) Added the following code to:
- User Form - New Native Nanny User (ID: 1242)
- User Form - New Family User (ID: 1308)
3) Created new users using the forms:
dev Nanny: hidden link (working fine)
www Nanny: hidden link (not working)
dev Family: hidden link (working fine)
www Family: hidden link (not working)
4) Checked each newly created User under WordPress Admin > Users > click a User > scroll to bottom > Mailchimp > observe setting of "User Subscribed" field
(Side note: There is no search feature here unfortunately - would be nice to be able to search here - and the Screen Options is ignoring any changes made to the number of items to show on the page - see screenshot. This happens for all our Screen Options on the Toolset screens! Is this a known issue? Should I open a new ticket regarding this if there is no known workaround?)
Could you please help us understand why it is not working in our production site?
This is really strange and I suspect that there must be conflicting here.
When I try to create a profile form me and when I checked the usermeta table and I found that usermeta key "mailchimp_woocommerce_is_subscribed" is set to 0. I changed the value to 1 and updated that usermeta row but still when I visit the user profile page in backend I still the the checkbox "User Subscribed" is not still active even though I set the meta value to 1 for the meta key "mailchimp_woocommerce_is_subscribed".
Then I tried different approach, I even tried by adding the hook to the code snippet "auto-login-after-cred-user-creation":
=> hidden link
- The following code is currently commented.
add_action('cred_save_data', 'func_set_mailchimp_checkbox',10,2);
function func_set_mailchimp_checkbox($user_id, $form_data) {
if ($form_data["id"]==1242) {
update_user_meta($user_id,'mailchimp_woocommerce_is_subscribed',1);
}
}
When I tried with above code I can see that the user meta key "mailchimp_woocommerce_is_subscribed" is added to the usermeta table with meta value 1. Then I visit the user profile again but still I can see even though the usermeta value is set to 1 for the user meta key "mailchimp_woocommerce_is_subscribed", still the "User Subscribed" is shown unchecked.
There must be conflicting something here. You will have to check by deactivating plugins or theme or is there any dependency to to make that checkbox "User Subscribed" checked that you will have to check with plugin author.
We received an update from Mailchimp support, but I need to discuss its legal ramifications with my colleague. I will update you on Wednesday if we need further technical assistance here.