Include or exclude products, SKUs, or collections

Most promotions must include at least one item that a shopper must buy to qualify their order for the discount (called the buy condition) and at least one item that can be discounted by the promotion (called the offer).

You can specify products to include or exclude from a promotion’s condition or offer using any combination of the following:

  • Select one or more products from your catalog. All SKUs for a selected product are included or excluded from the buy condition or offer.
  • Select one or more collections from your catalog. All products in a selected collection are included or excluded from the buy condition or offer.
  • Select one or more SKUs from your catalog.
  • Create one or more rules that automatically select products based on product, SKU, or variant properties you specify. For example, suppose you want to exclude all premium brands from a promotion that discounts athletic shoes. You would create a rule that includes the product property Brand and specifies which brands to exclude. See Create rules to include or exclude items to learn how to create a rule.

Keep the following in mind when you include and exclude items from a buy condition or offer:

  • Excluded items always take precedence over included items. For example, if an offer includes the collection Movie Store Root but excludes its child collection Clearance Movies, no items in Clearance Movies will be discounted by the promotion.

    However, if you include Clearance Movies but exclude its parent, Movie Store Root, then no movies, even those in the Clearance Movies collection, can be discounted by the promotion.

  • Commerce does not prevent you from adding the same item to both the included and excluded items lists. In this case, the item is excluded.
  • If an included or excluded items list uses a combination of selected products, selected collections, and a set of rules, Commerce checks each item in the shopper’s cart to see if it matches any of the products in the list or the set of rules.
  • Promotions identify included and excluded products and collections by their IDs. If an item is part of a promotion and you reassign its ID to different item, the promotion automatically uses the new item with the reassigned ID. This may cause unexpected results.

To select products, collections, or SKUs to include or exclude from a buy condition or offer, follow these steps:

  1. On a promotion’s details page, under Included Items or Excluded Items, click the Edit button next to the Products or Collections box.
  2. Select a product or collection from the list. You can filter the list by typing or pasting some text in the Products or Collections box.

    The filter control matches letters or numbers that you type, wherever they appear in the name or ID, not just at the beginning. Usually, as you type more characters, there are fewer matches. When you see the item you want, select it.

  3. Click Add Selected.
  4. Click Done when you finish adding products or collections.

Create rules to include or exclude items

This section describes how to create a rule for a buy condition or offer. A rule automatically selects items based on product, SKU, or variant properties. For example, suppose you created a custom, internal property called Do Not Discount on the base product type. Merchandisers select this option for products in your catalog that should never be discounted by any promotion. To make sure that no promotions ever discount these products, create a rule for each promotion’s offer that includes the base product property Do Not Discount and specifies that its value should be True.

To create a rule that specifies products to include or exclude from a buy condition or offer, follow these steps:

  1. On a promotion’s details page, under Included Items or Excluded Items, click the New Rule button.
  2. Select a type of property to use from the Type list. You can select only one type per rule:
    • Base Product lets you select from all the product properties associated with your catalog’s base product type, including custom properties you created.
    • Base SKU lets you select from all the SKU properties associated with your catalog’s base product type. SKUs created from the base product type can have SKU properties but not variant properties.
    • Custom Product Type Product lets you select from all the custom product properties associated with a custom product type you created in your catalog, where Custom Product Type is the product type’s name.
    • Custom Product Type SKU or Variant lets you select a SKU property or variant property from a custom product type you created in your catalog, where Custom Product Type is the product type’s name.

    See Create and edit product types for more information about product properties and SKU properties. See Create and work with SKUs for more information about variant properties.

  3. Select a property from the Attribute list. The available properties depend on the Type you selected in the previous step. You can select only one attribute per rule.
    • For Base Product, Commerce displays all the product properties associated with your catalog’s base product type (except ID), including custom properties you created.
    • For a custom product type, Commerce displays all the custom product properties associated with the product type you selected. None of the base product type properties are available in this list.
    • For Base SKU, Commerce displays all the SKU properties associated with the base product type, including custom SKU properties you created.
    • For a custom product type SKU or Variant, Commerce displays all the SKU and variant properties associated with the product type you selected. None of the base SKU properties are available in this list.
  4. Select an operator that links the property to a value that you will specify in the next step.

    The operators you see depend on the kind of property you selected as an attribute. For example, if you select the base product type property Arrival Date, the available operators are Before and After.

  5. Select or enter a value for the property.

    For some values, such as variant values, Commerce displays a list for you to choose from. (If you selected a custom product type SKU or Variant, the list includes both SKU values and variant values, with any SKU values appearing first in the list.) For others, such as Availability Date or Brand, you must type in a value. The rule editor does not validate any text or numeric values you type, so take care when you enter values and make sure you test promotions before they go live. The rule editor also does validate date values.

  6. Click Done when you finish creating the rule.
  7. If you create more than one rule for an included or excluded items list, select one of the following Rule Matching options to specify how the rules in this set behave together:
    • Match Any Rule: (default) If an item in a shopper’s cart matches any rule in the set, that rule applies.
    • Match All Rules: If an item in a shopper’s cart matches all the rules in the set, all the rules apply. If the item matches only some of the rules but not all, none of the rules apply.
  8. Click Save.