Gå til hovedindhold
WooCommerce

Product Variations

Require age verification for specific WooCommerce product variations and set variation-specific minimum ages.

Product Variations

Use variation rules when only certain versions of a variable product require age verification. For example, a clothing product can offer both an unrestricted L size and an age-restricted L size.

Variation rules are available when the plugin scope is set to Selected products & categories. See Configuration.

Set a variation rule

  1. Go to Products → All Products and edit a variable product.
  2. Open Product data → Variations.
  3. Expand the variation you want to configure.
  4. At the bottom of the variation panel, find Age Verification.
  5. Tick Require age verification to purchase this variation.
  6. Optionally enter a Minimum age override for that variation.
  7. Click Save changes in the Variations section, then Update the product.

The Age Verification section is available regardless of whether WooCommerce variation stock management is enabled.

How variation rules work

A direct variation rule applies only to the selected variation. Other variations of the same product remain unrestricted unless they inherit a rule from the parent product or one of its categories.

Variation rules are additive. They cannot be used to make a variation unrestricted when its parent product or a category already requires age verification.

Parent productCategoryVariationResult
Not gatedNot gatedGatedOnly this variation requires verification
GatedNot gatedNot gatedEvery variation requires verification
Not gatedGatedNot gatedEvery variation requires verification
GatedGatedGatedEvery variation requires verification

Minimum age precedence

For each cart item, the plugin determines the required age in this order:

  1. Variation minimum-age override
  2. Parent product minimum-age override
  3. Highest minimum age from an applicable gated category
  4. Store-wide required age

An age override changes the required age, not whether a broader rule applies. For example, a variation with a 21+ override inside an 18+ gated category requires 21+. A variation without its own override inherits the category's 18+ requirement.

Example: restricted and unrestricted sizes

Consider a variable product with Size and Eligibility attributes:

VariationDirect variation ruleResult
S / UnrestrictedOffNo verification, provided the parent and categories are not gated
S / Age-restrictedOnVerification required
L / UnrestrictedOffNo verification, provided the parent and categories are not gated
L / Age-restrictedOn, age 18Verification required at 18+

Keep the parent product and its categories unrestricted when this is the intended setup. If you gate the parent product or category, all of its variations become gated.

Parent-product notice

When a product has one or more directly gated variations, its Age Verification box shows a Variation rules active notice. This is a reminder that direct variation rules exist and that their age overrides apply only to those variations.

For parent-product and category rules, see Products & Categories.

On this page