protected Total applyTaxToCartItemsAndCalculateItemTotal(final MutableShoppingCart cart){
  final ShoppingContext ctx=cart.getShoppingContext();
  final String currency=cart.getCurrencyCode();
  final CartItemPrices prices=new CartItemPrices();
  final List<CartItem> items=cart.getCartItemList();
  if (items != null) {
    for (    final CartItem item : cart.getCartItemList()) {
      if (!item.isGift() && !MoneyUtils.isFirstBiggerThanOrEqualToSecond(BigDecimal.ZERO,item.getQty()) && item.getPrice() != null) {
        final TaxProvider.Tax tax=taxProvider.determineTax(ctx.getShopCode(),currency,ctx.getCountryCode(),ctx.getStateCode(),item.getProductSkuCode());
        final BigDecimal price=item.getPrice();
        final MoneyUtils.Money money=calculateMoney(price,tax.getRate(),!tax.isExcluded());
        final BigDecimal netPrice=money.getNet();
        final BigDecimal grossPrice=money.getGross();
        cart.setProductSkuTax(item.getProductSkuCode(),netPrice,grossPrice,tax.getRate(),tax.getCode(),tax.isExcluded());
      }
      prices.add(new CartItemPrices(item));
    }
  }
  return new TotalImpl(prices.listPrice,prices.salePrice,prices.nonSalePrice,prices.finalPrice,false,null,prices.finalPrice,prices.finalTax,prices.grossFinalPrice,Total.ZERO,Total.ZERO,false,null,Total.ZERO,Total.ZERO,prices.finalPrice,prices.finalTax,prices.grossListPrice,prices.grossFinalPrice);
}

protected Total applyTaxToCartItemsAndCalculateItemTotal ( final MutableShoppingCart cart ) { final ShoppingContext ctx = cart . getShoppingContext ( ) ; final String currency = cart . getCurrencyCode ( ) ; final CartItemPrices prices = new CartItemPrices ( ) ; final List < CartItem > items = cart . getCartItemList ( ) ; if ( items != null ) { for ( final CartItem item : cart . getCartItemList ( ) ) { if ( ! item . isGift ( ) && ! MoneyUtils . isFirstBiggerThanOrEqualToSecond ( BigDecimal . ZERO , item . getQty ( ) ) && item . getPrice ( ) != null ) { final TaxProvider . Tax tax = taxProvider . determineTax ( ctx . getShopCode ( ) , currency , ctx . getCountryCode ( ) , ctx . getStateCode ( ) , item . getProductSkuCode ( ) ) ; final BigDecimal price = item . getPrice ( ) ; final MoneyUtils . Money money = calculateMoney ( price , tax . getRate ( ) , ! tax . isExcluded ( ) ) ; final BigDecimal netPrice = money . getNet ( ) ; final BigDecimal grossPrice = money . getGross ( ) ; cart . setProductSkuTax ( item . getProductSkuCode ( ) , netPrice , grossPrice , tax . getRate ( ) , tax . getCode ( ) , tax . isExcluded ( ) ) ; } prices . add ( new CartItemPrices ( item ) ) ; } } return new TotalImpl ( prices . listPrice , prices . salePrice , prices . nonSalePrice , prices . finalPrice , false , null , prices . finalPrice , prices . finalTax , prices . grossFinalPrice , Total . ZERO , Total . ZERO , false , null , Total . ZERO , Total . ZERO , prices . finalPrice , prices . finalTax , prices . grossListPrice , prices . grossFinalPrice ) ; }
calculate sub total of cart items .
