Subversion Repositories SmartDukaan

Rev

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

Rev 3224 Rev 3561
Line 72... Line 72...
72
			    defaultAddressId = userClient.getDefaultAddressId(userId);
72
			    defaultAddressId = userClient.getDefaultAddressId(userId);
73
			}
73
			}
74
			log.info("The default address id of this user is: " + defaultAddressId);
74
			log.info("The default address id of this user is: " + defaultAddressId);
75
			if(defaultAddressId > 0)
75
			if(defaultAddressId > 0)
76
				userClient.addAddressToCart(cartId, defaultAddressId);
76
				userClient.addAddressToCart(cartId, defaultAddressId);
77
			errorMsg = userClient.validateCart(cartId);
77
			errorMsg = userClient.validateCart(cartId, sourceId);
78
			
78
			
79
		} catch (Exception e) {
79
		} catch (Exception e) {
80
			// This exception can be ignored for showing the shipping page. Not so
80
			// This exception can be ignored for showing the shipping page. Not so
81
			// innocent when this occurs at the time of checkout or when the
81
			// innocent when this occurs at the time of checkout or when the
82
			// user is proceeding to pay.
82
			// user is proceeding to pay.
Line 156... Line 156...
156
				
156
				
157
				if(action.equals("change"))	{
157
				if(action.equals("change"))	{
158
					addressId = Long.parseLong(this.request.getParameter("addressid"));
158
					addressId = Long.parseLong(this.request.getParameter("addressid"));
159
					userClient.addAddressToCart(userinfo.getCartId(), addressId);
159
					userClient.addAddressToCart(userinfo.getCartId(), addressId);
160
					
160
					
161
					errorMsg = userClient.validateCart(userinfo.getCartId());
161
					errorMsg = userClient.validateCart(userinfo.getCartId(), sourceId);
162
                    DataLogger.logData(EventType.SHIPPINIG_ADD_CHANGE, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
162
                    DataLogger.logData(EventType.SHIPPINIG_ADD_CHANGE, getSessionId(), userinfo.getUserId(), userinfo.getEmail(),
163
                            Long.toString(userinfo.getCartId()), Long.toString(addressId));
163
                            Long.toString(userinfo.getCartId()), Long.toString(addressId));
164
					return "index";
164
					return "index";
165
				}
165
				}
166
			}
166
			}
Line 211... Line 211...
211
			if( ! lineItems.isEmpty())	{
211
			if( ! lineItems.isEmpty())	{
212
				items = new ArrayList<Map<String,String>>();
212
				items = new ArrayList<Map<String,String>>();
213
				
213
				
214
				for (Line line : lineItems) {
214
				for (Line line : lineItems) {
215
					Map<String, String> itemdetail = new HashMap<String, String>();
215
					Map<String, String> itemdetail = new HashMap<String, String>();
216
					Item item = catalogClient.getItem(line.getItemId());
216
					Item item = catalogClient.getItemForSource(line.getItemId(), sourceId);
217
					String itemName = ((item.getBrand() != null) ? item.getBrand() + " " : "")
217
					String itemName = ((item.getBrand() != null) ? item.getBrand() + " " : "")
218
										+ ((item.getModelName() != null) ? item.getModelName() + " " : "") 
218
										+ ((item.getModelName() != null) ? item.getModelName() + " " : "") 
219
										+ (( item.getModelNumber() != null ) ? item.getModelNumber() + " " : "" )
219
										+ (( item.getModelNumber() != null ) ? item.getModelNumber() + " " : "" )
220
										+ (( (item.getColor() != null && !item.getColor().trim().equals("NA"))) ? "("+item.getColor()+")" : "" );
220
										+ (( (item.getColor() != null && !item.getColor().trim().equals("NA"))) ? "("+item.getColor()+")" : "" );
221
					
221