Preset Rules: Product Total Quantity

Product Total Quantity allows you to automatically tag your products in your Shopify store based on its total quantity in inventory..

You can specify a quantity range, and if a product's total quantity falls within this range, it will be tagged with the specified tag. You can create multiple quantity ranges, each with a different tag. You can also specify a filter to only apply the tags to selected products or collections.

This would be useful in helping you keeping track of your store inventory, for example:

  • Tag products that are no longer in-stock (less than one)
  • Tag products that are in-stock (equal or greater than one)
  • Tag certain products that are below certain threshold. For example, certain products require re-stocking if inventory falls below 10 units.
  • You can use the automatically-created tags in collections to monitor your stock levels.

If the product gets updated and the stock quantity are updated, the tags will be updated depending on its new quantity.


In this article


Add Product Total Quantity preset

  1. Select Presets tab in the Smart Tag Rules table
  2. For Total Quantity Range preset rule, click Edit
  3. Click Add another range to add a total quantity range tag rules, depending on your store needs
    Note: See Total Quantity Range tag rule options to learn about the options available.
  4. Fill in the options available
    Note: See Product Total Quantity Options to learn about the options available.
  5. Check Enable rule checkbox to enable the rule
  6. Remember to click Save to keep changes or Cancel to discard changes.


Product Total Quantity options

The following table shows the options available for Product Total Quantity:

Option Description Default Required?
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

Total Quantity Range tag rule options

Product Total Quantity smart tag allows you to have multiple total quantity range tag rules. The following table shows the options available for each quantity range tag rule:

Option Description Default Required?
Label Tag label to apply to product if its total quantity is within the specified range is found Empty Yes
Minimum quantity Use in combination with Maximum Quantity option to specify the desired range for the above Tag Label.

Leave blank if desired range does not have a minimum. For example: quantity is less than 10.
Empty
Maximum quantity Use in combination with Minimum Quantity option to specify the desired range for the above Tag Label.

Leave blank if desired range does not have a maximum. For example: quantity is above 10.
Empty
Filter Enable filter to only apply rule to selected products

Learn more about the filter option.
Disabled No

Example uses

Tag product if it is out-of-stock

This is useful for you to track which products in your Shopify store are out-of-stock.

  1. Add Product Total Quantity preset.
  2. Add a new Total Quantity range
  3. Fill up its fields with the values as show in the table below.

    # Label Minimum Quantity Maximum Quantity Only apply to selected products? Notes
    1. Out-of-stock Leave blank 0 No Quantity equal or lower than 0.
  4. Check Enable rule checkbox to enable the rule
  5. Click Save to keep changes.


The following table shows some examples of product inventory and the result tags depending on its quantity.

Product Inventory Tag
0 Out-of-stock
-10 Out-of-stock
1 -
10 -

Tag product if it is in-stock

This is useful for you to track which products in your Shopify store are in-stock. You can then use this tag together with Shopify's Smart Collections to only include products in the collection if the product is in-stock.

  1. Add Product Total Quantity smart tag.
  2. Add a new Total Quantity range
  3. Fill up its fields with the values as show in the table below.

    # Label Minimum Quantity Maximum Quantity Only apply to selected products? Notes
    1. In-stock 1 Leave blank No Quantity equal or greater than 1.
  4. Check Enable rule checkbox to enable the rule
  5. Click Save to keep changes.


The following table shows some examples of product inventory and the result tags depending on its quantity.

Product Inventory Tag
0 -
-10 -
1 In-stock
10 In-stock

Tag only selected products if its stock quantity is below a certain threshold

This is useful if different products in your Shopify store has different non-zero threshold for it to be considered as out-of-stock. For example, certain products need to be re-stocked if its stock level is below 5 units. Learn more about Product Filters here.

In this example, you want to your Shirt product to be tagged with "Out-of-stock-Shirts" if it is 5 units and lower.

  1. Add Product Total Quantity preset.
  2. Add a new Total Quantity range
  3. Fill up its fields with the values as show in the table below.

    # Label Minimum Quantity Maximum Quantity Filter... Notes
    1. Out-of-stock-Shirts Leave blank 5 Yes Quantity equal or lesser than 5.
  4. Check Filter... checkbox to enable product filter.
  5. Click Filter by product > Add products... and search for Shirt products. Select it to include it in the product filter. In this example, we are going to add Red Shirt and Blue Shirt as well.

    Note: You can also filter by a mixture of collections and products.
  6. Check Enable rule checkbox to enable the rule
  7. Click Save to keep changes.

The following table shows some examples of product inventory and the result tags depending on its quantity.

Product Title Product Inventory Tag Notes
Shirt 0 Out-of-stock-Shirts
Red Shirt 10 -
Not tagged since Red Shirt has more than 5 units.
Blue Shirt 1 Out-of-stock-Shirts
Red Pants 3 - Not tagged since Red Pants were not included in the product filter.

Tag only products in selected collections if its stock quantity is below a certain threshold

This is useful if different products in your Shopify store has different non-zero threshold for it to be considered as out-of-stock. For example, certain products need to be re-stocked if its stock level is below 5 units. You can group these products into collections for easier organization and use it in the product filter. Learn more about Product Filters here.

In this example, you want products in Shirt collection to be tagged with "Out-of-stock-Shirts" if it is 5 units and lower.

  1. Add Product Total Quantity smart tag.
  2. Add a new Total Quantity range
  3. Fill up its fields with the values as show in the table below.

    # Label Minimum Quantity Maximum Quantity Filter... Notes
    1. Out-of-stock-Shirts Leave blank 5 Yes Quantity equal or lesser than 5.
  4. Check Filter... checkbox to enable product filter.
  5. Click Filter by collections > Add collections... and search for Shirts collection and select it to include it in the product filter.
  6. Check Enable rule checkbox to enable the rule
  7. Click Save to keep changes.

The following table shows some examples of product inventory and the result tags depending on its quantity.

Product Title Is in "Shirts"
collection?
Product Inventory Tag Notes
Shirt Yes 0 Out-of-stock-Shirts
Red Shirt Yes 10 -
Not tagged since Red Shirt has more than 5 units.
Blue Shirt Yes 1 Out-of-stock-Shirts
Red Pants No 3 - Not tagged since Red Pants is not in "Shirts" collection.

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 Total Quantity preset and set the Prefix option.