Conditional content on My Account page with Groups
Sometimes you want to show specific content only to some users based on the group they belong to.
The plugin Groups and Groups for WooCommerce allow this. In short, these two plugins together allow you to specify what group a customer must be added/removed when he purchases a specific product.
They are particularly useful when you want to sell Memberships on your website. Here are some examples:
- Bookings Use Case: Gym Member/Activities – Example with Memberships by Michael Tieso
- Creating a Tiered Membership Site with Sensei and Groups by Dan Johnson
- Building a membership site with WooCommerce by Chris Lema
In this little tutorial you will learn how to show some text, content or links only to customers who belong to a specific group in their account page.
Open your file functions.php located in wp-content/themes/your-theme-name/ and add this code at the end of the file:
This is only a basic example of what you can do with Groups and Groups for WooCommerce. If you want to learn more i suggest to read the plugins documentation here and here.
Leave a ReplyWant to join the discussion?
Feel free to contribute!