can’t set subscriber interest group with woocommerce checkout integration
-
I am trying to set the billing city and interest group via the woocommerce checkout form using the mc4wp woocommerce integration. I am using the following code in the function.php file in my theme:
add_filter( 'mc4wp_integration_woocommerce_subscriber_data', 'woocommerce_mailchimp_bb', 10, 1); function woocommerce_mailchimp_bb( $subscriber ) { $subscriber->merge_fields[ "TOWN" ] = sanitize_text_field( $_POST['billing_city'] ); $subscriber->interests[ "aaa7c012dc" ] = true; return $subscriber; }
The TOWN merge field is working perfectly. But the subscribers interest is not being set.
The interest id is correct (it is normally a variable but I just hard-coded it for testing purposes).
And I have just installed the latest version of the plugin.Do you have any suggestions?
Any help would be greatly appreciated.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘can’t set subscriber interest group with woocommerce checkout integration’ is closed to new replies.