WrapStudio
Shopify Guide

Variant Conditions

Control when rules and snippets apply based on product variants

Variant Conditions

Variant conditions let you control exactly when rules and snippets appear based on the customer's variant selection. This powerful feature ensures customers see the right 3D preview for their specific choices.

Variant conditions are optional. If you don't set any conditions, your rule or snippet applies to all variants of the linked products.


What Are Variants?

In Shopify, variants are different versions of the same product. Common variant options include:

OptionExample Values
SizeSmall, Medium, Large, 8x10, 16x20
Frame ColorGold, Silver, Black, White
MaterialCanvas, Poster, Metal Print
StyleModern, Classic, Minimal

WrapStudio can use these variant options to show different 3D configurations.


Understanding Match Modes

Variant conditions support four matching modes:

ModeBehavior
All VariantsRule/snippet applies to all variants (no filtering)
Match AnyShow if any one condition is met
Match AllShow only if all conditions are met
Match NoneShow only if none of the conditions are met

Match Any (OR Logic)

Show the 3D preview if the customer selects any of the specified options.

Example: Show for "Gold Frame" OR "Silver Frame"

Color = Gold  OR  Color = Silver
    ↓              ↓
  ✓ Show       ✓ Show

Match All (AND Logic)

Show the 3D preview only if the customer's selection matches all conditions.

Example: Show for "Large Size" AND "Canvas Material"

Size = Large  AND  Material = Canvas
    ↓                    ↓
Must match both to show ✓

Match None (NOT Logic)

Show the 3D preview only if the customer's selection matches none of the conditions.

Example: Hide for "Poster" material

Material ≠ Poster

Show for all other materials ✓

Setting Up Variant Conditions

Locate the Variant Conditions Section

When creating or editing a rule/snippet, scroll to the Variant Display Conditions section.

Variant Conditions Section

Choose Your Match Mode

Select the appropriate matching mode from the dropdown:

  • All Variants (default)
  • Match Any
  • Match All
  • Match None

Match Mode Selector

Add Conditions

Click Add Condition to create a new condition.

Add Condition Button

Each condition has three parts:

PartDescription
FieldThe variant option name (e.g., "Color", "Size")
OperatorHow to compare (equals, contains, starts with, etc.)
ValueThe value to match (e.g., "Gold", "Large")

Configure the Condition

Fill in the condition details:

Condition Configuration

Field: Enter the exact Shopify option name

  • Must match your variant option name exactly
  • Case-sensitive
  • Common examples: "Size", "Color", "Material", "Style"

Operator: Choose how to match

OperatorMatches When
equalsExact match
containsValue is found anywhere
starts withValue begins with
ends withValue ends with

Value: The variant option value to match

Add Multiple Conditions (Optional)

Click Add Condition again to add more conditions. Multiple conditions work with your chosen match mode.

Multiple Conditions

Remove Conditions

Click the trash icon next to any condition to remove it.

Remove Condition


Real-World Examples

Example 1: Different Frames, Different Snippets

Scenario: You sell the same artwork in three frame colors, and want each variant to show its matching frame in 3D.

Setup:

SnippetProductConditionMode
Sunset Art - GoldSunset PrintFrame Color = GoldMatch Any
Sunset Art - SilverSunset PrintFrame Color = SilverMatch Any
Sunset Art - BlackSunset PrintFrame Color = BlackMatch Any

Example 2: Canvas-Only Rule

Scenario: You have a product with both Canvas and Poster variants, but only want the 3D preview for Canvas.

Setup:

RuleConditionMode
Canvas PrintsMaterial = CanvasMatch Any

Or alternatively:

RuleConditionMode
Canvas PrintsMaterial = PosterMatch None

Example 3: Large Frames Only

Scenario: Only show 3D preview for sizes 16x20 and larger.

Setup:

RuleConditionsMode
Large FramesSize = 16x20, Size = 20x24, Size = 24x36Match Any

Example 4: Premium Option Combination

Scenario: Only show 3D preview for "Gold Frame" in sizes "Large" or "X-Large".

Setup:

RuleConditionsMode
Premium GoldFrame = Gold + (Size contains "Large")Match All

Condition Operators Explained

Equals

Matches exactly the specified value.

Field: Color
Operator: equals
Value: Gold

✓ "Gold" → Match
✗ "Light Gold" → No match
✗ "gold" → No match (case-sensitive)

Contains

Matches if the value appears anywhere in the option.

Field: Size
Operator: contains
Value: Large

✓ "Large" → Match
✓ "X-Large" → Match
✓ "Extra Large" → Match
✗ "Medium" → No match

Starts With

Matches if the option begins with the specified value.

Field: Style
Operator: starts with
Value: Modern

✓ "Modern" → Match
✓ "Modern Classic" → Match
✗ "Ultra Modern" → No match

Ends With

Matches if the option ends with the specified value.

Field: Frame
Operator: ends with
Value: Frame

✓ "Gold Frame" → Match
✓ "Silver Frame" → Match
✗ "Frame Gold" → No match

Important Considerations

Case Sensitivity: Field names and values are case-sensitive. Make sure they match your Shopify variant options exactly.

Shopify option: "Frame Color"
✓ Field: "Frame Color"
✗ Field: "frame color"

Testing: Always test your conditions by viewing your product page and selecting different variants. Verify the 3D preview appears/hides correctly.


Troubleshooting

Condition Not Working

  1. Check Field Name: Must exactly match your Shopify variant option name
  2. Check Case: "Color" is different from "color"
  3. Check Value: Ensure the value exists in your variant options
  4. Check Mode: Verify you're using the right match mode (Any vs All)

3D Preview Not Appearing

  1. Verify your conditions aren't too restrictive
  2. Test with "All Variants" mode temporarily
  3. Check that the variant combination exists in Shopify

3D Preview Appears When It Shouldn't

  1. Review your conditions for gaps
  2. Consider using "Match None" for exclusions
  3. Check for conflicting rules/snippets

Next Steps

On this page