Subversion Repositories SmartDukaan

Rev

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

Rev 1567 Rev 1614
Line 9... Line 9...
9
 
9
 
10
	$("#zipcode").val($("#defaultpincode").val());
10
	$("#zipcode").val($("#defaultpincode").val());
11
 
11
 
12
    updateEstimate();
12
    updateEstimate();
13
    
13
    
-
 
14
    if($.cookie("uid")){
14
    load_history_widget();
15
    	load_history_widget(true);
-
 
16
    }else{
-
 
17
    	if($.Storage.get("historyitems")){
-
 
18
    		var prodid = $("#product_id").val();
-
 
19
    		var hisitems = $.Storage.get("historyitems");
-
 
20
    		if (hisitems.indexOf(prodid) < 0){
-
 
21
    			//alert("prodid is" + prodid);
-
 
22
    			$.Storage.set("historyitems",  hisitems + "-" + prodid);
-
 
23
    		}
-
 
24
    		
-
 
25
    	}else{
-
 
26
    		$.Storage.set("historyitems",  $("#product_id").val());
-
 
27
    	}
-
 
28
    	load_history_widget(false);
-
 
29
    }
15
	
30
	
16
	$("#addcart").click(function(){
31
	$("#addcart").click(function(){
17
		jQuery.ajax({
32
		jQuery.ajax({
18
			type: "POST",
33
			type: "POST",
19
			url: "../cart",
34
			url: "/addtocart",
20
			data: "productid=" + $("#item_id").val(),
35
			data: "productid=" + $("#item_id").val(),
21
			success: function(msg)	{
36
			success: function(msg)	{
22
				$("#cartItemCount").html((msg*1));
37
				$("#cartItemCount").html((msg*1));
23
				window.location = "/cart";
38
				window.location = "/cart";
24
			}
39
			}