Hide menu Last updated: May 17 2016

Promotions

This topic explains the promotion functionality, which is part of Episerver Commerce's new Campaign Management feature.  

How it works

promotion is a marketing tool used to increase sales of certain products or product lines. There are three promotion types.

  • EntryPromotion. Applies reward to a specific entry.
  • OrderPromotion. Applies reward to entire order.
  • ShippingPromotion. Applies reward to order's shipping cost.

Included promotion types

Item promotion

  • Get cheapest for free.Buy at least X items, get the cheapest Y for free.
  • Get most expensive for free. Buy at least X items, get most expensive for free.
  • Fixed price. Buy a fixed number of items from selected categories for a set price.
  • Reduction on related items. Buy at least X items, get a reward on selected items.
  • Spend for discounted selection. Spend a minimum amount  to get a discount on selected items.
  • Get gift items. Spend a minimum amount on an order to get free items.
  • Buy products get discount on all selected. Buy at least X items, get discount on all selected.

Order promotion

  • Discount off total order value. Spend minimum amount and get reward on entire order.
  • Buy product and get discount on order. Buy at least X items, get a reward on entire order.

Shipping promotion

  • Discount off shipping costs. Spend minimum amount and get discounted shipping costs.
  • Buy products for discounted shipping. Buy a minimum number of items to get a reduction in shipping cost.
  • Buy products for free shipping. Buy at least X items and get free shipping.
  • Spend for free shipping. Spend amount and get free shipping costs.

Extending promotions example

Sometimes, it is useful to add properties to promotions for marketing purposes but use the base processor for evaluation. Below is an example of how to do this.

using EPiServer.Commerce.Marketing;
using EPiServer.Commerce.Marketing.Promotions;
using EPiServer.Core;
using EPiServer.DataAbstraction;
using EPiServer.DataAnnotations;
using System.ComponentModel.DataAnnotations;

namespace EPiServer.Commerce.Sample.Models.Discounts
{
    [ContentType(GUID = "530a7f07-8d12-4625-bda3-8e135a10b74d")]
    [AvailableContentTypes(Include = new[] { typeof (PromotionData) })] 
    public class MyCompanyBuyQuantityGetItemDiscount: BuyQuantityGetItemDiscount
    {

        [Display(Order = 13, GroupName = SystemTabNames.PageHeader, Prompt = "Other Info")]
        public virtual string OtherInfo { get; set; }
    }
}

Using render templates

Promotion content uses normal rendering templates as described here. By default, only partial views are available for promotion content.

Partial views

using System.Web.Mvc;
using EPiServer.Framework.DataAnnotations;
using EPiServer.Web.Mvc;

namespace MyEpiserverSite.Controllers
{
    [TemplateDescriptor(Default = true)]
    public class MyCompanyBuyQuantityGetItemDiscountPartialController : PartialContentController<MyCompanyBuyQuantityGetItemDiscount>
    {

        public ActionResult Index(MyCompanyBuyQuantityGetItemDiscount currentDiscount)
        {
            // Implementation of action view the page. 

            return View(currentDiscount);
        }
    }
}

Example: The corresponding rendering view for displaying the promotion partial view. 

@using EPiServer.Core
@using EPiServer.Web.Mvc.Html

@model EPiServer.Commerce.Sample.Models.Discounts.MyCompanyBuyQuantityGetItemDiscount 

<h1>
    @Html.DisplayFor(m => m.Name)
</h1>
<h3>
    @Html.PropertyFor(m => m.Description)
</h3>
<p>
    @Html.PropertyFor(m => m.OtherInfo)
</p>

Comments