• Resolved easylinkword

    (@easylinkword)


    Hello,

    I would like to know if the plugin supports customer search based on custom fields.

    I have a b2b plugin that creates new registration fields and I would to know if I can search for them on “Find or create a customer” section.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author algol.plus

    (@algolplus)

    Hello

    We use WooCommerce customer search, so it’s possible to modify search,
    using this hook (I put code to enable search by billing phone).

    add_filter( "woocommerce_customer_search_customers", function ( $filter, $term, $limit, $type ) {
    if ( $type == 'meta_query' ) {
    $filter['meta_query'][] = array( 'key' => 'billing_phone', 'value' => $term, 'compare' => 'LIKE' );
    }
    return $filter;
    }, 10, 4 );

    Thread Starter easylinkword

    (@easylinkword)

    Hello,

    Thank you for your fast reply.
    It works like a charm thank you!

    Plugin Author algol.plus

    (@algolplus)

    You’re welcome

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom fields for user’ is closed to new replies.