Hello,
Thank you for the answer Lap!
We have this extra field in our checkout form:
<input type=”hidden” name=”mc4wp-goal” id=”mc4wp-goal” value=”Goal Name”>
The field is named “GOAL” in Mailchimp.
We use code from the reference you sent us:
add_filter( ‘mc4wp_integration_woocommerce_data’, function( $data, $order_id ) {
$order = wc_get_order( $order_id );
$data[ ‘mc4wp-GOAL’ ] = $order->get_mc4wp-GOAL();
return $data;
}, 10, 2);
However, when we add the code to functions.php, woocommerce checkout giving us unknown warning (empty “woocommerce-error”) and order can’t be finished.
When we use this code below, payment works fine, however “GOAL” field is still empty in Mailchimp:
$data[ ‘mc4wp-GOAL’ ] = $order->get_meta( ‘mc4wp-GOAL’, true );
We tried many other ways, however field “GOAL” is always empty in Mailchimp. We would be grateful if you can suggest us any solution, how to send value from additional hidden field.
The goal is a Woocommerce product, however, it’s not a typical Woocommerce product, because it’s generated by Woocommerce Quick Donation plugin. So this is why we are “trying” with this extra field…
Best Regards