Last month when we unveiled our new approach to approval rules, I mentioned we were mulling over additional platform features that could leverage the underlying rules engine. Well, the next one has arrived: Promotions. Every savvy online shopper is familiar with coupon codes. (I confess I rarely buy anything without searching for one.) Promotions are a flexible new way to implement them in OrderCloud.

Each promotion has a Code that a buyer user can apply to an order. Other data points include Name, Description, and FinePrint. You can optionally set a StartDate and ExpirationDate, specify whether a user CanCombine it with other promotions, and set an overall RedemptionLimit and/or a RedemptionLimitPerUser. And of course there’s xp for anything else you might need.

But the most interesting attributes of promotions are the ones that leverage the rules engine: EligibleExpression and ValueExpression. With the former, you construct an expression that evaluates the current state of the order and returns true or false indicating whether the promotion can be applied to the order. The latter evaluates the order and returns a monetary value, which is subtracted from the order total.

Let’s look at a few examples of rules-based promotions…

10% off entire order:

ValueExpression = “order.Total * .10”

Free shipping on orders over $100 (before tax & shipping):

EligibleExpression = “order.Subtotal > 100”
ValueExpression = “order.ShippingCost”

BOGO for specific product:

EligibleExpression = “items.quantity(ProductID = ‘XYZ’) > 1”
ValueExpression = “items.total(ProductID = ‘XYZ’) / items.quantity(ProductID = ‘XYZ’)”

That last one might need a little explaining. The ValueExpression is calculating the unit price by taking the total price for all instances of the product (it could be broken into multiple lines for shipping purposes, etc.) and dividing by the total quantity. In simple pricing scenarios, you might be able to get away with just hard-coding it, i.e. ValueExpression = “10.99”.

If you haven’t already done so, check out our original introduction to the rules engine for more details on the syntax, data, and functions available to these expressions. With a little creativity, we’re confident that a very broad range of promotional functionality is now possible.

 

See How

Create Personalized Storefronts For Each Of Your Users

See how Entrust Datacard built hundreds of personalized storefronts for each of their partners in 34 countries around the world using OrderCloud.io.