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 Type
    Method
    Description
    javax.money.MonetaryAmount
    calculateCartFeesTotal(com.broadleafcommerce.cart.client.domain.Cart cart)
    Calculates CartPricing.getFeesTotal().
    javax.money.MonetaryAmount
    calculateCartSubtotal(com.broadleafcommerce.cart.client.domain.Cart cart)
    Calculates CartPricing.getSubtotal().
    javax.money.MonetaryAmount
    calculateCartTotalAfterTax(com.broadleafcommerce.cart.client.domain.CartPricing cartPricing)
    Calculates the CartPricing.getTotal() including tax.
    javax.money.MonetaryAmount
    calculateCartTotalBeforeTax(com.broadleafcommerce.cart.client.domain.CartPricing cartPricing)
    Calculates the CartPricing.getTotal() without tax.
    javax.money.MonetaryAmount
    calculateFulfillmentTotal(com.broadleafcommerce.cart.client.domain.Cart cart)
    Calculates CartPricing.getFulfillmentTotal().
  • Method Details

    • calculateCartSubtotal

      javax.money.MonetaryAmount calculateCartSubtotal(com.broadleafcommerce.cart.client.domain.Cart cart)
      Calculates CartPricing.getSubtotal(). This will also calculate and set CartItem.getAdjustmentsTotal() and CartItem.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)
      Calculates CartPricing.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)
      Calculates CartPricing.getFulfillmentTotal(). This will also calculate and set the totals for FulfillmentGroups and FulfillmentItems.
      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 the CartPricing.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 the CartPricing.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