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 116... Line 116...
116
          
116
          
117
          var seldata=refdivid;
117
          var seldata=refdivid;
118
          var tot=1;
118
          var tot=1;
119
     }
119
     }
120
     
120
     
-
 
121
/*
-
 
122
     var historyitems = "";
-
 
123
     if($.Storage.get("historyitems")){
-
 
124
    	 historyitems = "&historyitems=" +  $.Storage.get("historyitems");
-
 
125
    	 $.Storage.remove("historyitems");
-
 
126
     }
-
 
127
     +historyitems
-
 
128
     */
-
 
129
     
121
     if(tot>0){
130
     if(tot>0){
122
          //alert("AJAX request to add products in My research. Product ID: "+seldata+" and total: "+tot);
131
          //alert("AJAX request to add products in My research. Product ID: "+seldata+" and total: "+tot);
123
          jQuery.ajax({
132
          jQuery.ajax({
124
               type: "POST",
133
               type: "POST",
125
                      url: "/myresearch",
134
                      url: "/addtoresearch",
126
                      data: "productid="+seldata,
135
                      data: "productid="+seldata,
127
                      success: function(msg){
136
                      success: function(msg){
128
                           
137
                           
129
                           if(msg == 0){
138
                           if(msg == 0){
130
                                alert( "Please register/signin to use myresearch tool" );
139
                                alert( "Please register/signin to use myresearch tool" );
Line 206... Line 215...
206
          tot=1;
215
          tot=1;
207
     }else if(reqtype == "list"){
216
     }else if(reqtype == "list"){
208
    	  var seldata=refdivid;
217
    	  var seldata=refdivid;
209
          var tot=1;
218
          var tot=1;
210
     }
219
     }
-
 
220
     /*
-
 
221
     var historyitems = "";
-
 
222
     if($.Storage.get("historyitems")){
-
 
223
    	 historyitems = "&historyitems=" +  $.Storage.get("historyitems");
-
 
224
    	 $.Storage.remove("historyitems");
-
 
225
     }
-
 
226
     +historyitems
-
 
227
     */
211
     
228
     
212
     if(tot>0){
229
     if(tot>0){
213
          //alert("AJAX request to add products in Cart. Product ID: "+seldata+" and total: "+tot); 
230
          //alert("AJAX request to add products in Cart. Product ID: "+seldata+" and total: "+tot); 
214
          jQuery.ajax({
231
          jQuery.ajax({
215
               type: "POST",
232
               type: "POST",
216
                      url: "/cart",
233
                      url: "/addtocart",
217
                      data: "productid="+seldata,
234
                      data: "productid="+seldata,
218
                      success: function(msg){
235
                      success: function(msg){
219
                           $("#cartItemCount").html(msg*1);
236
                           $("#cartItemCount").html(msg*1);
220
                           window.location="/cart";
237
                           window.location="/cart";
221
                           //alert( "Data Saved: " + msg );
238
                           //alert( "Data Saved: " + msg );
Line 306... Line 323...
306
		$.Storage.set("research", $("#myresearch").html());		  
323
		$.Storage.set("research", $("#myresearch").html());		  
307
	}
324
	}
308
	});
325
	});
309
}
326
}
310
 
327
 
-
 
328
function update_browse_history(){
-
 
329
	if($.Storage.get("historyitems")){
-
 
330
		params = $.Storage.get("historyitems");
-
 
331
 
-
 
332
		jQuery.ajax({
-
 
333
			type: "POST",
-
 
334
			url: "/browse-history",
-
 
335
			data: "historyitems="+params,
-
 
336
			cache: false,
-
 
337
			success: function(html){
-
 
338
				//alert(html);
-
 
339
			}
-
 
340
		});
-
 
341
	}	
-
 
342
}
-
 
343
 
311
function load_history_widget() {
344
function load_history_widget(isValidUser) {
-
 
345
	var params = "";
-
 
346
	if(!isValidUser){
-
 
347
		if($.Storage.get("historyitems")){
-
 
348
			params = "/" + $.Storage.get("historyitems");
-
 
349
		}
-
 
350
	}
-
 
351
	
312
	jQuery.ajax({
352
	jQuery.ajax({
313
		type: "GET",
353
		type: "GET",
314
		url: "/browse-history",
354
		url: "/browse-history" + params,
315
		cache: false,
355
		cache: false,
316
		success: function(html){
356
		success: function(html){
317
		$("#browsehistory").html(html);
357
		$("#browsehistory").html(html);
318
 
358
 
319
		// Product Title
359
		// Product Title