• Resolved florianm

    (@florianm)


    I am trying to include a custom user field in summary report by customers. I can see this field in the standard order export, but not in the summary report by customers. I register the custom user field as follows and it works:

    function eliv_woocommerce_checkout_update_user_meta( $customer_id, $posted ) {
       if (isset($posted['billing_company_id'])) {
            $dob = sanitize_text_field( $posted['billing_company_id'] );
            update_user_meta( $customer_id, 'company_id', $dob);
      }
    }
    add_action( 'woocommerce_checkout_update_user_meta', 'eliv_woocommerce_checkout_update_user_meta', 10, 2 );

    What do I need to do to be able to include this data in the summary report by customers?

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

    (@algolplus)

    Hello

    1. please, open >Setup Fields, click “Add field” and use key “USER_company_id”
    2. please, open “Misc Settings” and put this PHP code.
    thanks, Alex

    add_filter('woe_get_order_fields', function ($fields) {
    	$fields['USER_company_id'] = array( 'label' => 'USER Company ID', 'colname' => 'USER Company ID', 'checked' => 1, 'segment'=>'user' );
    	return $fields;
    });
    Thread Starter florianm

    (@florianm)

    Thank you! It’s working

    Plugin Author algol.plus

    (@algolplus)

    you’re welcome.

    but actually , it’s a bug .
    it should work without code.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Include A Custom User Field In Summary Report By Customers’ is closed to new replies.