Hide contents by group
Thursday, 17 December 2020
WooCommerce B2B is based on the concept of groups, with which you can group your customers.
If you want to have different texts depending on the group to which the customer belongs, you can do it with a simple shortcode, specially created.
To do this, edit functions.php file that you find in your site’s FTP space in:
and insert this code:
With this shortcode you can manage some content visibility by group by adding it into your pages, for example:
With this example, the text contained between the shortcode tags will be visible only to logged in customers that are assigned to group with ID 10.
It is advisable not to edit the theme files directly, but to use a child theme.
For more information on child themes, please read: WordPress Official guide on Child Themes