Skip to content

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.

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

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 IDTriggerDisables
index-1-5Strongest power is above 3.00Packages with index 1.5
index-1-5-metalStrongest power is above 2.50, and the frame’s pa_material attribute is metalPackages with index 1.5
index-1-6Strongest power is above 5.00Packages with index 1.6

These are ordinary rules: edit or delete them to match what your lab makes.

  1. Navigate to SpecCart > Settings > Restrictions
  2. Click the Add rule button in the top-right corner
  3. The Add restriction rule editor will open
  1. 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)
  2. 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

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
  1. Review your selections
  2. Click Add rule (or Save changes if editing)
  3. The rule appears in the restriction list

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.

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)“)
  1. Click the Edit rule button (pencil icon) next to the rule
  2. The Edit restriction rule editor opens with the current values pre-filled
  3. Make your changes
  4. Click Save changes
  1. Click the Delete rule button (trash icon) next to the rule
  2. A confirmation dialog appears: “Are you sure you want to delete the restriction [reason]?”
  3. 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.

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:

  1. They select options step by step (lens usage, type, prescription, lens package, colour and coatings)
  2. As they make selections, SpecCart checks all restriction rules
  3. If a rule’s When conditions match their selection, the rule activates
  4. 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”)
  5. 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.

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”

After creating restrictions:

  1. Open a lens product on the frontend
  2. Go through the configurator, with a prescription that should and one that should not trigger any strength rule
  3. Verify the restriction triggers correctly
  4. Confirm the disabled options display properly

Use consistent naming patterns for rule IDs and reasons:

  • bifocal-no-transitions instead of rule-1
  • premium-tints-require-premium-package instead of restriction-new

This makes rules easier to manage as your catalog grows.

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.

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.

”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.

  1. Verify the rule is saved (check the Restrictions list, and that you clicked Save changes)
  2. Confirm the When conditions match what the customer is selecting. A rule with several kinds of condition needs all of them to match
  3. 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)
  4. For a strongest power rule, check the order has prescription values: Send Later and an upload that was not read have none
  5. For a frame attribute rule, check the taxonomy name (for example pa_material) and the term slugs match the product’s attributes
  6. Clear any caching plugins or browser cache
  7. Test in an incognito window
  • 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