Transactional Meta Sync Issues
-
Hello team,
I’ve been struggling to figure out how to send additional meta data to Mailchimp from my WooCommerce transactions. Basically for every WooCommerce order that I produce, I enter a custom field/meta that indicates when the order is due (meta it called ‘order_due’ saved as MM/DD/YYYY) that I would like to pass to Mailchimp. I’ve found and reviewed older threads of people asking the similar questions, and even found a Wiki on how to do it; yet, I am still unsuccessful.
https://github.com/mailchimp/mc-woocommerce/wiki/Custom-Merge-Tags
I am hoping it is something very obvious like an incorrect hook, but here is what I have so far. Please also let me know if my syntax is okay since I’m not very PHP savvy.
> In Mailchimp I’ve added a new merge Date Field with the ORDERDATE tag name.
> Here is my current code snippet that I am trying to print to the Mailchimp log but not getting anything. I’m trying to get the post ID and from there grab the specific meta info and pass it to Mailchimp.
// Pass Order Due meta to Mailchimp add_filter('mailchimp_sync_user_mergetags', 'custom_user_merge_tags', 10, 2); // Mailchimp custom merge tags function custom_user_merge_tags($merge_vars, $order) { $orderDue = get_post_meta( $order->get_id(), 'order_due', true ); $merge_vars['ORDERDATE'] = $orderDue ; mailchimp_log('trace', 'custom_fields', $merge_vars); return $merge_vars; }
The topic ‘Transactional Meta Sync Issues’ is closed to new replies.