Subversion Repositories SmartDukaan

Rev

Rev 17942 | Rev 17945 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17942 Rev 17943
Line 443... Line 443...
443
				List<ItemQuantity> itemQuantities = new ArrayList<ItemQuantity>();
443
				List<ItemQuantity> itemQuantities = new ArrayList<ItemQuantity>();
444
				JSONArray cartItems = jsonObj.getJSONArray("cartItems");
444
				JSONArray cartItems = jsonObj.getJSONArray("cartItems");
445
				List<Integer> itemsList = new ArrayList<Integer>();
445
				List<Integer> itemsList = new ArrayList<Integer>();
446
				for (int i=0; i< cartItems.length(); i++) {
446
				for (int i=0; i< cartItems.length(); i++) {
447
					JSONObject obj = cartItems.getJSONObject(i);
447
					JSONObject obj = cartItems.getJSONObject(i);
448
					//Just to avoid garage values
448
					//Just to avoid garbage values
449
					int itemId = 0;
449
					int itemId = 0;
450
					try{
450
					try{
451
						itemId = obj.getInt("itemId");
451
						itemId = obj.getInt("itemId");
452
					} catch(Exception e){
452
					} catch(Exception e){
453
						continue;
453
						continue;
Line 509... Line 509...
509
					ArrayList<JSONObject> listdata = new ArrayList<JSONObject>();     
509
					ArrayList<JSONObject> listdata = new ArrayList<JSONObject>();     
510
					if (arr != null) { 
510
					if (arr != null) { 
511
					   for (int i=0;i<arr.length();i++){
511
					   for (int i=0;i<arr.length();i++){
512
						   JSONArray itemMessages = arr.getJSONObject(i).optJSONArray(("cartItemMessages"));
512
						   JSONArray itemMessages = arr.getJSONObject(i).optJSONArray(("cartItemMessages"));
513
						   if(itemMessages!=null && itemMessages.length()>0){
513
						   if(itemMessages!=null && itemMessages.length()>0){
514
							   listdata.add(arr.getJSONObject(i));
-
 
515
						   } else {
-
 
516
							   listdata.add(0,arr.getJSONObject(i));
514
							   listdata.add(0,arr.getJSONObject(i));
-
 
515
						   } else {
-
 
516
							   listdata.add(arr.getJSONObject(i));
517
						   }
517
						   }
518
					   } 
518
					   } 
519
					}
519
					}
520
					arr = new JSONArray();
520
					arr = new JSONArray();
521
					for(int i=0;i<listdata.size();i++){
521
					for(int i=0;i<listdata.size();i++){