• Resolved oliz

    (@oliz)


    Hi

    I installed the plugin and everything works fine so far. If someone orders something, I would like to fill a custom field.

    In MailChimp I created a custom field “TEST”.
    https://share.getcloudapp.com/wbu6QrDG

    Now I try to fill the field with the following code:

    add_filter('mailchimp_sync_user_mergetags', function ($merge_vars)
    {
       $merge_vars['TEST'] = 'Hello';
    
       return $merge_vars;
    }, 100, 2);

    If I order now, this value is never set in MailChimp.

    I would be very happy if you could help me.

    Kind regards,
    Olivier

    • This topic was modified 4 years, 11 months ago by oliz.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author ryanhungate

    (@ryanhungate)

    @oliz This is interesting that it’s not working properly. The only thing that comes to mind at first is that the user must be “subscribed” to the newsletter otherwise this would not be submitted. Can you see other people getting subscribed to your list correctly? Are you seeing e-commerce data in the member profile?

    We’ll get this figured out for you somehow. This looks correct to me 🙂

    Thread Starter oliz

    (@oliz)

    Hi

    After I’ve ordered, the email appears first in MailChimp and is not marked as “Subscribed”. After a few minutes, the entire order data appears and then it’s marked as “Subscribed”.

    Kind regards,
    Olivier

    Plugin Author ryanhungate

    (@ryanhungate)

    @oliz ok so the next question I would have would be “where did you add this snippet”? Can you please add one line of code in this function so we can make sure it’s actually firing?

    mailchimp_log('testing', "show hello tag", array('tags' => $merge_vars));

    If this is showing up in your logs then I would also like to see the merge var submission for this user which should be right below this log if you’re getting submitted properly.

    Please report back with this info and we can get to the next step of debugging.

    Plugin Support khungate

    (@khungate)

    Hi @oliz, 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: https://github.com/mailchimp/mc-woocommerce/. From there, you can receive direct responses from the development team, log new issues, download the latest version, and track existing support tickets.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Custom field not working’ is closed to new replies.