C# Class Nop.Services.Orders.OrderTotalCalculationService

Order service
Inheritance: IOrderTotalCalculationService
Mostra file Open project: emilianionascu/NopCommerce

Public Methods

Method Description
AdjustShippingRate ( decimal shippingRate, IList cart, Discount &appliedDiscount ) : decimal

Adjust shipping rate (free shipping, additional charges, discounts)

ConvertAmountToRewardPoints ( decimal amount ) : int

Converts an amount in primary store currency to reward points

ConvertRewardPointsToAmount ( int rewardPoints ) : decimal

Converts reward points to amount primary store currency

GetOrderSubtotalDiscount ( Customer customer, decimal orderSubTotal, Discount &appliedDiscount ) : decimal

Gets an order discount (applied to order subtotal)

GetOrderTotalDiscount ( Customer customer, decimal orderTotal, Discount &appliedDiscount ) : decimal

Gets an order discount (applied to order total)

GetShippingDiscount ( Customer customer, decimal shippingTotal, Discount &appliedDiscount ) : decimal

Gets a shipping discount

GetShoppingCartAdditionalShippingCharge ( IList cart ) : decimal

Gets shopping cart additional shipping charge

GetShoppingCartShippingTotal ( IList cart ) : decimal?

Gets shopping cart shipping total

GetShoppingCartShippingTotal ( IList cart, bool includingTax ) : decimal?

Gets shopping cart shipping total

GetShoppingCartShippingTotal ( IList cart, bool includingTax, decimal &taxRate ) : decimal?

Gets shopping cart shipping total

GetShoppingCartShippingTotal ( IList cart, bool includingTax, decimal &taxRate, Discount &appliedDiscount ) : decimal?

Gets shopping cart shipping total

GetShoppingCartSubTotal ( IList cart, bool includingTax, decimal &discountAmount, Discount &appliedDiscount, decimal &subTotalWithoutDiscount, decimal &subTotalWithDiscount ) : void

Gets shopping cart subtotal

GetShoppingCartSubTotal ( IList cart, bool includingTax, decimal &discountAmount, Discount &appliedDiscount, decimal &subTotalWithoutDiscount, decimal &subTotalWithDiscount, decimal>.SortedDictionary &taxRates ) : void

Gets shopping cart subtotal

GetShoppingCartSubTotal ( IList cart, decimal &discountAmount, Discount &appliedDiscount, decimal &subTotalWithoutDiscount, decimal &subTotalWithDiscount ) : void

Gets shopping cart subtotal

GetShoppingCartTotal ( IList cart, bool ignoreRewardPonts = false, bool usePaymentMethodAdditionalFee = true ) : decimal?

Gets shopping cart total

GetShoppingCartTotal ( IList cart, decimal &discountAmount, Discount &appliedDiscount, List &appliedGiftCards, int &redeemedRewardPoints, decimal &redeemedRewardPointsAmount, bool ignoreRewardPonts = false, bool usePaymentMethodAdditionalFee = true ) : decimal?

Gets shopping cart total

GetTaxTotal ( IList cart, decimal>.SortedDictionary &taxRates, bool usePaymentMethodAdditionalFee = true ) : decimal

Gets tax

GetTaxTotal ( IList cart, bool usePaymentMethodAdditionalFee = true ) : decimal

Gets tax

IsFreeShipping ( IList cart ) : bool

Gets a value indicating whether shipping is free

OrderTotalCalculationService ( IWorkContext workContext, IPriceCalculationService priceCalculationService, ITaxService taxService, IShippingService shippingService, IPaymentService paymentService, ICheckoutAttributeParser checkoutAttributeParser, IDiscountService discountService, IGiftCardService giftCardService, IGenericAttributeService genericAttributeService, Nop.Core.Domain.Tax.TaxSettings taxSettings, Nop.Core.Domain.Customers.RewardPointsSettings rewardPointsSettings, Nop.Core.Domain.Shipping.ShippingSettings shippingSettings, Nop.Core.Domain.Orders.ShoppingCartSettings shoppingCartSettings, Nop.Core.Domain.Catalog.CatalogSettings catalogSettings ) : System

Ctor

Method Details

AdjustShippingRate() public method

Adjust shipping rate (free shipping, additional charges, discounts)
public AdjustShippingRate ( decimal shippingRate, IList cart, Discount &appliedDiscount ) : decimal
shippingRate decimal Shipping rate to adjust
cart IList Cart
appliedDiscount Nop.Core.Domain.Discounts.Discount Applied discount
return decimal

ConvertAmountToRewardPoints() public method

Converts an amount in primary store currency to reward points
public ConvertAmountToRewardPoints ( decimal amount ) : int
amount decimal Amount
return int

ConvertRewardPointsToAmount() public method

Converts reward points to amount primary store currency
public ConvertRewardPointsToAmount ( int rewardPoints ) : decimal
rewardPoints int Reward points
return decimal

GetOrderSubtotalDiscount() public method

Gets an order discount (applied to order subtotal)
public GetOrderSubtotalDiscount ( Customer customer, decimal orderSubTotal, Discount &appliedDiscount ) : decimal
customer Nop.Core.Domain.Customers.Customer Customer
orderSubTotal decimal Order subtotal
appliedDiscount Nop.Core.Domain.Discounts.Discount Applied discount
return decimal

GetOrderTotalDiscount() public method

Gets an order discount (applied to order total)
public GetOrderTotalDiscount ( Customer customer, decimal orderTotal, Discount &appliedDiscount ) : decimal
customer Nop.Core.Domain.Customers.Customer Customer
orderTotal decimal Order total
appliedDiscount Nop.Core.Domain.Discounts.Discount Applied discount
return decimal

GetShippingDiscount() public method

Gets a shipping discount
public GetShippingDiscount ( Customer customer, decimal shippingTotal, Discount &appliedDiscount ) : decimal
customer Nop.Core.Domain.Customers.Customer Customer
shippingTotal decimal Shipping total
appliedDiscount Nop.Core.Domain.Discounts.Discount Applied discount
return decimal

GetShoppingCartAdditionalShippingCharge() public method

Gets shopping cart additional shipping charge
public GetShoppingCartAdditionalShippingCharge ( IList cart ) : decimal
cart IList Cart
return decimal

GetShoppingCartShippingTotal() public method

Gets shopping cart shipping total
public GetShoppingCartShippingTotal ( IList cart ) : decimal?
cart IList Cart
return decimal?

GetShoppingCartShippingTotal() public method

Gets shopping cart shipping total
public GetShoppingCartShippingTotal ( IList cart, bool includingTax ) : decimal?
cart IList Cart
includingTax bool A value indicating whether calculated price should include tax
return decimal?

GetShoppingCartShippingTotal() public method

Gets shopping cart shipping total
public GetShoppingCartShippingTotal ( IList cart, bool includingTax, decimal &taxRate ) : decimal?
cart IList Cart
includingTax bool A value indicating whether calculated price should include tax
taxRate decimal Applied tax rate
return decimal?

GetShoppingCartShippingTotal() public method

Gets shopping cart shipping total
public GetShoppingCartShippingTotal ( IList cart, bool includingTax, decimal &taxRate, Discount &appliedDiscount ) : decimal?
cart IList Cart
includingTax bool A value indicating whether calculated price should include tax
taxRate decimal Applied tax rate
appliedDiscount Nop.Core.Domain.Discounts.Discount Applied discount
return decimal?

GetShoppingCartSubTotal() public method

Gets shopping cart subtotal
public GetShoppingCartSubTotal ( IList cart, bool includingTax, decimal &discountAmount, Discount &appliedDiscount, decimal &subTotalWithoutDiscount, decimal &subTotalWithDiscount ) : void
cart IList Cart
includingTax bool A value indicating whether calculated price should include tax
discountAmount decimal Applied discount amount
appliedDiscount Nop.Core.Domain.Discounts.Discount Applied discount
subTotalWithoutDiscount decimal Sub total (without discount)
subTotalWithDiscount decimal Sub total (with discount)
return void

GetShoppingCartSubTotal() public method

Gets shopping cart subtotal
public GetShoppingCartSubTotal ( IList cart, bool includingTax, decimal &discountAmount, Discount &appliedDiscount, decimal &subTotalWithoutDiscount, decimal &subTotalWithDiscount, decimal>.SortedDictionary &taxRates ) : void
cart IList Cart
includingTax bool A value indicating whether calculated price should include tax
discountAmount decimal Applied discount amount
appliedDiscount Nop.Core.Domain.Discounts.Discount Applied discount
subTotalWithoutDiscount decimal Sub total (without discount)
subTotalWithDiscount decimal Sub total (with discount)
taxRates decimal>.SortedDictionary Tax rates (of order sub total)
return void

GetShoppingCartSubTotal() public method

Gets shopping cart subtotal
public GetShoppingCartSubTotal ( IList cart, decimal &discountAmount, Discount &appliedDiscount, decimal &subTotalWithoutDiscount, decimal &subTotalWithDiscount ) : void
cart IList Cart
discountAmount decimal Applied discount amount
appliedDiscount Nop.Core.Domain.Discounts.Discount Applied discount
subTotalWithoutDiscount decimal Sub total (without discount)
subTotalWithDiscount decimal Sub total (with discount)
return void

GetShoppingCartTotal() public method

Gets shopping cart total
public GetShoppingCartTotal ( IList cart, bool ignoreRewardPonts = false, bool usePaymentMethodAdditionalFee = true ) : decimal?
cart IList Cart
ignoreRewardPonts bool A value indicating whether we should ignore reward points (if enabled and a customer is going to use them)
usePaymentMethodAdditionalFee bool A value indicating whether we should use payment method additional fee when calculating order total
return decimal?

GetShoppingCartTotal() public method

Gets shopping cart total
public GetShoppingCartTotal ( IList cart, decimal &discountAmount, Discount &appliedDiscount, List &appliedGiftCards, int &redeemedRewardPoints, decimal &redeemedRewardPointsAmount, bool ignoreRewardPonts = false, bool usePaymentMethodAdditionalFee = true ) : decimal?
cart IList Cart
discountAmount decimal Applied discount amount
appliedDiscount Nop.Core.Domain.Discounts.Discount Applied discount
appliedGiftCards List Applied gift cards
redeemedRewardPoints int Reward points to redeem
redeemedRewardPointsAmount decimal Reward points amount in primary store currency to redeem
ignoreRewardPonts bool A value indicating whether we should ignore reward points (if enabled and a customer is going to use them)
usePaymentMethodAdditionalFee bool A value indicating whether we should use payment method additional fee when calculating order total
return decimal?

GetTaxTotal() public method

Gets tax
public GetTaxTotal ( IList cart, decimal>.SortedDictionary &taxRates, bool usePaymentMethodAdditionalFee = true ) : decimal
cart IList Shopping cart
taxRates decimal>.SortedDictionary Tax rates
usePaymentMethodAdditionalFee bool A value indicating whether we should use payment method additional fee when calculating tax
return decimal

GetTaxTotal() public method

Gets tax
public GetTaxTotal ( IList cart, bool usePaymentMethodAdditionalFee = true ) : decimal
cart IList Shopping cart
usePaymentMethodAdditionalFee bool A value indicating whether we should use payment method additional fee when calculating tax
return decimal

IsFreeShipping() public method

Gets a value indicating whether shipping is free
public IsFreeShipping ( IList cart ) : bool
cart IList Cart
return bool

OrderTotalCalculationService() public method

Ctor
public OrderTotalCalculationService ( IWorkContext workContext, IPriceCalculationService priceCalculationService, ITaxService taxService, IShippingService shippingService, IPaymentService paymentService, ICheckoutAttributeParser checkoutAttributeParser, IDiscountService discountService, IGiftCardService giftCardService, IGenericAttributeService genericAttributeService, Nop.Core.Domain.Tax.TaxSettings taxSettings, Nop.Core.Domain.Customers.RewardPointsSettings rewardPointsSettings, Nop.Core.Domain.Shipping.ShippingSettings shippingSettings, Nop.Core.Domain.Orders.ShoppingCartSettings shoppingCartSettings, Nop.Core.Domain.Catalog.CatalogSettings catalogSettings ) : System
workContext IWorkContext Work context
priceCalculationService IPriceCalculationService Price calculation service
taxService ITaxService Tax service
shippingService IShippingService Shipping service
paymentService IPaymentService Payment service
checkoutAttributeParser ICheckoutAttributeParser Checkout attribute parser
discountService IDiscountService Discount service
giftCardService IGiftCardService Gift card service
genericAttributeService IGenericAttributeService Generic attribute service
taxSettings Nop.Core.Domain.Tax.TaxSettings Tax settings
rewardPointsSettings Nop.Core.Domain.Customers.RewardPointsSettings Reward points settings
shippingSettings Nop.Core.Domain.Shipping.ShippingSettings Shipping settings
shoppingCartSettings Nop.Core.Domain.Orders.ShoppingCartSettings Shopping cart settings
catalogSettings Nop.Core.Domain.Catalog.CatalogSettings Catalog settings
return System