What group is the user

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Viewing 5 reply threads
  • Author
    Posts
    • #87372
      PATselov
      Participant

      I need a filter to find out which group a registered user has? To display this information anywhere in my template or use it …

    • #87525
      WCFM Forum
      Member

      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

    • #87797
      PATselov
      Participant

      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.

    • #88376
      WCFM Forum
      Member

      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

    • #88409
      PATselov
      Participant

      This code does not work.
      The result is an empty array.

    • #88585
      WCFM Forum
      Member

      What you have passed “$user_id”?

      You have to pass a valid a vendor user id to get his/her group.

      Thank You

Viewing 5 reply threads
  • The topic ‘What group is the user’ is closed to new replies.