Subversion Repositories SmartDukaan

Rev

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

Rev 5838 Rev 6152
Line 148... Line 148...
148
		
148
		
149
		htmlString = getHtmlFromVelocity(templateFile, context);
149
		htmlString = getHtmlFromVelocity(templateFile, context);
150
		return htmlString;
150
		return htmlString;
151
	}
151
	}
152
	
152
	
153
	public String getHeaderHtml(boolean isLoggedIn, String email, String url, long catId, boolean displayBestDealsImg)	{
153
	public String getHeaderHtml(boolean isLoggedIn, String email, int totalItems, String url, long catId, boolean displayBestDealsImg)	{
154
		VelocityContext context = new VelocityContext();
154
		VelocityContext context = new VelocityContext();
155
		
155
		
156
		if (isLoggedIn)	{
156
		if (isLoggedIn)	{
157
			context.put("LOGGED_IN", "TRUE");
157
			context.put("LOGGED_IN", "TRUE");
158
			context.put("WELCOME_MESSAGE", "Hi " + email.split("@")[0]);
158
			context.put("WELCOME_MESSAGE", "Hi " + email.split("@")[0]);
Line 162... Line 162...
162
			context.put("REDIRECT_URL", url);
162
			context.put("REDIRECT_URL", url);
163
		}
163
		}
164
		
164
		
165
		context.put("BEST_DEALS_BADGE", displayBestDealsImg);
165
		context.put("BEST_DEALS_BADGE", displayBestDealsImg);
166
		context.put("CAT_ID", catId);
166
		context.put("CAT_ID", catId);
167
		
-
 
-
 
167
		context.put("TOTAL_ITEMS", totalItems);
168
		String templateFile = "templates/header.vm";
168
		String templateFile = "templates/header.vm";
169
		
169
		
170
		return getHtmlFromVelocity(templateFile, context);
170
		return getHtmlFromVelocity(templateFile, context);
171
	}
171
	}
172
 
172
 
Line 429... Line 429...
429
 
429
 
430
	public String getCartWidgetSnippet(int totalItems, double totalAmount) {
430
	public String getCartWidgetSnippet(int totalItems, double totalAmount) {
431
		String htmlString = "";
431
		String htmlString = "";
432
		VelocityContext context = new VelocityContext();
432
		VelocityContext context = new VelocityContext();
433
		String templateFile = "templates/cartwidget.vm";
433
		String templateFile = "templates/cartwidget.vm";
434
		FormattingUtils formattingUtils = new FormattingUtils(0);
-
 
435
		context.put("itemCount", totalItems);
-
 
436
		context.put("totalAmount", formattingUtils.formatPrice(totalAmount));
-
 
437
		
-
 
438
		htmlString = getHtmlFromVelocity(templateFile, context);
434
		htmlString = getHtmlFromVelocity(templateFile, context);
439
		return htmlString;
435
		return htmlString;
440
	}
436
	}
441
 
437
 
442
}
438
}