• Resolved rommelgracias

    (@rommelgracias)


    Hi,

    I’ve tried to pull in first and last name fields via a registration form using Paid Membership Pro in my Zero BS CRM. I can see that the data is being registered in WP – users are being created and first and last names are being created fine. However, it doesn’t pull through to the CRM even though I’ve chosen the fields and mapped them using the Contact Fields tab.

    I’ve used the following filters as well:

    function my_wpf_filter_registration( $user_meta, $user_id ) {

    if( isset( $user_meta[‘first_name’] ) ) {
    $user_meta[‘fname’] = $user_meta[‘first_name’];
    }
    if( isset( $user_meta[‘last_name’] ) ) {
    $user_meta[‘lname’] = $user_meta[‘last_name’];
    }
    if( isset( $user_meta[‘street_name’] ) ) {
    $user_meta[‘addr1’] = $user_meta[‘street_name’];
    }
    if( isset( $user_meta[‘house_number’] ) ) {
    $user_meta[‘addr2’] = $user_meta[‘house_number’];
    }
    return $user_meta;

    }

    add_filter( ‘wpf_user_register’, ‘my_wpf_filter_registration’, 10, 2 );

    function my_watch_meta_field( $fields ) {
    $fields[] = ‘first_name’;
    $fields[] = ‘last_name’;
    $fields[] = ‘street_name’;
    $fields[] = ‘house_number’;
    $fields[] = ‘postcode’;
    $fields[] = ‘town’;
    $fields[] = ‘newsletter’;
    return $fields;
    }
    add_filter( ‘wpf_watched_meta_fields’, ‘my_watch_meta_field’ );

    I created the name fields with keys first_name and last_name using paid membership pros Register Helper Addon.

    I have Push AND Push All checked in WP Fusion settings. The names only get pushed if I manually push all meta.

    Can you help please?

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author verygoodplugins

    (@verygoodplugins)

    Hey @rommelgracias ,

    Your code looks right. There’s nothing special about PMPro (like custom database tables) that would make it difficult.

    I guess I would error_log() or var_dump() the $user_meta variable coming into your wpf_user_register filter and see if the data is present in the array at that time.

    It’s possible PMPro hasn’t saved the custom fields to the database that early in the registration process, in which case you could try checking

    if( isset( $_POST[‘street_name’] ) ) {

    to grab the data out of the $_POST data instead of the $user_meta array.

    But even if you were missing the data at registration, your usage of the wpf_watched_meta_fields filter should have synced it automatically anyway— so I’m not sure why that’s not working.

    Also FYI this does work automatically in the full version of WP Fusion, and we also automatically detect and sync Register Helper Addon fields. Details here https://wpfusion.com/documentation/membership/paid-memberships-pro/

    Cheers
    Jack

Viewing 1 replies (of 1 total)
  • The topic ‘Can’t pull WP fields into CRM’ is closed to new replies.