• Resolved npal.radhika

    (@npalradhika)


    This has answered before but I still continue to face the issue where for some reason the phone number is not getting exported to Mailchimp. As suggested before I have added the following code to the functions.php file but it still does not work:

    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);
    ?>

    One more question – if someone checks out without creating an account then will address and phone be picked?

    Please help

Viewing 1 replies (of 1 total)
  • Plugin Support khungate

    (@khungate)

    Hi @npalradhika, we appreciate your patience. We’ve done some testing on our end and by our testing everything works as expected. When you submit things, can you confirm that the billing and shipping phones are present on the order, and the “PHONE” merge tag created in Mailchimp?

Viewing 1 replies (of 1 total)

The topic ‘Phone Number Not syncing’ is closed to new replies.