Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Groups & Staffs › What group is the user
- This topic has 5 replies, 2 voices, and was last updated 5 years ago by WCFM Forum.
- AuthorPosts
- October 17, 2019 at 4:23 pm #87372PATselovParticipant
I need a filter to find out which group a registered user has? To display this information anywhere in my template or use it …
- October 18, 2019 at 10:24 am #87525WCFM ForumMember
Hi,
Well, groups are related to membership.
You may filter vendors by membership at vendors listing dashboard – https://ibb.co/kq5k714
You may also create store list page by membership – https://docs.wclovers.com/store-list/
Thank You
- October 20, 2019 at 2:40 pm #87797PATselovParticipant
No, you do not understand me.
How can a user group be defined programmatically?
I need, depending on the user group, to work with my data when writing the page template.
For example:<?php if ($my_user_group == ... ) { // My code } else { // My code } ?>
Therefore, I need to get the group value for a user who has logged into his woocommerce account.
- October 23, 2019 at 10:12 am #88376WCFM ForumMember
HI,
You may fetch vendor’s group by this –
$wcfm_user_groups = (array) get_user_meta( $user_id, '_wcfm_vendor_group', true );
Well, it’s return an array as one vendor may associate with multiple group.
Thank You
- October 23, 2019 at 11:09 am #88409PATselovParticipant
This code does not work.
The result is an empty array. - October 23, 2019 at 3:27 pm #88585WCFM ForumMember
What you have passed “$user_id”?
You have to pass a valid a vendor user id to get his/her group.
Thank You
- AuthorPosts
- The topic ‘What group is the user’ is closed to new replies.