> ## Documentation Index
> Fetch the complete documentation index at: https://docs.smartwpplugins.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Eligibility

> Restrict a link to signed-in customers, or to particular roles

> [!NOTE]
>
> Eligibility is a Pro feature. On the free version the two settings are stored but not enforced, so every visitor is eligible. The sign-in switch shows off and locked, and the roles show locked with none ticked, because that's what the free version does.

By default anyone holding the link can use it. Eligibility narrows that to signed-in customers, or to particular roles.

It lives in the editor's **Usage restrictions** card, under **Customer access**.

🖼️

Screenshot pending

The Customer access block with the sign-in switch on and two roles chosen

## Signed-in customers and roles

**Signed-in customers only.** A guest following the link is refused like any other refused visitor. They're told why, and they go wherever your **Unavailable links** setting sends them. Once signed in, they can follow the link again.

**Allowed roles.** Tick one or more WordPress roles. A visitor whose account holds none of them is turned away. Leave every role unticked to allow any signed-in customer.

**Allowed roles** appears only while the sign-in switch is on. Roles narrow "signed in" and never apply on their own. A guest holds no roles, so a role list without the switch would refuse every visitor while the screen showed no sign-in requirement at all.

> [!NOTE]
>
> The same rule holds below the screen. A role list stored without the switch turns the switch on when it's saved, so an import or a filter can't add a restriction the editor wouldn't show you. Turning the switch off clears the roles with it.

> [!TIP]
>
> This is how a wholesale or staff preset stays out of public reach even though the link itself isn't secret.

## Checked again at checkout

Eligibility is checked when the link is followed, and again at checkout: the classic checkout, the Checkout block, and **Pay for order**. A customer whose role you've removed since the preset reached their cart, or whose guest cart was merged into an account that isn't allowed, is refused there with the same sentence.

## Why only these two

Both are facts WordPress knows for certain on every request.

There's no ship-to region restriction. You often can't tell where a visitor is when they click a link, so a region rule would work for some people and not others, and you'd think the preset was protected when it wasn't.

## What a rejected visitor reads

There are two sentences. Both are store-wide and editable under **Settings → Messages and labels**. The editor links there from the foot of the **Usage restrictions** card.

| Situation | Shipped wording | Notice ID |
| - | - | - |
| A guest meets a signed-in-only preset (row: *For signed-in customers only*) | Please sign in to use this preset. | `not_signed_in` |
| An account holds none of the allowed roles (row: *The customer lacks an allowed role*) | This preset is not available on your account. | `role_not_allowed` |

A guest meeting a role-restricted preset reads the sign-in sentence, not the account one. Roles imply sign-in, so that gate is asked first. It's also the more useful message for somebody who isn't signed in.

> [!WARNING]
>
> Write them for a stranger. Anyone with the link can trigger them, so they shouldn't confirm what the preset contains or who it's for.

## Where they land

They go where every refused visitor goes. That's set by **Unavailable links** under **Settings → Cart behaviour**, which a preset can overridePro in its **Cart behaviour** card: **Cart**, or a **Custom URL** of your own. See [Where customers land](https://docs.smartwpplugins.com/cartpresets/links/destinations.md).

There's no sign-in redirect. A guest isn't sent to a login form and brought back. The plugin refuses the link and says why, and that setting decides where they go next.

External addresses work. A destination you configure passes through a redirect helper that allow-lists the host you set. WordPress's own `wp_safe_redirect()` rewrites a foreign host to wp-admin, which would send a rejected customer to your dashboard login.

## Notices reach block checkouts too

WooCommerce's Cart and Checkout blocks on a classic theme never print the classic notice queue. A message written into the session would sit there until some classic template dumped every stale notice at once.

CartPresets adds the pending queue to the top of both blocks through WooCommerce's own notice templates, so your rejection message arrives whichever cart your theme uses.

> [!WARNING]
>
> A custom URL is the one place a message can go unseen. The page you send them to has to print WooCommerce notices, and a landing page often doesn't.

## Settings reference

| Setting | Level | Key | Default |
| - | - | - | - |
| Signed-in customers only | Preset | `logged_in` | Off |
| Allowed roles | Preset | `roles` | Empty (any signed-in customer) |
| Unavailable links | Store | `refused_action` | `cart` |

## For developers

Eligibility is decided through `cartpresets_eligibility`, seeded `allowed => true`. Every verdict comes from a listener, including the plugin's own, so you can add a rule of your own (a membership check, a regional policy) at a later priority and have the last word. See the [hooks reference](https://docs.smartwpplugins.com/cartpresets/developers/hooks-reference.md#availability-and-eligibility).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.