Discount Method System Overview

Follow

Overview


Some shopping cart and eCommerce platforms offer very limited discount systems that only allow users to create one type of discount, for example a simple coupon code. Spark Pay Online Stores feature a robust and flexible discount rule engine that gives store administrators the power to create discounts that fit nearly every possible scenario. The purpose of this article is to provider a broad introduction to Spark Pay's discount system. For more information or step by step instructions on creating specific discounts, see the Discount & Pricing Category.

 

Creating a Discount


Discounts methods can be created in Marketing > Discounts by clicking the New:

Discount methods are composed of three basic components:

  • discount method rules
  • discount actions
    • discount action rules (optional)

If the contents of the customer's cart pass the method and action rules, the discount action is applied to the order.

 

Discount Actions


Once a discount method is given a name and saved, the Discount Actions will be accessible. Discount actions define what the discount actually does; Discounts must have at least one action.

Discount actions can be created by clicking New Action on the Edit Discount Method Screen:

 

Below is an example of the Edit Discount Action screen:

 

 

To show all the possible configurations of of a discount action, here's a screenshot with the selections expanded:

 

 

Discount Method Rules


Discount method rules determine if the customer's order is eligible for the whole discount. Discount rules are accessible once a discount is given a name and saved.

Discount method rules can be created by clicking New Rule on the Edit Discount Method screen:

 

Below is a screenshot of the Edit Discount Rule screen with an expanded view of the Rule Types:

 

Method rules function as an AND or an OR statement:

  • If Method is Strict is checked, ALL method rules must pass (AND statement)
  • If Method is Strict is NOT checked, ANY method rule must pass (OR statement)

 

Discount Action Rules


Discount Actions can optionally have their own rules. If an action has rules, a customer's order must meet the action's rules (and the method rules) in order for the action to be applied to the order. Action rules become accessible at the bottom of the Edit Discount Action screen after a discount action is saved:

Action Rules can function as an AND or an OR statement:

  • If Action is Strict is checked, ALL method rules must pass (AND statement)
  • If Action is Strict is NOT checked, ANY method rule must pass (OR statement)

Method Rules vs Action Rules


Why do discount methods have method rules and action rules? The answer: to maximize configurability.

Here's an example:

Let's say you would like a to setup a discount that gives wholesale customers a 5% discount on products from 3 categories (shirts, shoes, and pants) when they use a coupon code (5OFF).

This can be broken down to:

IF the customer type is wholesale AND coupon code is 5OFF, discount order by 5% if product is in shirts OR shoes OR pants categories.

In other words, both an AND and an OR statement need to be used. This can not be done with method rules alone, since we can only make a method strict or not strict (and not both). Here's how this discount would be setup:

  • Action: Subtract 5 percent from whole order
  • Action is Strict: False
  • Action Rule 1: Category in cart equal to shirts
  • Action Rule 2: Category in cart equal to pants
  • Action Rule 3: Category in cart equal to shoes
  • Method is Strict: True
  • Method Rule 1: Customer type equal to Wholesale
  • Method Rule 2: Coupon Code Equal to 5OFF

In short, discount action rules are used when:

  • Rules need to function as both an AND and on OR Statement
  • Using multiple discount actions with different restrictions

 

Discount Method Settings


Discount Method Settings: Marketing > Discounts > Edit Discount Method

  • Method Name: This will be displayed in the shopping cart and invoice, so make sure it is clear.
  • Method is Active: Enables or disables the whole discount.
  • Method is Strict: All rules must be satisfied for a Strict method
  • Only Once Per Customer: The discount can only be used once per customer
  • Starts on Date: The date the discount will be available to customers. If the discount is active, the discount will automatically be enabled and accessible to customers at 12 AM Central time on this date.
  • Expires: Enables the expiration date.
  • Expires on Date: If expires is checked, the discount will become unusable at 12 AM Central time on this date.
  • Remaining Uses: The total number of times the discount can be used by all customers. Every time the discount is used, remaining uses is automatically decreased by 1.
  • Give free shipping when this discount is activated: Shipping will be 100% discounted, for any shipping method selected. Caution should be used with this setting, especially if customers can chose from expensive shipping methods like overnight or international. The setting will only work if there is a discount action and rule.
  • Notes: notes about the discount -- only seen in the admin console.

Action Settings: Marketing > Discounts > Edit Discount Method >  Edit Discount Action

  • Action is Active: Only actions marked as active will be evaluated and applied.
  • Action is Strict: Actions marked as strict will only be applied if all of their rules pass. Also any in cart rules will only pass if all items in the cart match the rule.
  • Action is Exclusive: Only one exclusive action will be applied per discount method. The first exclusive action (according to its sort order) encountered that passes its rules will be applied.
  • Sort: Actions for a discount method are evaluated and applied in the order of their sort. Lower sorts are evaluated first.
  • Action: The action is what will occur after the overall discount method's rules pass and all of the discount action's rules (if any) pass.

Rule Settings: Marketing > Discounts > Edit Discount Method > Edit Discount Rule

  • Rule Type: The type of the rule. Many options available.
  • Operator: In most there will be two options: equal to and equal to any case. If equal to is selected, the rule will  evaluate the target as case-sensitive. If equal to any case is checked, the case of the alphabetical characters in the target field will be ignored.
  • Target: The specific object to be matched. For example, when the rule type is an item in cart, the target would be a specific item number or a regular expression defining many item numbers.
  • Target Quantity: On some rule types. Allows for restricting the quantity the discount action will be applied to. Can be a minimum number, multiple, or maximum.

Store Specific Discount Settings: Settings > Catalog > General

  • : When enabled, this setting will cause product prices to be displayed with any applicable discounts for that product automatically factored in.  Note that only discounts that directly affect specific products are supported for this feature; if a discount requires that multiple items be in the cart or other conditions be met to apply, it will not be factored in to the price. 

Settings > Orders > General:

  • Accept Coupons: Accept Coupons on your online store.  If checked, the Coupon Code field will be displayed on the shopping cart and order details pages.

Catalog > Product > Edit Product > General:

  • Do Not Discount: If true, no discount methods will apply to this product.

 

Regular Expressions (RegEx)


The target field in method rules and action rules accepts some regular expressions. This is advanced functionality, and it is recommended that only users who are familiar with regular expressions use this feature. Below is a table with examples of the accepted RegEx:

Match Code Result
widgeta matches just "widgeta"
widgetb matches just "widgetb"
(widgeta|widgetb|widgetc) matches "widgeta", "widgetb", or "widgetc"
widget(a|b|c) matches "widgeta", "widgetb", or "widgetc"
widget. matches "widgeta" or "widgetb", but NOT "widgetax" or "widget"
w.dget matches "widget" or "wadget" ... any single char where the dot is
.*widget.* matches any item number with widget anywhere inside, INCLUDING "widget" by itself
widget[0-9] matches "widget0", "widget1", ..., "widget9", but NOT "widgeta"
NOTE: Regex strings are case-insensitive.

 

Troubleshooting Discounts


Below are some troubleshooting steps to take if a discount is not working. Be sure to test in an incognito/private browsing window, and clear the shopping cart and add the products back after each test.

  • Is the discount active?
  • Is the action(s) active?
  • Is the discount expired?
  • If the discount has a customer type rule, are you logged in as the customer type in a private window?
  • Is the discount strict? If so, does the cart pass every rule?
  • Does the discount have action rules? If so, does it pass all the action rules and the method rules?
  • Does the discount have an action? Discounts will not work without an action
  • Does the discount use a coupon code? If so, is the correct character case being entered?
  • Is the coupon code a method rule? Coupon code rules only work as a method rule, and not as an action rule
  • Is there a space in the discount code rule?
  • Is the product marked as Do Not Discount in Catalog > Products > Edit Product > General?

 

TL;DR: Too Long; Didn't Read


Discounts can be created in Marketing > Discounts. Discounts are created with discount methods.

Discount methods are composed of three basic components:

  • discount method rules
  • discount actions
    • discount action rules (optional)

If the contents of the customer's cart pass the method and action rules, the discount action is applied to the order.

Method and Action Rules can function as an AND or an OR statement:

  • If Method is Strict is checked, ALL method rules must pass (AND statement)
  • If Method is Strict is NOT checked, ANY method rule must pass (OR statement)
  • If Action is Strict is checked, ALL Action rules must pass (AND statement)
  • If Action is Strict is NOT checked, ANY action rule must pass (OR statement

Method rules are evaluated first. If the contents of the customer's cart do not pass the method rule(s), the customer will not receive a discount, no action rules will be evaluated, and no discount actions will be executed.

Next, each action's rules are evaluated. If they pass, they are applied to the order.

Actions and their rules are applied and evaluated based on their sort order. If they have the same sort order, then they are applied and executed by their ID.

Useful Discount Method Articles

Have more questions? Submit a request

Comments