• Resolved arthurlam1

    (@arthurlam1)


    Does WooCommerce give a unique ID to all visitors on a website (both logged in or not logged in)?

    If so, how do we see this information?

Viewing 2 replies - 1 through 2 (of 2 total)
  • @arthurlam1

    This is not specific Woocommerce. But if you need an ID, which you can use as a customer ID you have to add this via Code. but it works only for registerd users. We use the same.
    This will insert a new column to the users which you can see in the WP Backend
    Code:

    /* AD the User ID in WP */
    
    /*
     * Adding the column
     */
    function rd_user_id_column( $columns ) {
    	$columns['user_id'] = 'ID';
    	return $columns;
    }
    add_filter('manage_users_columns', 'rd_user_id_column');
     
    /*
     * Column content
     */
    function rd_user_id_column_content($value, $column_name, $user_id) {
    	if ( 'user_id' == $column_name )
    		return $user_id;
    	return $value;
    }
    add_action('manage_users_custom_column',  'rd_user_id_column_content', 10, 3);
     
    /*
     * Column style (you can skip this if you want)
     */
    function rd_user_id_column_style(){
    	echo '<style>.column-user_id{width: 5%}</style>';
    }
    add_action('admin_head-users.php',  'rd_user_id_column_style');
    
    Plugin Support Tseten a11n

    (@tibetanitech)

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WooCommerce give a unique ID to all visitors on a website?’ is closed to new replies.