Display user search page
-
Hi, Can i search user using this plugin and display user info ( like profile picture, first name, last name, about, call to action button) in frontend?
-
Hello,
User search available only with pro plugin version.
Also you can customize the users search output as you want with the special code snippets. Please read more info here.Regards
Now, i’m explain you what i want.
Suppose I have 3 groups of customer in woocommerce like 1) General customer, 2) craftsman and 3) dealer
In this case, I want to dealer has the option of creating a profile in the online store so that general customers and craftsman can find him on the dealer search page.also The craftsman has the option of creating a profile in the online store so that general customers can find him on a crafts man search page
NB: profile should be general profile like name, email, website and about herself (Bio)
search page and profile page demo https://paste.pics/AMGRG
Is it possible do using pro version?
-
This reply was modified 4 years, 6 months ago by
Sultan Mahmud.
So first – to display inside search results users info like name, email, website and bio please use following code snippet
add_filter( 'aws_search_users_results', 'my_aws_search_users_results', 10, 3 ); function my_aws_search_users_results( $results, $roles, $search_query ) { if ( $results ) { foreach( $results as $user_id => $user ) { $excerpt = ''; $user_info = get_userdata($user_id); $userdata = get_user_meta( $user_id ); if ( $userdata && isset( $userdata['description'] ) ) { $excerpt .= $userdata['description'][0]; } if ( $user_info && $user_info->user_email ) { $excerpt .= '<br>Email - ' . $user_info->user_email; } if ( $user_info && $user_info->user_url ) { $excerpt .= '<br>Website - ' . $user_info->user_url; } $results[$user_id][0]['excerpt'] = $excerpt; } } return $results; }
About searching for different user roles – this can be done in the following way:
Create different search form instances with different options for user roles search. One – for searching for
dealers
. Second – forcraftsmans
search. Than add both of this two search forms on the needed places of your site.Hey, Thanks for you explanation.
Can you sent me a frontend demo profile link (include user avatar, name, email, website and bio).So that, I can decide use pro version.You can look on demo here – http://demo.wooitems.com/new/search-form/ under Users search.
Search foradmin
ortest
.I saw your demo. looks good.
https://paste.pics/AO2XA
but when i click user it’s show page not found that’s not good.
https://paste.pics/AO2YJ
is it possible open single page for user after click user?check it here single page look like
https://paste.pics/AMGRGLooks like this test author doesn;t has any assigned posts/products so thats why you see this empty page. I add one post to it and now archive page works fine.
-
This reply was modified 4 years, 6 months ago by
- The topic ‘Display user search page’ is closed to new replies.