• Resolved avivas

    (@avivas)


    Hi,
    I have added an additional (birthday and cellphone) field to checkout page, I would like to snyc this over to mailchimp.

    What filter will can use for work it?

    I added this filter in funtions.php, but it doesn’t work

    add_filter( ‘mailchimp_sync_user_data’, function( $data, $user ) {
    $data[‘MMERGE5’] = $user->nacimiento;
    $data[‘MMERGE6’] = $user->cellphone;
    return $data;
    }, 10, 2 );

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author ryanhungate

    (@ryanhungate)

    @avivas one thing that you’ll want to do is verify the format of your Birthday field. If you’re storing a value of 1/1 in your database, you’ll need to make sure that the field on Mailchimp also accepts the same format. If you don’t pass the string in there exactly as you set up, it will fail.

    Also you’ll probably want to cast your cellphone merge tag to a string. (string) $user->cellphone.

    Can you add mailchimp_log('trace', 'custom_fields', $data); in your custom function to see what’s being submitted?

    Are you getting any other errors to look at in the plugin logs while submitting the member?

    Thread Starter avivas

    (@avivas)

    Thank for your answer,
    The format of me Birthday field is dd/mm/yy and the field Mailchimp format is ‘text’ for to avoid errors.

    I also did the test with a date field in the same format dd/mm/yy, but it still doesn’t work..

    I’m sorry about my poor English, I can’t handle it well

    Plugin Author ryanhungate

    (@ryanhungate)

    @avivas sorry for missing this last post – but are you still experiencing the merge field not being submitted to Mailchimp? Changing your merge tag to a text field is the least restrictive thing you could do – meaning there is no reason it would fail even if you changed the formatting. Can you please verify that this is still a problem? Have you added the log to SHOW the merge tags you’re trying to submit as a debugging tool?

    Plugin Author ryanhungate

    (@ryanhungate)

    @avivas we’ll go ahead and close this out since we haven’t heard back from you in a while. Please feel free to write back if you needed help – we’ll be glad to continue this with you if you need it.

    Plugin Author ryanhungate

    (@ryanhungate)

    just in case you didn’t see this before, the documentation on using custom merge tags is here:

    https://github.com/mailchimp/mc-woocommerce/wiki/Custom-Merge-Tags

    Pretty sure you might have been using the wrong custom hook name ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Send more WooCommerce fields to list’ is closed to new replies.