Webiant Logo Webiant Logo
  1. No results found.

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

IPriceCalculationService.cs

using Nop.Core.Domain.Catalog;
using Nop.Core.Domain.Customers;
using Nop.Core.Domain.Directory;
using Nop.Core.Domain.Discounts;
using Nop.Core.Domain.Stores;

namespace Nop.Services.Catalog;

/// 
/// Price calculation service
/// 
public partial interface IPriceCalculationService
{
    /// 
    /// Gets the final price
    /// 
    /// Product
    /// The customer
    /// Store
    /// Additional charge
    /// A value indicating whether include discounts or not for final price computation
    /// Shopping cart item quantity
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the final price without discounts, Final price, Applied discount amount, Applied discounts
    /// 
    Task<(decimal priceWithoutDiscounts, decimal finalPrice, decimal appliedDiscountAmount, List appliedDiscounts)> GetFinalPriceAsync(Product product,
        Customer customer,
        Store store,
        decimal additionalCharge = 0,
        bool includeDiscounts = true,
        int quantity = 1);

    /// 
    /// Gets the final price
    /// 
    /// Product
    /// The customer
    /// Store
    /// Additional charge
    /// A value indicating whether include discounts or not for final price computation
    /// Shopping cart item quantity
    /// Rental period start date (for rental products)
    /// Rental period end date (for rental products)
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the final price without discounts, Final price, Applied discount amount, Applied discounts
    /// 
    Task<(decimal priceWithoutDiscounts, decimal finalPrice, decimal appliedDiscountAmount, List appliedDiscounts)> GetFinalPriceAsync(Product product,
        Customer customer,
        Store store,
        decimal additionalCharge,
        bool includeDiscounts,
        int quantity,
        DateTime? rentalStartDate,
        DateTime? rentalEndDate);

    /// 
    /// Gets the final price
    /// 
    /// Product
    /// The customer
    /// Store
    /// Overridden product price. If specified, then it'll be used instead of a product price. For example, used with product attribute combinations
    /// Additional charge
    /// A value indicating whether include discounts or not for final price computation
    /// Shopping cart item quantity
    /// Rental period start date (for rental products)
    /// Rental period end date (for rental products)
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the final price without discounts, Final price, Applied discount amount, Applied discounts
    /// 
    Task<(decimal priceWithoutDiscounts, decimal finalPrice, decimal appliedDiscountAmount, List appliedDiscounts)> GetFinalPriceAsync(Product product,
        Customer customer,
        Store store,
        decimal? overriddenProductPrice,
        decimal additionalCharge,
        bool includeDiscounts,
        int quantity,
        DateTime? rentalStartDate,
        DateTime? rentalEndDate);

    /// 
    /// Gets the product cost (one item)
    /// 
    /// Product
    /// Shopping cart item attributes in XML
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the product cost (one item)
    /// 
    Task GetProductCostAsync(Product product, string attributesXml);

    /// 
    /// Get a price adjustment of a product attribute value
    /// 
    /// Product
    /// Product attribute value
    /// Customer
    /// Store
    /// Product price (null for using the base product price)
    /// Shopping cart item quantity
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the price adjustment
    /// 
    Task GetProductAttributeValuePriceAdjustmentAsync(Product product,
        ProductAttributeValue value,
        Customer customer,
        Store store,
        decimal? productPrice = null,
        int quantity = 1);

    /// 
    /// Round a product or order total for the currency
    /// 
    /// Value to round
    /// Currency; pass null to use the primary store currency
    /// 
    /// A task that represents the asynchronous operation
    /// The task result contains the rounded value
    /// 
    Task RoundPriceAsync(decimal value, Currency currency = null);

    /// 
    /// Round
    /// 
    /// Value to round
    /// The rounding type
    /// Rounded value
    decimal Round(decimal value, RoundingType roundingType);
}