- 14 Mar 2024
- 1 Minute to read
- DarkLight
Product can only be purchased by a team paying customer or a team admin
- Updated on 14 Mar 2024
- 1 Minute to read
- DarkLight
This rules prevents customers and admins from purchasing a product if the customer isn't a team paying customer or team administrator. It's designed to help team administrators and paying customers prevent their team from making purchases without their approval.
You need the following details to set up this rule:
- The ID of the product that can't be purchased if the customer isn't a team paying customer or a team administrator.
Check out Finding Product IDs.
Log in to dashboard.nexudus.com if you aren't already.
Click Settings > Validation rules.
Click Add rule.
Click on Manual entry.
Name your validation rule.
Add a Description for your rule to let other admins know what it does at a glance.
Toggle on This rule is active.
Select Product sale in the Record type.
Add the Error message to display if the validation rule is not met.
Add the following code snippet to the Formula field.
record.Product.Id <> PRODUCT_ID OR record.Coworker.IsPayingMember() OR record.Coworker.IsTeamAdministrator()
- Replace PRODUCT_ID with the relevant product ID.
In the example below, the product ID is 123456789.
record.Product.Id <> 123456789 OR record.Coworker.IsPayingMember() OR record.Coworker.IsTeamAdministrator()
Click the Save Changes button.
All done! We recommend trying to purchase the relevant product using a test customer account who isn't a team administrator or paying customer. If you see your error message displayed as you try to check out, you're good to go.