Class CartItemUtil


public final class CartItemUtil extends CartOrderPromotionTransformation
  • Field Details

  • Method Details

    • updateOrderItem

      public static OrderItem updateOrderItem(SFItem sfItem, SFCart sfCart, List<Payment> nonCashPayments, List<Payment> cashPayments, Map<String,BigDecimal> paymentBalanceMap, String productPropertyToEarnRewards, Map<String,String> commonVar)
      This method is used to update an order item.
      Parameters:
      sfItem - Indicates a SFItem, contains the item details that can be placed in a cart
      sfCart - Indicates a SFCart, contains the entire cart of the customer
      nonCashPayments - Indicates the identifier of the payment in order to calculate the order shipping item
      cashPayments - Indicates the identifier of the payment in order to calculate the order shipping item
      commonVar - Contains binName and enableZeroCheckout
      paymentBalanceMap - Indicates a paymentBalanceMap
      productPropertyToEarnRewards - Indicates the product property for earn Loyalty.
      Returns:
      Returns a OrderItem, contains the order item details
    • setItemOtherCharges

      public static void setItemOtherCharges(SFItem sfItem, OrderItem orderItem)
      This method is used to set item other charges
      Parameters:
      sfItem - sfItem
      orderItem - orderItem
    • setItemPriceFacets

      public static void setItemPriceFacets(SFItem sfItem, SFCart sfCart, OrderItem orderItem)
      This method is used to set item price facets
      Parameters:
      sfItem - sfItem
      sfCart - sfCart
      orderItem - orderItem
    • setLoyaltyDetails

      public static void setLoyaltyDetails(SFItem sfItem, OrderItem orderItem)
      This method is used to set loyalty details
      Parameters:
      sfItem - sfItem
      orderItem - orderItem
    • updateOrderItemMathTaxDetails

      public static void updateOrderItemMathTaxDetails(SFItem sfItem, Math orderItemMath)
      Used to update the tax details in the order item
      Parameters:
      sfCart - contains the item details that can be placed in a cart
      orderItemMath - refers to the order item
    • getNegatedDiscountValues

      public static Map<String,Object> getNegatedDiscountValues(String keyFacet, Map<String,Object> value)
      Parameters:
      keyFacet - Indicates a string value for keyFacet
      value - Indicates the map of the discount values for the items
      Returns:
      Returns the corresponding map of negated discount values for the items
    • isLastItemForNonCashPayment

      public static Boolean isLastItemForNonCashPayment(SFCart sfCart, SFItem sfItem)
      This method is used to check if the item is last item in the list for loyalty payment
      Parameters:
      sfCart - Indicates a SFCart, contains the entire cart of the customer
      sfItem - Indicates a SFItem, contains the item details that can be placed in a cart
      Returns:
      the corresponding Boolean value
    • checkItemForNonCashPayment

      public static Boolean checkItemForNonCashPayment(SFItem sfItem)
      This method is used to check if a product is eligible for Non Cash payment or not
      Parameters:
      sfItem - refers to Cart product
      Returns:
      toRet
    • getTotalPriceForEligibleItems

      public static BigDecimal getTotalPriceForEligibleItems(SFCart sfCart)
      This method is used to get sum of price of all eligible items for redemption
      Parameters:
      sfCart - Indicates a SFCart, contains the entire cart of the customer
      Returns:
      the corresponding BigDecimal value