Example - Adding a catalog rule
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 receive a 10% discount on all products supplied by MySupplier, Ltd.
The example uses the sample E-commerce Site.
Please refer to Example - Adding an order rulefor 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).
- Open the Store configuration application.
- Switch to the Discount rules -> Catalog rules tab.
- 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
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}”)
Click Save.
The system saves the catalog rule, leaving it open for further editing.
Defining the rule’s parameters
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.
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.
Select supplier from the parameters list and enter (verify) the following values for its properties:
Field name: supplier
Field type: Text
Field size: 100
Required: Yes (checked)
Display field in the editing form: Yes (checked)
Field caption: select supplier
Form control: Supplier selector
Click Save.
The system adds a new catalog rule with two parameters. You can now use the rule in catalog discounts.
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.
You can add suppliers 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.
Open the Catalog discounts applications.
ClickNew catalog discount.
- The system opens a page where you can specify the catalog discount properties.
Enter the following values for the catalog discount’s general properties:
Name: Products by MySupplier, Ltd.
Enabled: Yes (checked)
Discount: By %
Value: 10
Specify the discount’s condition:
Click Edit to edit the discount’s Apply to property.
- This opens the Edit macro condition dialog on the Rule designer tab.
Select the Product supplier is rule in the right part of the dialog.
Click Add rule () to add the rule to the condition.
Click select in the left part of the dialog.
- The system opens the Set parameter value dialog for the supplier parameter.
Use the drop-down list to select the MySupplier, Ltd. supplier.
Click OK.
- The system closes the Set parameter value dialog for the supplier parameter. The Edit macro condition dialog is open for editing.
Click Save & Close to save the rule’s condition and leave the Edit macro condition dialog.
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
Make sure the Apple iPad 16GB tablet computer has the MySupplier, Ltd. supplier assigned.
View the live site.
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.
Click Add to cart in the Samsung 16GB Galaxy Tab section.
The product has product options. That’s why the system now displays the product’s details page.
Here you can specify the amount of product items.
Enter 1 for the amount of product items.
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.
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.
If you now click Check out, you can continue in the checkout process.