Developer Documentation

Enticify Runtime Configuration

You can configure Enticify to suit your specific promotional needs.

Enticify Styles

Enticify can be run in one of two styles. A style is just a collection of one or more runtime behaviours that influence how promotions are applied.

The Enticify Style is intended to provide a discount application setup that more closely relates to common client requirements. The main differences are as follows:

  • Subtotal discounts always run after item discounts and consider all basket lines as conditions/awards regardless of item discount interaction settings.
  • Shipping discounts always run after item and order discounts and consider all basket lines as conditions/awards regardless of item or order discount interaction settings.

This style may be configured once per application as follows:

.SetEngineStyle(EnticifyEngineStyle.EnticifyStyle());

The following sections explain the sort and application limits in more detail.

Discount Application Order Sort

Discounts are applied in a given order. The following section explains the order we use.

  1. Enticify first sorts the discounts into the following application order:
  • Item discounts.
  • Subtotal discounts.
  • Shipping discounts.
  1. These three discount types are sub-sorted as follows:
  • Priority descending.
  1. Any discounts of the same type AND priority are then sorted as follows:
  • Percentage Off.
  • Amount Off.
  • Fixed Price.

Application Limits

  • Many item level discounts
  • One to many subtotal discounts. Default limit is 1, but this can be configured in code using SubtotalDiscountConfiguration.
  • One shipping discount (which can apply once per-shipment)

Note: This is an area we intend to iterate based on customer-feedback.

Commerce Server Style

This style replicates CS and will likely be deprecated. Please let us know if you intend to go into production using this style.

This style may be configured once per application as follows:

EnticifyRunConfiguration.SetEngineStyle(EnticifyEngineStyle.CommerceServerStyle());

EnticifyRunConfiguration Object

When you run a pipeline containing Enticify, we read configuration settings from a EnticifyRunConfiguration instance.

If you provide an instance, you can:

  • Replace the default settings with your own.
  • Provide different settings for different pipeline runs (e.g. for different environments or customers).

We use a default instance if you do not provided one. The default is the equivalent of you doing this:

Example

This example shows the following:

  • How to create an instance of EnticifyRunConfiguration.
  • How to set the discount application sort order.
  • How to set the EnticifyRunConfiguration instance onto the PipelineInfo (where Enticify reads it from).

Basket Line Item Properties

We look for certain properties on basket line items. If these properties exist (or not) and are set in a certain way, they will influence runtime behaviour.

The following property settings are supported.

_enticify_exclude_from_order_subtotal_discounts

You can reference Enticify.Promotions and use the following LineItem extension method to set this property to true:

csLineItem.ExcludeFromOrderSubTotalDiscounts()

Supported from Version 2.1

  • true - this basket line will not receive any order subtotal discount adjustments.
  • false - this basket line will receive any applicable order subtotal discount adjustments.
  • Value is null - same as false.
  • Key does not exist - same as false.

ApplyZeroDeductionDiscounts

Sometimes a discount may apply, but does not result in a price reduction or other award. You may configure it this way, or it may happen becasue the award products have already been discounted. Sometimes this is done intentionally to create a marker discount. This is a discount that you have apply in order to trigger some custom code you've written outside of the discounts.

By default, Enticify will not apply discounts that have resulted in no award. This is the default behaviour, because such discounts, if unintentional, may disadvantage the customer. Additionally, we'd like to help you support marker discount scenarios in a first class way (so talk to us!). However, if you really need this, you can turn it on.