How to make Searchanise Search & Filter work with rules for different customer groups

Searchanise allows setting up different rules for customer groups in your store. For example, if a customer has a specific tag, you can set up a rule not to show product prices to this customer. It can be useful when you need to divide your store into retail and wholesale parts.

To set up rules for customer groups, follow these steps:

  1. Add the script to the theme template.
  2. Set up usergroup rules.

Adding the script to the theme template

You need to add the Searchanise script to your theme template before setting up usergroup rules. To do that, follow these steps:

  1. Go to Shopify admin panel > Online store > Themes.
  2. Find the theme and click Actions > Edit code.
  3. In the Layout directory click the theme.liquid file.
  4. Find the liquid tag {{ content_for_header }}, which is usually located between the <head> and </head> tags, and paste the following code line before it:
    <script>SearchaniseCustomerTags = [{% if customer.tags %}'{{ customer.tags | join: "','" }}'{% endif %}];</script>
    How to make Searchanise Search & Filter work with rules for different customer groups

    Note

    If you have inserted the code from the Widget doesn’t appear on page load instructions in the theme.liquid file, place the code mentioned above before it.

  5. Save the changes.

That’s it. Now you can set up usergroup rules in the app.

Setting up usergroup rules

You can set up different usergroup rules in the Searchanise Search & Filter control panel > Search & Navigation > Preferences section > Usergroup rules tab.

The settings allow you to show/hide products or prices to the customers with a specific tag – or any customers whatsoever. You can also show/hide products with a specific tag or show/hide prices for products with a specific tag.

Adding a rule

  1. Go to the Searchanise Search & Filter control panel > Search & Navigation > Preferences section > Usergroup rules tab
  2. Click the + button in the top-right corner.
  3. Fill in the rule (see Examples):
    1. Enter the customer tags separated by commas into the For customers with tags field. You can set up tags with spaces. If you want to add the rule for all customers, enter the symbol. 
    2. Select an action in the Actions drop-down list.
    3. Enter the product tags separated by commas into the For products with tags field. You can set up tags with spaces. If you want to add the rule for all products, enter the * symbol.
  4. You can add more than one rule.
  5. Save the changes.
Notes

  • Hidden products have the highest priority and they are always hidden from all your customers. So you can’t set up usergroup rules for them.
  • If you set up a rule to show products/prices to a particular customer, only this customer will be able to view them. So you should enter all customer tags separated by commas you want to add to the rule.
  • A rule that set up for all customers (the * tag) has a higher priority than a rule for a particular customer (a certain tag).
  • The rule order doesn’t matter.

Examples

1. You’d like to show products with the “wholesale” tag only to the customers with the “wholesale” tag.
  1. Enter wholesale into the For customers with tags field.
  2. Select Show Products in the Actions drop-down list.
  3. Enter wholesale into the For products with tags field.
  4. Save the changes.
How to make Searchanise Search & Filter work with rules for different customer groups
2. You’d like to show prices for products tagged ‘VIP’ only to customers with the ‘VIP’ tag.
  1. Enter VIP into the For customers with tags field.
  2. Select Show Prices in the Actions drop-down list.
  3. Enter VIP into the For products with tags field.
  4. Save the changes.
How to make Searchanise Search & Filter work with rules for different customer groups
3. You’d like to hide all products from customers with the ‘restricted’ and ‘untrusted’ tags.
  1. Enter restricted, untrusted into the For customers with tags field separated by commas.
  2. Select Hide Products in the Actions drop-down list.
  3. Enter the * symbol into the For products with tags field.
  4. Save the changes.
How to make Searchanise Search & Filter work with rules for different customer groups
4. You’d like to hide prices for products with the ‘VIP’ tag from all customers.
  1. Enter the * symbol into the For customers with tags field.
  2. Select Hide Prices in the Actions drop-down list.
  3. Enter VIP into the For products with tags field.
  4. Save the changes.
How to make Searchanise Search & Filter work with rules for different customer groups

Not sure how to set up a rule? Just contact our support team, and we’ll be happy to help.

Editing a rule

  1. Go to the Searchanise Search & Filter control panel > Search & Navigation > Preferences  section > Usergroup rules tab.
  2. Click the Edit rules button in the top-right corner.
  3. Change the rules.
  4. Save the changes.

Deleting a rule

  1. Go to the Searchanise Search & Filter control panel > Search & Navigation > Preferences  section > Usergroup rules tab.
  2. Select the rules you want to delete in the Delete column.
  3. Click the Delete selected (…) button in the top-right corner.
Enjoying your experience with Searchanise?

We’d appreciate it if you could take some time to leave a review.

Updated on November 1, 2023

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you

Let us improve this post!

Please tell us how we can improve this post

Related Articles

Back to top