Restrictions
The Restrictions tab allows you to create rules that automatically disable certain lens options when specific conditions are met. This prevents customers from selecting combinations that are physically incompatible, unavailable, or technically impossible. From 1.8.0 a rule can also be triggered by the strength of the customer’s prescription or by an attribute of the frame, which is how lens packages are filtered by prescription strength.
What Are Restrictions?
Section titled “What Are Restrictions?”Restriction rules follow a simple pattern:
When [specific option is selected, or the prescription or frame matches] → Disables [these other options]
For example:
- When Bifocal lens usage is selected → Disable Transitions lenses
- When the strongest power is above 3.00 → Disable the 1.5 index lens packages
- When Driving lens colour is selected → Disable the Ultra-thin lens package
Each restriction rule includes:
- Reason / description: A description of the rule, shown in the restriction list
- ID: A unique identifier for the rule (auto-generated from the reason)
- Trigger conditions (When): The options, prescription strength or frame attribute that activate this restriction
- Affected options (Disables): The options that become unavailable when triggered
Rules SpecCart Adds
Section titled “Rules SpecCart Adds”New installs start with one option rule, Not available with bifocal lenses (bifocal-no-transitions), which disables the Transitions lens colour, the polarised sunglasses tints and the 1.74 package when Bifocal is chosen.
New installs and the 1.8.0 settings upgrade also add these prescription-strength rules, each one only when you have lens packages with that index. Each disables the packages with that index and has the reason “Not available for your prescription”:
| Rule ID | Trigger | Disables |
|---|---|---|
index-1-5 | Strongest power is above 3.00 | Packages with index 1.5 |
index-1-5-metal | Strongest power is above 2.50, and the frame’s pa_material attribute is metal | Packages with index 1.5 |
index-1-6 | Strongest power is above 5.00 | Packages with index 1.6 |
These are ordinary rules: edit or delete them to match what your lab makes.
Creating a Restriction Rule
Section titled “Creating a Restriction Rule”Step 1: Add a New Rule
Section titled “Step 1: Add a New Rule”- Navigate to SpecCart > Settings > Restrictions
- Click the Add rule button in the top-right corner
- The Add restriction rule editor will open
Step 2: Enter Reason and ID
Section titled “Step 2: Enter Reason and ID”-
Reason / description (required): Enter a clear message explaining why options are disabled
- Good: “Not available with bifocal lenses”
- Good: “This tint is incompatible with ultra-thin lenses”
- Bad: “Restriction 1” (too vague)
-
ID (required): Auto-generated from your reason as a URL-friendly slug
- Example: “Not available with bifocal lenses” becomes
not-available-with-bifocal-lenses - You can edit this when creating a new rule, but it cannot be changed later
- Must be unique across all restriction rules
- Example: “Not available with bifocal lenses” becomes
Step 3: Select Trigger Conditions (When)
Section titled “Step 3: Select Trigger Conditions (When)”Set at least one trigger condition. There are three kinds.
Option conditions. Tick options in any of these categories. This part matches when any of the ticked options is chosen by the customer:
- Lens usage: your lens usage options
- Varifocal types: your varifocal type options
- Lens colours: Clear, Tinted, Photochromic options
- Lens packages: your lens packages
Strongest power is above. Enter a power (in steps of 0.25). This part matches when the customer’s strongest power is greater than the number. The strongest power is the larger of SPH and SPH + CYL, from the stronger eye. For Single Vision Reading and Occupational Office, Near ADD is included. It never matches an order with no prescription values to read: non-prescription orders, Send Later, and an upload that was not read.
Frame attribute and is one of. Enter a WooCommerce attribute taxonomy (for example pa_material) and one or more term slugs (for example metal), separating several slugs with commas. This part matches when the frame being configured has at least one of those terms.
When a rule has more than one kind of condition, all of them must match. For example, a rule with Strongest power is above 2.50 and Frame attribute pa_material is one of metal applies only to a metal frame with a strongest power above 2.50.
Example:
- If you tick Bifocal and Varifocal (Progressive) under Lens usage, the restriction triggers when either is selected
Step 4: Select Disabled Options (Disables)
Section titled “Step 4: Select Disabled Options (Disables)”Choose at least one option under Affected options that will be disabled when the restriction triggers.
Available disabled option categories:
- Lens usage
- Varifocal types
- Lens colours: Clear, Tinted, Photochromic options
- Transition colours: Specific transition lens colours
- Sunglasses tints: Specific sunglass tint options
- Lens packages: your lens packages
- Add-ons: your add-ons
Example:
- To prevent all transitions lenses with bifocals, select all transition colours under Transition colours
Step 5: Save the Rule
Section titled “Step 5: Save the Rule”- Review your selections
- Click Add rule (or Save changes if editing)
- The rule appears in the restriction list
Example Use Cases
Section titled “Example Use Cases”Example 1: Bifocals Don’t Support Transitions
Section titled “Example 1: Bifocals Don’t Support Transitions”When: Lens usage = Bifocal Disables: All Transition colours Reason: “Transition lenses are not available with bifocal lenses”
Result: When a customer selects bifocal lenses, the transition colour options are removed from the colour step.
Example 2: Budget Package Excludes Premium Tints
Section titled “Example 2: Budget Package Excludes Premium Tints”When: Lens package = Budget Package Disables: Specific high-end Sunglasses tints Reason: “Premium tints are only available with Standard or Premium packages”
Result: Customers who choose the budget package cannot select premium tint options.
Example 3: Thin Lenses for Strong Prescriptions
Section titled “Example 3: Thin Lenses for Strong Prescriptions”When: Strongest power is above 4.00 Disables: Lens package = Standard 1.5 Reason: “Not available for your prescription”
Result: A customer whose strongest power is above 4.00 does not see the Standard 1.5 package, and the package step tells them some lens options are not available for their prescription.
Example 4: Certain Colours Incompatible with Packages
Section titled “Example 4: Certain Colours Incompatible with Packages”When: Lens colour = Driving Yellow Disables: Lens package = Budget, Lens package = Ultra-Thin Premium Reason: “Driving yellow is only available with our Standard and Premium packages”
Result: When the driving yellow colour is selected, certain packages are removed from the available options.
Managing Existing Rules
Section titled “Managing Existing Rules”Viewing Rules
Section titled “Viewing Rules”The Restriction rules list displays all rules with:
- Reason: The rule’s description
- ID: The unique rule identifier (in a grey badge)
- When: Summary of trigger conditions (e.g., “Varifocal: bifocal | Lens usage: single-vision-reading”, or “Strongest power above 2.50 and Frame pa_material is metal”)
- Disables: Count of disabled options (e.g., “3 option(s)“)
Editing a Rule
Section titled “Editing a Rule”- Click the Edit rule button (pencil icon) next to the rule
- The Edit restriction rule editor opens with the current values pre-filled
- Make your changes
- Click Save changes
Deleting a Rule
Section titled “Deleting a Rule”- Click the Delete rule button (trash icon) next to the rule
- A confirmation dialog appears: “Are you sure you want to delete the restriction [reason]?”
- Confirm to permanently delete the rule
Deleted rules are removed from the list immediately. Click Save changes in the header bar to keep the change; until then, Discard brings the rule back. Once saved, there is no undo.
How Restrictions Work in the Configurator
Section titled “How Restrictions Work in the Configurator”The wizard asks for the prescription before the lens package and the colour, so prescription-strength rules can act on both. When a customer uses the lens configurator:
- They select options step by step (lens usage, type, prescription, lens package, colour and coatings)
- As they make selections, SpecCart checks all restriction rules
- If a rule’s When conditions match their selection, the rule activates
- The options listed in that rule’s Disables section become unavailable:
- Lens colours stay on the colour step, greyed out and unselectable, with the text “Not available with [lens usage] lenses.”
- Transition colours and Sunglasses tints are removed from the choices
- Lens packages are removed from the package step, which shows “Some lens options are not available for your prescription.” for a prescription order, with the customer’s strongest power (“Strongest power: 4.25”, or “Strongest power: 4.25, including your Near ADD”)
- If the customer changes their selection and the rule no longer applies, the options become available again
If a change to the prescription or the lens usage means the chosen package is now disabled, the package is deselected and the package step says “[package] is no longer available for your prescription. Please choose another lens package.” SpecCart also checks the package rules again when the configuration is added to the basket, and refuses a package a rule disables.
This happens in real-time as they configure their lenses, preventing invalid combinations before they add to basket.
Best Practices
Section titled “Best Practices”Write Clear Reasons
Section titled “Write Clear Reasons”Write reasons that explain the rule, so anyone reading the restriction list can tell what it is for.
- Good: “Bifocal lenses cannot be combined with transition technology”
- Bad: “Lab restriction BF-TR-001”
- Good: “This tint requires the Premium package or higher”
- Bad: “Invalid combination”
Test Your Rules
Section titled “Test Your Rules”After creating restrictions:
- Open a lens product on the frontend
- Go through the configurator, with a prescription that should and one that should not trigger any strength rule
- Verify the restriction triggers correctly
- Confirm the disabled options display properly
Organize Rules Logically
Section titled “Organize Rules Logically”Use consistent naming patterns for rule IDs and reasons:
bifocal-no-transitionsinstead ofrule-1premium-tints-require-premium-packageinstead ofrestriction-new
This makes rules easier to manage as your catalog grows.
Avoid Over-Restricting
Section titled “Avoid Over-Restricting”Only create restrictions when combinations are truly impossible or unavailable. Over-restricting limits customer choice and may frustrate shoppers. If an option is just less common but still technically possible, consider leaving it available.
Document Internal Reasons
Section titled “Document Internal Reasons”Keep internal documentation about why restrictions exist:
- Lab equipment limitations
- Optical physics constraints
- Business decisions (package differentiation)
This helps when onboarding new staff or reviewing rules later.
Troubleshooting
Section titled “Troubleshooting””At least one trigger condition is required”
Section titled “”At least one trigger condition is required””You didn’t set any trigger condition. Tick at least one option under Trigger conditions, or enter a strongest power, or fill in a frame attribute and its values.
”At least one disabled option is required”
Section titled “”At least one disabled option is required””You didn’t select any options in the Affected options section. Select at least one option category and check at least one option within it.
Rule Doesn’t Seem to Work on Frontend
Section titled “Rule Doesn’t Seem to Work on Frontend”- Verify the rule is saved (check the Restrictions list, and that you clicked Save changes)
- Confirm the When conditions match what the customer is selecting. A rule with several kinds of condition needs all of them to match
- Check that the options you’re trying to disable actually exist and are enabled, and are of a kind the wizard applies (lens colours, transition colours, sunglasses tints or lens packages)
- For a strongest power rule, check the order has prescription values: Send Later and an upload that was not read have none
- For a frame attribute rule, check the taxonomy name (for example
pa_material) and the term slugs match the product’s attributes - Clear any caching plugins or browser cache
- Test in an incognito window
Related Settings
Section titled “Related Settings”- Lens Usage: Configure the lens type options that restrictions can affect
- Packages: Define lens packages that can trigger or be disabled by restrictions
- Colours: Configure colour and tint options that restrictions can apply to