---
title: Example - Adding a catalog rule
related:
  - https://docs.kentico.com/k9/e-commerce-features/customizing-and-developing-your-store/discount-related-customizing/configuring-discount-rules.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

The example demonstrates how you can add a catalog rule that uses data available for this type of discount rules, i.e. SKU and its properties. Your eligible [customers](https://docs.kentico.com/k9/e-commerce-features/managing-your-store/customers.md) receive a 10% discount on all [products](https://docs.kentico.com/k9/e-commerce-features/managing-your-store/products.md) supplied by _MySupplier, Ltd._

The example uses the sample _E-commerce Site_.

> **Tip:** Please refer to [Example - Adding an order rule ](https://docs.kentico.com/k9/e-commerce-features/customizing-and-developing-your-store/discount-related-customizing/configuring-discount-rules/example-adding-an-order-rule.md)for an example of adding a discount rule with a macro condition calling a custom method.

## Adding a catalog rule

This section demonstrates how you can add a catalog rule limiting the application of catalog discounts. Eligible customers receive a discount on all products supplied by a selected supplier (if the rule is used in an active catalog discount).

1. Open the **Store configuration** application.
2. Switch to the **Discount rules -> Catalog rules** tab.
3. Click **New catalog rule**.
   - The system opens a page where you can specify the catalog rule properties and define the rule's parameters.

     **Specifying the rule's properties**
   1. Enter the following values for the rule's properties:

      - **Display name**: Product supplier is
      - **User text**: Product supplier {\_is} {supplier}
      - **Condition**: {\_is}(SKU.SKUSupplier == "{supplier}")

        ![Specifying catalog rule properties](https://docs.kentico.com/docsassets/k9/example-adding-a-catalog-rule/specifying_catalog_rule_properties.png "Specifying catalog rule properties")

   2. Click **Save**.
      - The system saves the catalog rule, leaving it open for further editing.

        **Defining the rule's parameters**

   3. Switch to the **Parameters** tab.
      - You specified two parameters that modify the rule's condition (_\_is_, _supplier_). That's why the system automatically adds two parameters. You can now adjust the parameters' settings.

        > **Tip:** The _\_is_ parameter allows you to select between a positive and negative meaning of the condition, i.e. _is_ and _is not_. The parameter is predefined so you can leave its default settings.

   4. Select **supplier** from the parameters list and enter (verify) the following values for its properties:
      - **Field name**: supplier
      - **Data type**: Text
      - **Size**: 100
      - **Required**: Yes (checked)
      - **Display field in the editing form**: Yes (checked)
      - **Field caption**: select supplier
      - **Form control**: Supplier selector

        ![Specifying parameter properties](https://docs.kentico.com/docsassets/k9/example-adding-a-catalog-rule/specifying_parameter_properties.png "Specifying parameter properties")

   5. Click **Save**.

The system adds a new catalog rule with two parameters. You can now use the rule in catalog discounts.

![Available catalog rules](https://docs.kentico.com/docsassets/k9/example-adding-a-catalog-rule/available_catalog_rules.png "Available catalog rules")

## Adding a catalog discount

This section demonstrates how you can add a catalog discount allowing the customers to receive a 10% discount on all products supplied by _MySupplier, Ltd._

> **Tip:** You can add [suppliers](https://docs.kentico.com/k9/e-commerce-features/managing-your-store/products/managing-suppliers.md) to the system in the **Suppliers** application.
>
> You can add suppliers to products in the **Products** application while editing the products on the **General** tab.

1. Open the **Catalog discounts** applications.
2. Click**New catalog discount**.
   - The system opens a page where you can specify the catalog discount properties.
3. Enter the following values for the catalog discount's general properties:
   - **Name**: Products by MySupplier, Ltd.
   - **Enabled**: Yes (checked)
   - **Discount**: Percentage
   - **Amount**: 10

     ![Adding a catalog discount](https://docs.kentico.com/docsassets/k9/example-adding-a-catalog-rule/adding_catalog_discount.png "Adding a catalog discount")
4. Specify the discount's condition:

   1. Click **Edit** to edit the discount's **Apply to** property.
      - This opens the **Edit macro condition** dialog on the **Rule designer** tab.
   2. Select the **Product supplier is** rule in the right part of the dialog.
   3. Click **Add rule** () to add the rule to the condition.
   4. Click select in the left part of the dialog.
      - The system opens the **Set parameter value** dialog for the **supplier** parameter.
   5. Use the drop-down list to select the _MySupplier, Ltd._ supplier.
   6. Click **OK**.
      - The system closes the **Set parameter value** dialog for the **supplier** parameter. The **Edit macro condition** dialog is open for editing.
   7. Click **Save & Close** to save the rule's condition and leave the **Edit macro condition** dialog.

      ![Specifying the discount's condition](https://docs.kentico.com/docsassets/k9/example-adding-a-catalog-rule/specifying_discount_condition.png "Specifying the discount's condition")
5. Click **Save**.

The system saves the catalog discount. Your customers now receive a 10% discount on products supplied by _MySupplier, Ltd._

## Reviewing the catalog discount's application

> **Note:** Make sure the _Apple iPad 16GB_ tablet computer has the _MySupplier, Ltd._ supplier assigned.

1. View the live site.
2. Select **Computers -> Tablets** in your on-line store main menu.

   - The system displays a list of all tablet computers that you offer in your on-line store.
3. Click **Add to cart** in the _Samsung 16GB Galaxy Tab_ section.

   > **Note:** The product has [product options](https://docs.kentico.com/k9/e-commerce-features/managing-your-store/products/working-with-product-options.md). That's why the system now displays the product's details page.
   >
   > Here you can specify the amount of product items.
4. Enter _1_ for the amount of product items.
5. Click **Add to cart**.

   - The system displays the content of your shopping cart. The shopping cart doesn't contain any product supplied by _MySupplier, Ltd._ That's why the system doesn't apply the _Products by MySupplier, Ltd._ catalog discount.

     ![Viewing the shopping cart content](https://docs.kentico.com/docsassets/k9/example-adding-a-catalog-rule/shopping_cart_content.png "Viewing the shopping cart content")
6. Repeat steps 2 through 5 to add to the shopping cart the _Apple iPad 16GB_ tablet supplied by _MySupplier, Ltd._

   - The system displays the content of your shopping cart with the _Products by MySupplier, Ltd._ catalog discount applied on this product.

     ![The catalog discount is applied on the product](https://docs.kentico.com/docsassets/k9/example-adding-a-catalog-rule/catalog_discount_applied.png "The catalog discount is applied on the product")

If you now click **Check out**, you can continue in the [checkout process](https://docs.kentico.com/k9/e-commerce-features/configuring-your-store/checkout-process.md).
