Interface CartTotalsCalculator
- All Known Implementing Classes:
DefaultCartTotalsCalculator
public interface CartTotalsCalculator
Service that assists
CartPricingService
in calculating price totals for the various
members of a Cart
.- Author:
- Nathan Moore (nathandmoore)
-
Method Summary
Modifier and TypeMethodDescriptionjavax.money.MonetaryAmount
calculateCartFeesTotal
(com.broadleafcommerce.cart.client.domain.Cart cart) CalculatesCartPricing.getFeesTotal()
.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 Details
-
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.
-
calculateCartFeesTotal
javax.money.MonetaryAmount calculateCartFeesTotal(com.broadleafcommerce.cart.client.domain.Cart cart) CalculatesCartPricing.getFeesTotal()
.- Parameters:
cart
- Cart for which to calculate a fees total- Returns:
- Fees total 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
-