Thanks for the answer and the link. ok, well I am a developer but not a PHP developper. Doing this on the side for someone. I am starting out simple, just seeing if I can get see the changes in MailChimp. I have added two filters but only the one sending over the WEBSITE is working. Can I have these in two seperate add_filter() or do I need to combine them into one? Or is there another reason why the grouping isn’t working.
/*
* Add groupings to MailChimp
*/
add_filter( 'mc4wp_integration_woocommerce_merge_vars', function( $vars ) {
if( ! isset( $vars['GROUPINGS'] ) ) {
$vars['GROUPINGS'] = array();
}
$grouping = array(
'id' => xxxxxx,
'groups' => array( 'un client' )
);
$vars['GROUPINGS'][] = $grouping;
return $vars;
});
/*
* Add extra fields to MailChimp
*/
add_filter( 'mc4wp_integration_woocommerce_merge_vars', function( $merge_vars ) {
// Grab MailChimp field values from the current request
$merge_vars['WEBSITE'] = sanitize_text_field( 'axxxxxxia.fr' );
// Return the fields so the plugin knows to send them to MailChimp
return $merge_vars;
});