Interface CartTotalsCalculator
-
- All Known Implementing Classes:
DefaultCartTotalsCalculator
public interface CartTotalsCalculator
Service that assistsCartPricingService
in calculating price totals for the various members of aCart
.- Author:
- Nathan Moore (nathandmoore)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description javax.money.MonetaryAmount
calculateCartSubtotal(com.broadleafcommerce.cart.client.domain.Cart cart)
CalculatesCartPricing.getSubtotal()
.javax.money.MonetaryAmount
calculateCartTotalAfterTax(com.broadleafcommerce.cart.client.domain.CartPricing cartPricing)
Calculates theCartPricing.getTotal()
including tax.javax.money.MonetaryAmount
calculateCartTotalBeforeTax(com.broadleafcommerce.cart.client.domain.CartPricing cartPricing)
Calculates theCartPricing.getTotal()
without tax.javax.money.MonetaryAmount
calculateFulfillmentTotal(com.broadleafcommerce.cart.client.domain.Cart cart)
CalculatesCartPricing.getFulfillmentTotal()
.
-
-
-
Method Detail
-
calculateCartSubtotal
javax.money.MonetaryAmount calculateCartSubtotal(com.broadleafcommerce.cart.client.domain.Cart cart)
CalculatesCartPricing.getSubtotal()
. This will also calculate and setCartItem.getAdjustmentsTotal()
andCartItem.getTotal()
.- Parameters:
cart
- Cart for which to calculate a subtotal- Returns:
- Subtotal for the cart.
-
calculateFulfillmentTotal
javax.money.MonetaryAmount calculateFulfillmentTotal(com.broadleafcommerce.cart.client.domain.Cart cart)
CalculatesCartPricing.getFulfillmentTotal()
. This will also calculate and set the totals forFulfillmentGroups
andFulfillmentItems
.- Parameters:
cart
- Cart for which to calculate a subtotal- Returns:
- Fulfillment total for the cart
-
calculateCartTotalBeforeTax
javax.money.MonetaryAmount calculateCartTotalBeforeTax(com.broadleafcommerce.cart.client.domain.CartPricing cartPricing)
Calculates theCartPricing.getTotal()
without tax. This will include the subtotal, adjustments total, and fulfillment total.- Parameters:
cartPricing
- The pricing fields of a Cart to total.- Returns:
- The cart total before tax
-
calculateCartTotalAfterTax
javax.money.MonetaryAmount calculateCartTotalAfterTax(com.broadleafcommerce.cart.client.domain.CartPricing cartPricing)
Calculates theCartPricing.getTotal()
including tax. This will include the subtotal, adjustments total, total tax, and fulfillment total.- Parameters:
cartPricing
- The pricing fields of a Cart to total.- Returns:
- The cart total including tax
-
-