Configuring discount rules

Discount rules are user‑friendly representations of discount- and free shipping offer-related macro conditions. These conditions allow your on-line store administrators to limit the application of discounts (catalog and order) and free shipping offers. If the condition is evaluated as true, the respective discount / free shipping offer is valid and the system applies it (unless configured otherwise).

Catalog rules

Catalog rules are user‑friendly representations of catalog discount-related macro expressions. Using these rules in the Rule designer mode of the macro condition editor (while editing the catalog discounts’ Apply to property), you can build conditions limiting your catalog discounts’ application.

Selecting catalog rules

Available data for the catalog rules

We recommend that you do not use time-related objects such as CurrentUser, CurrentPath, etc. in your custom catalog rules.

This is because such objects can no longer be relevant in the current session context.

The data available for catalog rules includes SKU and its properties, for example SKUOrder, SKUPrice, SKUPublicStatus, etc.

You can easily access the data in Store / Multistore configuration -> Discount rules -> Catalog rules by typing SKU. while editing the rule’s Condition property on the General tab.

Available data for catalog rules

Order rules

Order rules are user‑friendly representations of order discount- and free shipping offer-related macro expressions. Using these rules in the Rule designer mode of the macro condition editor (while editing the order discounts’ / free shipping offers’ Further conditions property), you can build conditions limiting your order discounts’ / free shipping offers’ application.

Selecting order rules

Available data for the order rules

We recommend that you do not use time-related objects such as CurrentUser, CurrentPath, etc. in your custom order rules.

This is because such objects can no longer be relevant in the current session context.

The data available for order rules includes ShoppingCart and its properties, for example Currency, PaymentOption, ShippingOption, etc.

You can easily access the data in Store / Multistore configuration -> Discount rules -> Order rules by typing CTRL+SPACE while editing the rule’s Condition property on the General tab.

Available data for order rules

Adding discount rules

You can add discount rules in Store configuration -> Discount rules on the Catalog rules / Order rules tab (alternatively also in the Multistore configuration application).

To build the discount rules’ macro conditions, you can use only the data available for the respective type of discount rules (data available for catalog rules, data available for order rules). Or you can customize the system’s code to build more complex conditions.

  1. (Optional) Add a new classto the App_Code\CMSModules\Ecommerce\ sub-folder in your Kentico installation directory.

    • Make sure the class inherits from the MacroMethodContainer class.
    1. Add your custom methods into the class.

    2. Register your macro method container class into the macro engine.

    3. Save the class and build your solution.

  2. Open the Store configuration application.

  3. Switch to the Discount rules tab.

  4. Switch to catalog rules (order rules) using the corresponding tab.

  5. Click New catalog rule (New order rule).

  6. Enter the discount rule properties as required.

    Adding a catalog rule - General tab

  7. Click Save.

    • The system creates a new discount rule leaving it open on the General tab.
  8. (Optional) Switch to the Parameters tab.

  9. Define the discount rule’s parameter(s) if required.

    Adding a catalog rule - Parameters tab

  10. Click Save.

You can now use the discount rule to limit the application of your discounts / free shipping offers.

Please refer to Example - Adding an order rulefor an example of adding a custom discount rule with a macro condition calling a custom method.

Filtering discount rules

The system allows you to view only discount rules matching certain search criteria (the display name of the rule, its condition and status).

  1. Open the Store configuration (Multistore configuration) application.

  2. Use the tabs to view the list of available catalog rules / order rules.

    • The system shows all corresponding discount rules available in the system.

      Catalog rules

  3. Specify your search criteria.

  4. Click Search.

  5. (Optional) Click Reset to view all catalog rules / order rules available in the system.

The system shows only discount rules matching your search criteria.

Catalog rules - filtered

Modifying discount rules

You can modify discount rules in Store configuration -> Discount rules on the Catalog rules / Order rules tab (alternatively also in the Multistore configuration application).

  1. Using the tabs, select either catalog rules or order rules.
  2. Select a discount rule and click Edit ().
  3. Modify the rule’s properties as required.
  4. (Optional) Switch to the Parameters tab.
  5. (Optional) Modify the rule’s parameters (if any).
  6. Click Save.

You can now use the discount rule with its updated settings.

Removing discount rules

You can remove discount rules from the system in Store configuration -> Discount rules on the Catalog rules / Order rules tab (alternatively also in the Multistore configuration application).

  1. Using the tabs, select either catalog rules or order rules.
  2. Select a discount rule.
  3. Click Delete ().
  4. Confirm that you want to remove the discount rule (OK).

The system removes the discount rule from your on-line store(s).

Reference

General tab

See Creating macro rules.

Parameters tab

See Reference - Field editor.