Preset Rules: Product Variant Option

Product Variant Option allows you to automatically tag your products in your Shopify store based on each product variant available option names, for example Size, Color, Style or Material.

Smart Tags will tag your product with the value of the variant option. See the examples section for a better idea what tags will be created. 

The above figure shows an example product in Shopify that has two available option names: Color and Size, and the option values Pink, Blue, Mustard, M, L and XL.

The product will only be tagged if it has the specified variant option name. If the product gets updated and the variant option was removed, the tag will be removed.

You can also have the option to set the minimum stock quantity that the variant should have. If the variant has less than the minimum quantity, the product will not be tagged.

If the product stock quantity gets updated, the tag will be added if it meets the minimum stock quantity. It will be removed if it does not.


In this article


Add Product Variant Option rule

  1. Click Add new rule > Product Variant Option
  2. Fill in the options available.
    Note: See Product Variant Option options to learn about the options available.
  3. Remember to click Save to keep changes or Cancel to discard changes.

Product Variant Option options

The following table shows the options available for Product Variant Option:

Option Description Default Required?
Variant Option Name Name of the variant option, for example Size, Color or Style Empty Yes
Minimum Stock Quantity The minimum stock quantity for the product to be tagged. If the product variant has less that the minimum value, the product will not be tagged.

If it is not set, the minimum is set to zero.
0
Filter Enable filter to only apply rule to selected products

Learn more about the filter option.
Disabled No
Prefix Prepend each tag with the prefix.
Leave blank if you don't want the tag to be prefixed with anything.

Learn more about the prefix option.
Empty No

Example uses

Tag product based on its variant option name

In this example, we will show how to tag the product based on its Size values.

Note: This example applies the same to other variant option names, for example Size, Style, or Material, depending on your Shopify store setup.
  1. Add Product Variant Option rule
  2. Set Variant Option Name to Size.
  3. Set Minimum Stock Quantity value to 0.
  4. Optional: We highly recommend that you set a Prefix with value "size-" so that you can tell that the type of tag. In this case, the tag here is the Size value of the product
  5. Click Save to keep changes.

The following table shows an example product and its variants.

Product Title Geeky Striped T-Shirt
Variants Size Quantity

S 3

M 0

L 5
XL 1

The above example will produce the following tags for the above product:

Without prefix With prefix "size-"
S size-S
M size-M
L size-L
XL size-XL
Note: The product will be tagged with size-M since we have set the minimum stock quantity to zero (0). See the next example to only apply tags if product variant has at least a certain quantity in stock.

Tag product based on its variant option name only if it is in-stock.

In this example, we will show how to tag the product based on its Size values, only if it has at least certain number of inventory quantity.

This is really useful if you have a collection filter that is based on tags and would only want products to appear in the result if it is in-stock.

Note: This example applies the same to other variant option names, for example Color, Style, or Material, depending on your Shopify store setup.
  1. Add Product Variant Option rule
  2. Set Variant Option Name to Size.
  3. Set Minimum Stock Quantity value to 1.
  4. Optional: We highly recommend that you set a Prefix with value "size-" so that you can tell that the type of tag. In this case, the tag here is the Size value of the product
  5. Click Save to keep changes.

The following table shows an example product and its variants.

Product Title Geeky Striped T-Shirt
Variants Size Quantity

S 3

M 0

L 5
XL 1

The above example will produce the following tags for the above product:

Without prefix With prefix "size-"
size-S
L size-L
XL size-XL
Note: The product will not be tagged with size-M since we have set the minimum stock quantity to one (1).

Prepend tag with a prefix

Prepending the tag with a prefix helps with organizing the tags in your Shopify store.

Using it lets you know the type of tag, differentiating it from other tags that the product has.

Simply add Product Variant Option rule and set the Prefix option to "size-", for example.

Product Title Geeky Striped T-Shirt
Variants Size Quantity

S 3

M 0

L 5
XL 1

The following table shows the result tags with and without the prefix

Without prefix With prefix "size-"
S
size-S
L size-L
XL size-XL