public static String removeOrderTerm(HttpServletRequest request,HttpServletResponse response){
  ShoppingCart cart=getCartObject(request);
  String termIndexStr=request.getParameter("termIndex");
  if (UtilValidate.isNotEmpty(termIndexStr)) {
    try {
      Integer termIndex=Integer.parseInt(termIndexStr);
      if (termIndex >= 0) {
        List<GenericValue> orderTerms=cart.getOrderTerms();
        if (orderTerms != null && orderTerms.size() > termIndex) {
          cart.removeOrderTerm(termIndex);
        }
      }
    }
 catch (    NumberFormatException e) {
      Debug.logWarning(e,"Error parsing termIndex: " + termIndexStr,module);
    }
  }
  return "success";
}

public static String removeOrderTerm ( HttpServletRequest request , HttpServletResponse response ) { ShoppingCart cart = getCartObject ( request ) ; String termIndexStr = request . getParameter ( "termIndex" ) ; if ( UtilValidate . isNotEmpty ( termIndexStr ) ) { try { Integer termIndex = Integer . parseInt ( termIndexStr ) ; if ( termIndex >= 0 ) { List < GenericValue > orderTerms = cart . getOrderTerms ( ) ; if ( orderTerms != null && orderTerms . size ( ) > termIndex ) { cart . removeOrderTerm ( termIndex ) ; } } } catch ( NumberFormatException e ) { Debug . logWarning ( e , "Error parsing termIndex: " + termIndexStr , module ) ; } } return "success" ; }
remove an order term
