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:
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:
- Go to Shopify admin panel > Online store > Themes.
- Find the theme and click Actions > Edit code.
- In the Layout directory click the theme.liquid file.
- 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>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. - 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 Smart Search & Filter control panel > 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
- Go to the Smart Search & Filter control panel > Preferences section > Usergroup rules tab
- Click the + button in the top-right corner.
- Fill in the rule (see Examples):
- 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.
- Select an action in the Actions drop-down list.
- 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.
- You can add more than one rule.
- Save the changes.
Notes
- Hidden products have the highest priority and they always are 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 the rule.
- An rule that set up for all custumers (the * tag) has a higher priority than a rule for a particular customer (a certain tag).
- The rule order don't matter.
Examples
1. You'd like to show products with the "wholesale" tag only to the customers with the "wholesale" tag.
- Enter wholesale into the For customers with tags field.
- Select Show Products in the Actions drop-down list.
- Enter wholesale into the For products with tags field.
- Save the changes.
2. You'd like to show prices for products tagged 'VIP' only to customers with the 'VIP' tag.
- Enter VIP into the For customers with tags field.
- Select Show Prices in the Actions drop-down list.
- Enter VIP into the For products with tags field.
- Save the changes.
3. You'd like to hide all products from customers with the 'restricted' and 'untrusted' tags.
- Enter restricted, untrusted into the For customers with tags field separated by commas.
- Select Hide Products in the Actions drop-down list.
- Enter the * symbol into the For products with tags field.
- Save the changes.
4. You'd like to hide prices for products with the 'VIP' tag from all customers.
- Enter the * symbol into the For customers with tags field.
- Select Hide Prices in the Actions drop-down list.
- Enter VIP into the For products with tags field.
- Save the changes.
Not sure how to set up a rule? Just contact our support team, and we'll be happy to help.
Editing a rule
- Go to the Smart Search & Filter control panel > Preferences section > Usergroup rules tab.
- Click the Edit rules button in the top-right corner.
- Change the rules.
- Save the changes.
Deleting a rule
- Go to the Smart Search & Filter control panel > Preferences section > Usergroup rules tab.
- Select the rules you want to delete in the Delete column.
- Click the Delete selected (...) button in the top-right corner.