@gunadurai We are using the ->get_billing_phone method on the woocommerce orders, and we attach it to the billing address. Are you not seeing anything there? Can you think of any reason it’s not showing up on the customer in Mailchimp? Have you asked support yet to look into that for you?
If you’re doing something else custom outside the WooCommerce defaults, have you tried using the custom merge tags feature? This should allow you to add the phone number if you’re still running into issues.
Hi @gunadurai, we’re going to close out this ticket for now since it’s been a few weeks since we’ve been in touch.
Please let us know if you still need any help and we’ll be glad to reopen and troubleshoot further. Please note, the best way to reach us is over at the GitHub plugin page. From there, you can receive direct responses from the development team, log new issues, download the latest version, and track existing support tickets.
Hi, I am facing the same issue. Can you help me resolve this?
solution found here
https://github.com/mailchimp/mc-woocommerce/issues/725
this should work by putting that exact snippet as is in your theme functions.php file.
/**
* @param array $merge_tags
* @param MailChimp_WooCommerce_Order $order
* @return array
*/
function mailchimp_custom_order_merge_tags($merge_tags, $order) {
// the phone number can be used from either the shipping address, or the billing address.
//$shipping_phone_number = (string) $order->getShippingAddress()->getPhone();
$billing_phone_number = (string) $order->getBillingAddress()->getPhone();
// this is what I would do – only supply it if the phone number is there.
if (!empty($billing_phone_number)) {
$merge_tags[‘PHONE’] = $billing_phone_number;
}
// return the merge tags to be submitted.
return $merge_tags;
}
add_filter(‘mailchimp_get_ecommerce_merge_tags’, ‘mailchimp_custom_order_merge_tags’, 10, 2);
-
This reply was modified 5 years, 4 months ago by
jayk1.