Subversion Repositories SmartDukaan

Rev

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

Rev 4453 Rev 5228
Line 1... Line 1...
1
package in.shop2020.serving.controllers;
1
package in.shop2020.serving.controllers;
2
 
2
 
3
import in.shop2020.datalogger.EventType;
3
import in.shop2020.datalogger.EventType;
-
 
4
import in.shop2020.model.v1.catalog.InventoryService.Client;
4
import in.shop2020.model.v1.catalog.Item;
5
import in.shop2020.model.v1.catalog.Item;
5
import in.shop2020.model.v1.user.Cart;
6
import in.shop2020.model.v1.user.Cart;
6
import in.shop2020.model.v1.user.Line;
7
import in.shop2020.model.v1.user.Line;
7
import in.shop2020.model.v1.user.ShoppingCartException;
8
import in.shop2020.model.v1.user.ShoppingCartException;
8
import in.shop2020.model.v1.user.UserContextService;
9
import in.shop2020.model.v1.user.UserContextService;
Line 395... Line 396...
395
	}
396
	}
396
	
397
	
397
	public int getVariationId()	{
398
	public int getVariationId()	{
398
		return this.variationId;
399
		return this.variationId;
399
	}
400
	}
400
}
-
 
401
401
	
-
 
402
	public String getActionMessage(){
-
 
403
		if(cartMsg.contains("out of stock")){
-
 
404
			return "Notify me when this product is in stock.";
-
 
405
		}else {
-
 
406
			return "Notify me when this product is available.";
-
 
407
		}
-
 
408
	}
-
 
409
	
-
 
410
	public String getOfferNote(){
-
 
411
		String note = null;
-
 
412
		if(cartMsg.contains("out of stock")){
-
 
413
			return note;
-
 
414
		}
-
 
415
		else {
-
 
416
			try {
-
 
417
	            CatalogClient catalogServiceClient = new CatalogClient();
-
 
418
	            Client catalogClient = catalogServiceClient.getClient();
-
 
419
	            Item it = catalogClient.getItem(itemId);
-
 
420
	            note = it.getBestDealText();
-
 
421
			} catch (Exception e)  {
-
 
422
				log.error("Unable to get the offertext because of: ", e);
-
 
423
			}
-
 
424
		}
-
 
425
		return note;
-
 
426
	}
-
 
427
}
-
 
428