Webiant Logo Webiant Logo
  1. No results found.

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

Product.cs

using Nop.Core.Domain.Common;
using Nop.Core.Domain.Discounts;
using Nop.Core.Domain.Localization;
using Nop.Core.Domain.Security;
using Nop.Core.Domain.Seo;
using Nop.Core.Domain.Stores;

namespace Nop.Core.Domain.Catalog;

/// 
/// Represents a product
/// 
public partial class Product : BaseEntity, ILocalizedEntity, ISlugSupported, IAclSupported, IStoreMappingSupported, IDiscountSupported, ISoftDeletedEntity
{
    /// 
    /// Gets or sets the product type identifier
    /// 
    public int ProductTypeId { get; set; }

    /// 
    /// Gets or sets the parent product identifier. It's used to identify associated products (only with "grouped" products)
    /// 
    public int ParentGroupedProductId { get; set; }

    /// 
    /// Gets or sets the values indicating whether this product is visible in catalog or search results.
    /// It's used when this product is associated to some "grouped" one
    /// This way associated products could be accessed/added/etc only from a grouped product details page
    /// 
    public bool VisibleIndividually { get; set; }

    /// 
    /// Gets or sets the name
    /// 
    public string Name { get; set; }

    /// 
    /// Gets or sets the short description
    /// 
    public string ShortDescription { get; set; }

    /// 
    /// Gets or sets the full description
    /// 
    public string FullDescription { get; set; }

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

    /// 
    /// Gets or sets a value of used product template identifier
    /// 
    public int ProductTemplateId { get; set; }

    /// 
    /// Gets or sets a vendor identifier
    /// 
    public int VendorId { get; set; }

    /// 
    /// Gets or sets a value indicating whether to show the product on home page
    /// 
    public bool ShowOnHomepage { get; set; }

    /// 
    /// Gets or sets the meta keywords
    /// 
    public string MetaKeywords { get; set; }

    /// 
    /// Gets or sets the meta description
    /// 
    public string MetaDescription { get; set; }

    /// 
    /// Gets or sets the meta title
    /// 
    public string MetaTitle { get; set; }

    /// 
    /// Gets or sets a value indicating whether the product allows customer reviews
    /// 
    public bool AllowCustomerReviews { get; set; }

    /// 
    /// Gets or sets the rating sum (approved reviews)
    /// 
    public int ApprovedRatingSum { get; set; }

    /// 
    /// Gets or sets the rating sum (not approved reviews)
    /// 
    public int NotApprovedRatingSum { get; set; }

    /// 
    /// Gets or sets the total rating votes (approved reviews)
    /// 
    public int ApprovedTotalReviews { get; set; }

    /// 
    /// Gets or sets the total rating votes (not approved reviews)
    /// 
    public int NotApprovedTotalReviews { get; set; }

    /// 
    /// Gets or sets a value indicating whether the entity is subject to ACL
    /// 
    public bool SubjectToAcl { get; set; }

    /// 
    /// Gets or sets a value indicating whether the entity is limited/restricted to certain stores
    /// 
    public bool LimitedToStores { get; set; }

    /// 
    /// Gets or sets the SKU
    /// 
    public string Sku { get; set; }

    /// 
    /// Gets or sets the manufacturer part number
    /// 
    public string ManufacturerPartNumber { get; set; }

    /// 
    /// Gets or sets the Global Trade Item Number (GTIN). These identifiers include UPC (in North America), EAN (in Europe), JAN (in Japan), and ISBN (for books).
    /// 
    public string Gtin { get; set; }

    /// 
    /// Gets or sets a value indicating whether the product is gift card
    /// 
    public bool IsGiftCard { get; set; }

    /// 
    /// Gets or sets the gift card type identifier
    /// 
    public int GiftCardTypeId { get; set; }

    /// 
    /// Gets or sets gift card amount that can be used after purchase. If not specified, then product price will be used.
    /// 
    public decimal? OverriddenGiftCardAmount { get; set; }

    /// 
    /// Gets or sets a value indicating whether the product requires that other products are added to the cart (Product X requires Product Y)
    /// 
    public bool RequireOtherProducts { get; set; }

    /// 
    /// Gets or sets a required product identifiers (comma separated)
    /// 
    public string RequiredProductIds { get; set; }

    /// 
    /// Gets or sets a value indicating whether required products are automatically added to the cart
    /// 
    public bool AutomaticallyAddRequiredProducts { get; set; }

    /// 
    /// Gets or sets a value indicating whether the product is download
    /// 
    public bool IsDownload { get; set; }

    /// 
    /// Gets or sets the download identifier
    /// 
    public int DownloadId { get; set; }

    /// 
    /// Gets or sets a value indicating whether this downloadable product can be downloaded unlimited number of times
    /// 
    public bool UnlimitedDownloads { get; set; }

    /// 
    /// Gets or sets the maximum number of downloads
    /// 
    public int MaxNumberOfDownloads { get; set; }

    /// 
    /// Gets or sets the number of days during customers keeps access to the file.
    /// 
    public int? DownloadExpirationDays { get; set; }

    /// 
    /// Gets or sets the download activation type
    /// 
    public int DownloadActivationTypeId { get; set; }

    /// 
    /// Gets or sets a value indicating whether the product has a sample download file
    /// 
    public bool HasSampleDownload { get; set; }

    /// 
    /// Gets or sets the sample download identifier
    /// 
    public int SampleDownloadId { get; set; }

    /// 
    /// Gets or sets a value indicating whether the product has user agreement
    /// 
    public bool HasUserAgreement { get; set; }

    /// 
    /// Gets or sets the text of license agreement
    /// 
    public string UserAgreementText { get; set; }

    /// 
    /// Gets or sets a value indicating whether the product is recurring
    /// 
    public bool IsRecurring { get; set; }

    /// 
    /// Gets or sets the cycle length
    /// 
    public int RecurringCycleLength { get; set; }

    /// 
    /// Gets or sets the cycle period
    /// 
    public int RecurringCyclePeriodId { get; set; }

    /// 
    /// Gets or sets the total cycles
    /// 
    public int RecurringTotalCycles { get; set; }

    /// 
    /// Gets or sets a value indicating whether the product is rental
    /// 
    public bool IsRental { get; set; }

    /// 
    /// Gets or sets the rental length for some period (price for this period)
    /// 
    public int RentalPriceLength { get; set; }

    /// 
    /// Gets or sets the rental period (price for this period)
    /// 
    public int RentalPricePeriodId { get; set; }

    /// 
    /// Gets or sets a value indicating whether the entity is ship enabled
    /// 
    public bool IsShipEnabled { get; set; }

    /// 
    /// Gets or sets a value indicating whether the entity is free shipping
    /// 
    public bool IsFreeShipping { get; set; }

    /// 
    /// Gets or sets a value this product should be shipped separately (each item)
    /// 
    public bool ShipSeparately { get; set; }

    /// 
    /// Gets or sets the additional shipping charge
    /// 
    public decimal AdditionalShippingCharge { get; set; }

    /// 
    /// Gets or sets a delivery date identifier
    /// 
    public int DeliveryDateId { get; set; }

    /// 
    /// Gets or sets a value indicating whether the product is marked as tax exempt
    /// 
    public bool IsTaxExempt { get; set; }

    /// 
    /// Gets or sets the tax category identifier
    /// 
    public int TaxCategoryId { get; set; }        

    /// 
    /// Gets or sets a value indicating how to manage inventory
    /// 
    public int ManageInventoryMethodId { get; set; }

    /// 
    /// Gets or sets a product availability range identifier
    /// 
    public int ProductAvailabilityRangeId { get; set; }

    /// 
    /// Gets or sets a value indicating whether multiple warehouses are used for this product
    /// 
    public bool UseMultipleWarehouses { get; set; }

    /// 
    /// Gets or sets a warehouse identifier
    /// 
    public int WarehouseId { get; set; }

    /// 
    /// Gets or sets the stock quantity
    /// 
    public int StockQuantity { get; set; }

    /// 
    /// Gets or sets a value indicating whether to display stock availability
    /// 
    public bool DisplayStockAvailability { get; set; }

    /// 
    /// Gets or sets a value indicating whether to display stock quantity
    /// 
    public bool DisplayStockQuantity { get; set; }

    /// 
    /// Gets or sets the minimum stock quantity
    /// 
    public int MinStockQuantity { get; set; }

    /// 
    /// Gets or sets the low stock activity identifier
    /// 
    public int LowStockActivityId { get; set; }

    /// 
    /// Gets or sets the quantity when admin should be notified
    /// 
    public int NotifyAdminForQuantityBelow { get; set; }

    /// 
    /// Gets or sets a value backorder mode identifier
    /// 
    public int BackorderModeId { get; set; }

    /// 
    /// Gets or sets a value indicating whether to back in stock subscriptions are allowed
    /// 
    public bool AllowBackInStockSubscriptions { get; set; }

    /// 
    /// Gets or sets the order minimum quantity
    /// 
    public int OrderMinimumQuantity { get; set; }

    /// 
    /// Gets or sets the order maximum quantity
    /// 
    public int OrderMaximumQuantity { get; set; }

    /// 
    /// Gets or sets the comma separated list of allowed quantities. null or empty if any quantity is allowed
    /// 
    public string AllowedQuantities { get; set; }

    /// 
    /// Gets or sets a value indicating whether we allow adding to the cart/wishlist only attribute combinations that exist and have stock greater than zero.
    /// This option is used only when we have "manage inventory" set to "track inventory by product attributes"
    /// 
    public bool AllowAddingOnlyExistingAttributeCombinations { get; set; }

    /// 
    /// Gets or sets a value indicating whether to display attribute combination images only
    /// 
    public bool DisplayAttributeCombinationImagesOnly { get; set; }

    /// 
    /// Gets or sets a value indicating whether this product is returnable (a customer is allowed to submit return request with this product)
    /// 
    public bool NotReturnable { get; set; }

    /// 
    /// Gets or sets a value indicating whether to disable buy (Add to cart) button
    /// 
    public bool DisableBuyButton { get; set; }

    /// 
    /// Gets or sets a value indicating whether to disable "Add to wishlist" button
    /// 
    public bool DisableWishlistButton { get; set; }

    /// 
    /// Gets or sets a value indicating whether this item is available for Pre-Order
    /// 
    public bool AvailableForPreOrder { get; set; }

    /// 
    /// Gets or sets the start date and time of the product availability (for pre-order products)
    /// 
    public DateTime? PreOrderAvailabilityStartDateTimeUtc { get; set; }

    /// 
    /// Gets or sets a value indicating whether to show "Call for Pricing" or "Call for quote" instead of price
    /// 
    public bool CallForPrice { get; set; }

    /// 
    /// Gets or sets the price
    /// 
    public decimal Price { get; set; }

    /// 
    /// Gets or sets the old price
    /// 
    public decimal OldPrice { get; set; }

    /// 
    /// Gets or sets the product cost
    /// 
    public decimal ProductCost { get; set; }

    /// 
    /// Gets or sets a value indicating whether a customer enters price
    /// 
    public bool CustomerEntersPrice { get; set; }

    /// 
    /// Gets or sets the minimum price entered by a customer
    /// 
    public decimal MinimumCustomerEnteredPrice { get; set; }

    /// 
    /// Gets or sets the maximum price entered by a customer
    /// 
    public decimal MaximumCustomerEnteredPrice { get; set; }

    /// 
    /// Gets or sets a value indicating whether base price (PAngV) is enabled. Used by German users.
    /// 
    public bool BasepriceEnabled { get; set; }

    /// 
    /// Gets or sets an amount in product for PAngV
    /// 
    public decimal BasepriceAmount { get; set; }

    /// 
    /// Gets or sets a unit of product for PAngV (MeasureWeight entity)
    /// 
    public int BasepriceUnitId { get; set; }

    /// 
    /// Gets or sets a reference amount for PAngV
    /// 
    public decimal BasepriceBaseAmount { get; set; }

    /// 
    /// Gets or sets a reference unit for PAngV (MeasureWeight entity)
    /// 
    public int BasepriceBaseUnitId { get; set; }

    /// 
    /// Gets or sets a value indicating whether this product is marked as new
    /// 
    public bool MarkAsNew { get; set; }

    /// 
    /// Gets or sets the start date and time of the new product (set product as "New" from date). Leave empty to ignore this property
    /// 
    public DateTime? MarkAsNewStartDateTimeUtc { get; set; }

    /// 
    /// Gets or sets the end date and time of the new product (set product as "New" to date). Leave empty to ignore this property
    /// 
    public DateTime? MarkAsNewEndDateTimeUtc { get; set; }

    /// 
    /// Gets or sets a value indicating whether this product has tier prices configured
    /// The same as if we run TierPrices.Count > 0
    /// We use this property for performance optimization:
    /// if this property is set to false, then we do not need to load tier prices navigation property
    /// 
    /// 
    public bool HasTierPrices { get; set; }

    /// 
    /// Gets or sets a value indicating whether this product has discounts applied
    /// The same as if we run AppliedDiscounts.Count > 0
    /// We use this property for performance optimization:
    /// if this property is set to false, then we do not need to load Applied Discounts navigation property
    /// 
    /// 
    public bool HasDiscountsApplied { get; set; }

    /// 
    /// Gets or sets the weight
    /// 
    public decimal Weight { get; set; }

    /// 
    /// Gets or sets the length
    /// 
    public decimal Length { get; set; }

    /// 
    /// Gets or sets the width
    /// 
    public decimal Width { get; set; }

    /// 
    /// Gets or sets the height
    /// 
    public decimal Height { get; set; }

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

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

    /// 
    /// Gets or sets a display order.
    /// This value is used when sorting associated products (used with "grouped" products)
    /// This value is used when sorting home page products
    /// 
    public int DisplayOrder { get; set; }

    /// 
    /// Gets or sets a value indicating whether the entity is published
    /// 
    public bool Published { get; set; }

    /// 
    /// Gets or sets a value indicating whether the entity has been deleted
    /// 
    public bool Deleted { get; set; }

    /// 
    /// Gets or sets the date and time of product creation
    /// 
    public DateTime CreatedOnUtc { get; set; }

    /// 
    /// Gets or sets the date and time of product update
    /// 
    public DateTime UpdatedOnUtc { get; set; }

    /// 
    /// Gets or sets the product type
    /// 
    public ProductType ProductType
    {
        get => (ProductType)ProductTypeId;
        set => ProductTypeId = (int)value;
    }

    /// 
    /// Gets or sets the backorder mode
    /// 
    public BackorderMode BackorderMode
    {
        get => (BackorderMode)BackorderModeId;
        set => BackorderModeId = (int)value;
    }

    /// 
    /// Gets or sets the download activation type
    /// 
    public DownloadActivationType DownloadActivationType
    {
        get => (DownloadActivationType)DownloadActivationTypeId;
        set => DownloadActivationTypeId = (int)value;
    }

    /// 
    /// Gets or sets the gift card type
    /// 
    public GiftCardType GiftCardType
    {
        get => (GiftCardType)GiftCardTypeId;
        set => GiftCardTypeId = (int)value;
    }

    /// 
    /// Gets or sets the low stock activity
    /// 
    public LowStockActivity LowStockActivity
    {
        get => (LowStockActivity)LowStockActivityId;
        set => LowStockActivityId = (int)value;
    }

    /// 
    /// Gets or sets the value indicating how to manage inventory
    /// 
    public ManageInventoryMethod ManageInventoryMethod
    {
        get => (ManageInventoryMethod)ManageInventoryMethodId;
        set => ManageInventoryMethodId = (int)value;
    }

    /// 
    /// Gets or sets the cycle period for recurring products
    /// 
    public RecurringProductCyclePeriod RecurringCyclePeriod
    {
        get => (RecurringProductCyclePeriod)RecurringCyclePeriodId;
        set => RecurringCyclePeriodId = (int)value;
    }

    /// 
    /// Gets or sets the period for rental products
    /// 
    public RentalPricePeriod RentalPricePeriod
    {
        get => (RentalPricePeriod)RentalPricePeriodId;
        set => RentalPricePeriodId = (int)value;
    }
}