Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

Discount.cs

namespace Nop.Core.Domain.Discounts;

/// 
/// Represents a discount
/// 
public partial class Discount : BaseEntity
{
    /// 
    /// Gets or sets the name
    /// 
    public string Name { get; set; }

    /// 
    /// Gets or sets the admin comment
    /// 
    public string AdminComment { get; set; }

    /// 
    /// Gets or sets the discount type identifier
    /// 
    public int DiscountTypeId { get; set; }

    /// 
    /// Gets or sets a value indicating whether to use percentage
    /// 
    public bool UsePercentage { get; set; }

    /// 
    /// Gets or sets the discount percentage
    /// 
    public decimal DiscountPercentage { get; set; }

    /// 
    /// Gets or sets the discount amount
    /// 
    public decimal DiscountAmount { get; set; }

    /// 
    /// Gets or sets the maximum discount amount (used with "UsePercentage")
    /// 
    public decimal? MaximumDiscountAmount { get; set; }

    /// 
    /// Gets or sets the discount start date and time
    /// 
    public DateTime? StartDateUtc { get; set; }

    /// 
    /// Gets or sets the discount end date and time
    /// 
    public DateTime? EndDateUtc { get; set; }

    /// 
    /// Gets or sets a value indicating whether discount requires coupon code
    /// 
    public bool RequiresCouponCode { get; set; }

    /// 
    /// Gets or sets the coupon code
    /// 
    public string CouponCode { get; set; }

    /// 
    /// Gets or sets a value indicating whether discount can be used simultaneously with other discounts (with the same discount type)
    /// 
    public bool IsCumulative { get; set; }

    /// 
    /// Gets or sets the discount limitation identifier
    /// 
    public int DiscountLimitationId { get; set; }

    /// 
    /// Gets or sets the discount limitation times (used when Limitation is set to "N Times Only" or "N Times Per Customer")
    /// 
    public int LimitationTimes { get; set; }

    /// 
    /// Gets or sets the maximum product quantity which could be discounted
    /// Used with "Assigned to products" or "Assigned to categories" type
    /// 
    public int? MaximumDiscountedQuantity { get; set; }

    /// 
    /// Gets or sets value indicating whether it should be applied to all subcategories or the selected one
    /// Used with "Assigned to categories" type only.
    /// 
    public bool AppliedToSubCategories { get; set; }

    /// 
    /// Gets or sets a value indicating whether the discount is active
    /// 
    public bool IsActive { get; set; }

    /// 
    /// Gets or sets the discount type
    /// 
    public DiscountType DiscountType
    {
        get => (DiscountType)DiscountTypeId;
        set => DiscountTypeId = (int)value;
    }

    /// 
    /// Gets or sets the discount limitation
    /// 
    public DiscountLimitationType DiscountLimitation
    {
        get => (DiscountLimitationType)DiscountLimitationId;
        set => DiscountLimitationId = (int)value;
    }
}