Search Results for

    Show / Hide Table of Contents

    Class Coupon

    Represents a coupon that that can be used for a discount.

    Inheritance
    System.Object
    Coupon
    Namespace: DirectScale.Disco.Extension
    Assembly: DirectScale.Disco.Extension.Abstractions.dll
    Syntax
    public class Coupon : Object

    Constructors

    Coupon()

    Declaration
    public Coupon()

    Properties

    AllItemIdsRequired

    True means that all of the items in AppliedItemIds must be included in the purchase for this coupon to be valid. False means each item in AppliedItemIds is elegible for the discount.

    Declaration
    public bool AllItemIdsRequired { get; set; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    If CouponType is CouponType.ShippingDiscount then this value is ignored.

    Examples

    True: "BUNDLE DEAL! Save 15% when you purchase all three!" False: "Today only! 20% off these 5 items!"

    See Also
    AppliedItemIds

    AmountType

    Indicates if the discount should be a fixed amount or a percentage.

    Declaration
    public AmountType AmountType { get; set; }
    Property Value
    Type Description
    AmountType
    See Also
    Discount

    AppliedItemIds

    The item ids that this coupon can apply to. Only used if CouponType is CouponType.ItemDiscount

    Declaration
    public int[] AppliedItemIds { get; set; }
    Property Value
    Type Description
    System.Int32[]
    See Also
    AllItemIdsRequired

    AssociateIds

    This is just a helper to provide the associate Ids of the associates indicated in BackOfficeIds since associate Ids are more commonly used than back office ids. This will be filled out if returned by ICouponService, but will NOT be read by ! Only use BackOfficeIds when trying to set these values!

    Declaration
    public HashSet<int> AssociateIds { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.HashSet<System.Int32>
    See Also
    BackOfficeIds

    BackOfficeIds

    Indicates which associates can use this coupon. If empy this is a publically available coupon.

    Declaration
    public string[] BackOfficeIds { get; set; }
    Property Value
    Type Description
    System.String[]
    See Also
    AssociateIds

    BeginDate

    The first day that this discout is available.

    Declaration
    public DateTime BeginDate { get; set; }
    Property Value
    Type Description
    System.DateTime

    Code

    This is the text coupon code.

    Declaration
    public string Code { get; set; }
    Property Value
    Type Description
    System.String
    Examples

    "SUMMRFUN2020!"

    CodeDisplay

    Declaration
    public string CodeDisplay { get; }
    Property Value
    Type Description
    System.String

    CouponId

    This if the coupon's Id in the DB.

    Declaration
    public int CouponId { get; set; }
    Property Value
    Type Description
    System.Int32

    CouponType

    Indicates what specifically is getting discounted. This will affect how discounts are applied and the maximum amount of the discount.

    Declaration
    public CouponType CouponType { get; set; }
    Property Value
    Type Description
    CouponType

    Description

    Provides a string representation of this coupon.

    Declaration
    public string Description { get; }
    Property Value
    Type Description
    System.String
    See Also
    CodeDisplay
    Description
    DescriptionWithCode
    DescriptionWithIdAndCode

    DescriptionWithCode

    Declaration
    public string DescriptionWithCode { get; }
    Property Value
    Type Description
    System.String

    DescriptionWithIdAndCode

    Declaration
    public string DescriptionWithIdAndCode { get; }
    Property Value
    Type Description
    System.String

    Discount

    The amount to be discounted.

    Declaration
    public double Discount { get; set; }
    Property Value
    Type Description
    System.Double
    See Also
    AmountType

    EndDate

    The last day this day is available.

    Declaration
    public DateTime EndDate { get; set; }
    Property Value
    Type Description
    System.DateTime

    MinQty

    If the CouponType is ItemDiscount, this is how many of that item need to be purchased to receive the discount. (Example, buy 3 get 1 free!) Otherwise, it is the subtotal of the order required to receive the discount. (Example, 10% off orders of $150 or more!)

    Declaration
    public double MinQty { get; set; }
    Property Value
    Type Description
    System.Double

    OrderType

    Please use OrderTypes instead. This field is deprecated"

    Declaration
    public OrderType OrderType { get; set; }
    Property Value
    Type Description
    OrderType

    OrderTypes

    Indicates which order types can be used for this coupon.

    Declaration
    public List<OrderType> OrderTypes { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<OrderType>

    PriceGroupIds

    Indicates which price groups can use this coupon.

    Declaration
    public int[] PriceGroupIds { get; set; }
    Property Value
    Type Description
    System.Int32[]

    Recurring

    True if this coupon can be used mulitple times. False if each associate can only use it once.

    Declaration
    public bool Recurring { get; set; }
    Property Value
    Type Description
    System.Boolean

    RegionIds

    These are the specific region Id where this coupon is valid. An empty array allows all regions.

    Declaration
    public int[] RegionIds { get; set; }
    Property Value
    Type Description
    System.Int32[]
    In This Article
    Back to top Copyright © 2022 DirectScale
    Generated by DocFX