Subversion Repositories SmartDukaan

Rev

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

Rev 5076 Rev 5326
Line 182... Line 182...
182
		htmlString = pageLoader.getHtmlFromVelocity(templateFile, context);
182
		htmlString = pageLoader.getHtmlFromVelocity(templateFile, context);
183
		return htmlString;
183
		return htmlString;
184
	}
184
	}
185
	
185
	
186
	public String getShippingDetailsSnippet() {
186
	public String getShippingDetailsSnippet() {
187
 
-
 
-
 
187
		long userId = userinfo.getUserId();
188
		long cartId = userinfo.getCartId();
188
		long cartId = userinfo.getCartId();
189
		String htmlString = "";
189
		String htmlString = "";
190
		VelocityContext context = new VelocityContext();
190
		VelocityContext context = new VelocityContext();
191
		String templateFile = "templates/shippingdetails.vm";
191
		String templateFile = "templates/shippingdetails.vm";
192
		List<Map<String,String>> items = null;
192
		List<Map<String,String>> items = null;
Line 237... Line 237...
237
					itemdetail.put("BEST_DEAL_TEXT", item.getBestDealText());
237
					itemdetail.put("BEST_DEAL_TEXT", item.getBestDealText());
238
					items.add(itemdetail);
238
					items.add(itemdetail);
239
				}
239
				}
240
			}
240
			}
241
			totalamount = cart.getTotalPrice();
241
			totalamount = cart.getTotalPrice();
242
			addresses = userClient.getAllAddressesForUser(cart.getUserId());
242
			addresses = userClient.getAllAddressesForUser(userId);
243
			User user = userClient.getUserById(cart.getUserId());
243
			User user = userClient.getUserById(userId);
244
			phoneNumber = user.getMobileNumber();
244
			phoneNumber = user.getMobileNumber();
245
 
245
 
246
			if(cart.isSetAddressId())	{
246
			if(cart.isSetAddressId())	{
247
				defaultAddressId = cart.getAddressId();
247
				defaultAddressId = cart.getAddressId();
248
			} else	{
248
			} else	{
249
				defaultAddressId = userClient.getDefaultAddressId(cart.getUserId());
249
				defaultAddressId = userClient.getDefaultAddressId(userId);
250
			}
250
			}
251
	        
251
	        
252
			String couponCode = cart.getCouponCode();
252
			String couponCode = cart.getCouponCode();
253
	        context.put("couponcode", couponCode == null ? "" : couponCode);
253
	        context.put("couponcode", couponCode == null ? "" : couponCode);
254
	        context.put("discountedamount", formattingUtils.formatPrice(cart.getDiscountedPrice()));
254
	        context.put("discountedamount", formattingUtils.formatPrice(cart.getDiscountedPrice()));