Subversion Repositories SmartDukaan

Rev

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

Rev 4217 Rev 4453
Line 187... Line 187...
187
		String templateFile = "templates/shippingdetails.vm";
187
		String templateFile = "templates/shippingdetails.vm";
188
		List<Map<String,String>> items = null;
188
		List<Map<String,String>> items = null;
189
		double totalamount= 0.0;
189
		double totalamount= 0.0;
190
		List<Address> addresses = null;
190
		List<Address> addresses = null;
191
		long defaultAddressId = 0;
191
		long defaultAddressId = 0;
192
		String fullName = "";
-
 
193
		String phoneNumber = "";
192
		String phoneNumber = "";
194
 
193
 
195
		CatalogClient catalogServiceClient  = null;
194
		CatalogClient catalogServiceClient  = null;
196
		in.shop2020.model.v1.catalog.InventoryService.Client catalogClient = null;
195
		in.shop2020.model.v1.catalog.InventoryService.Client catalogClient = null;
197
		UserClient userContextServiceClient = null;
196
		UserClient userContextServiceClient = null;
Line 236... Line 235...
236
				}
235
				}
237
			}
236
			}
238
			totalamount = cart.getTotalPrice();
237
			totalamount = cart.getTotalPrice();
239
			addresses = userClient.getAllAddressesForUser(cart.getUserId());
238
			addresses = userClient.getAllAddressesForUser(cart.getUserId());
240
			User user = userClient.getUserById(cart.getUserId());
239
			User user = userClient.getUserById(cart.getUserId());
241
			
-
 
242
			fullName = user.getName();
-
 
243
			phoneNumber = user.getMobileNumber();
240
			phoneNumber = user.getMobileNumber();
244
 
241
 
245
			if(cart.isSetAddressId())	{
242
			if(cart.isSetAddressId())	{
246
				defaultAddressId = cart.getAddressId();
243
				defaultAddressId = cart.getAddressId();
247
			} else	{
244
			} else	{
Line 253... Line 250...
253
	        context.put("discountedamount", formattingUtils.formatPrice(cart.getDiscountedPrice()));
250
	        context.put("discountedamount", formattingUtils.formatPrice(cart.getDiscountedPrice()));
254
	        
251
	        
255
		} catch (Exception e)	{
252
		} catch (Exception e)	{
256
			log.error("Unable to get the shipping details", e);
253
			log.error("Unable to get the shipping details", e);
257
		}
254
		}
258
		System.out.println(fullName + " | " + phoneNumber);
-
 
259
        
255
        
260
		context.put("fullname", fullName);
-
 
261
		context.put("phonenumber", phoneNumber);
256
		context.put("phonenumber", phoneNumber);
262
		
-
 
263
		context.put("items", items);
257
		context.put("items", items);
264
		context.put("totalamount", formattingUtils.formatPrice(totalamount));
258
		context.put("totalamount", formattingUtils.formatPrice(totalamount));
265
		context.put("addresses", addresses);
259
		context.put("addresses", addresses);
266
		context.put("defaultAddressId", defaultAddressId+"");
260
		context.put("defaultAddressId", defaultAddressId+"");
267
		context.put("errorMsg", errorMsg);
261
		context.put("errorMsg", errorMsg);
Line 348... Line 342...
348
			url = "";
342
			url = "";
349
		} else {
343
		} else {
350
			url = "?" + url;
344
			url = "?" + url;
351
		}
345
		}
352
		url = request.getRequestURI() + url;
346
		url = request.getRequestURI() + url;
353
		return pageLoader.getHeaderHtml(userinfo.isLoggedIn(), userinfo.getNameOfUser(), url , 0, false);
347
		return pageLoader.getHeaderHtml(userinfo.isLoggedIn(), userinfo.getEmail(), url , 0, false);
354
	}
348
	}
355
}
349
}
356
350