Subversion Repositories SmartDukaan

Rev

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

Rev 5420 Rev 5552
Line 197... Line 197...
197
 
197
 
198
function addResearch(refdivid, reqtype){
198
function addResearch(refdivid, reqtype){
199
     var research_tot = $("#research_total").val();
199
     var research_tot = $("#research_total").val();
200
     var seldata = [];
200
     var seldata = [];
201
     var tot = 0;
201
     var tot = 0;
-
 
202
     var fromsrc = "";
202
     
203
     
203
     if(reqtype == "multi")	{
204
     if(reqtype == "multi")	{
204
          var containerdiv = "#" + refdivid;     
205
          var containerdiv = "#" + refdivid;     
205
          var par = containerdiv + " input[type=checkbox]:checked";
206
          var par = containerdiv + " input[type=checkbox]:checked";
206
          $(par).each(function(){
207
          $(par).each(function(){
Line 208... Line 209...
208
               tot ++;
209
               tot ++;
209
          });
210
          });
210
     }else if(reqtype == "single")	{
211
     }else if(reqtype == "single")	{
211
    	  seldata.unshift($("#product_id").val());
212
    	  seldata.unshift($("#product_id").val());
212
          tot = 1;
213
          tot = 1;
-
 
214
          fromsrc = "product_page";
213
     }else if(reqtype == "list"){
215
     }else if(reqtype == "list"){
214
    	  seldata.unshift(refdivid);
216
    	  seldata.unshift(refdivid);
215
          tot = 1;
217
          tot = 1;
-
 
218
          fromsrc = "other_pages";
216
     }
219
     }
217
 
220
 
218
     if(tot > 0)	{
221
     if(tot > 0)	{
219
          jQuery.ajax({
222
          jQuery.ajax({
220
               type: "POST",
223
               type: "POST",
221
                      url: "/addtoresearch",
224
                      url: "/addtoresearch",
222
                      data: "productid=[" + seldata +  "]",
225
                      data: "productid=[" + seldata +  "]&fromsrc=" + fromsrc,
223
                      success: function(msg){
226
                      success: function(msg){
224
                           var postSuccessDOMProcessing = function(objValue)	{
227
                           var postSuccessDOMProcessing = function(objValue)	{
225
                        	   trackEventWithGA('Research', 'Add to Research', objValue);
228
                        	   trackEventWithGA('Research', 'Add to Research', objValue);
226
                        	   add_to_storage_set("resitems", objValue);
229
                        	   add_to_storage_set("resitems", objValue);
227
                        	   //Updating the count
230
                        	   //Updating the count