Subversion Repositories SmartDukaan

Rev

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

Rev 11938 Rev 12524
Line 209... Line 209...
209
    document.getElementById(Id).className += ' selected';
209
    document.getElementById(Id).className += ' selected';
210
    document.getElementById(Id).children[0].innerHTML = '-';
210
    document.getElementById(Id).children[0].innerHTML = '-';
211
    e.currentTarget.nextElementSibling.style.display = 'block';
211
    e.currentTarget.nextElementSibling.style.display = 'block';
212
    //document.getElementById(Id).style.display = 'block';
212
    //document.getElementById(Id).style.display = 'block';
213
    defaultPayment = e.currentTarget;
213
    defaultPayment = e.currentTarget;
214
    if(typeof _gaq != "undefined" && _gaq != null)  {
214
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
215
      _gaq.push(['_trackEvent', 'Payment Option', 'Payment option tab clicked',title]);
215
      _gaq.push(['_trackEvent', 'Payment Option', 'Payment option tab clicked',title]);
216
    }
216
    }*/
-
 
217
	ga('send', 'event', 'Payment Option', 'Payment option tab clicked', title);
217
  }
218
  }
218
}
219
}
219
if(typeof bankInfo != 'undefined'){
220
if(typeof bankInfo != 'undefined'){
220
var defaultBank = bankInfo.Id;
221
var defaultBank = bankInfo.Id;
221
}
222
}
Line 228... Line 229...
228
  document.getElementById('pay-emi').value = payOption;
229
  document.getElementById('pay-emi').value = payOption;
229
  defaultBank = Id;
230
  defaultBank = Id;
230
  var id = e.currentTarget.id;
231
  var id = e.currentTarget.id;
231
  var a = document.getElementById(id);
232
  var a = document.getElementById(id);
232
  var bankName = a.options[a.selectedIndex].text;
233
  var bankName = a.options[a.selectedIndex].text;
233
  if(typeof _gaq != "undefined" && _gaq != null)  {
234
  /*if(typeof _gaq != "undefined" && _gaq != null)  {
234
      _gaq.push(['_trackEvent', 'EMI', 'Bank Selection',bankName]);
235
      _gaq.push(['_trackEvent', 'EMI', 'Bank Selection',bankName]);
235
    }
236
    }*/
-
 
237
	ga('send', 'event', 'EMI', 'Bank Selection', bankName);
236
}
238
}
237
function changePay(e){
239
function changePay(e){
238
  
240
  
239
  var Id = e.currentTarget.id;
241
  var Id = e.currentTarget.id;
240
  var payOption = document.getElementById('pay-emi').value;
242
  var payOption = document.getElementById('pay-emi').value;
Line 242... Line 244...
242
  document.getElementById(Id).className += ' selected';
244
  document.getElementById(Id).className += ' selected';
243
  document.getElementById('pay-emi').value = Id;
245
  document.getElementById('pay-emi').value = Id;
244
  var bankName = e.currentTarget.getAttribute('data-bank');
246
  var bankName = e.currentTarget.getAttribute('data-bank');
245
  var tenure = e.currentTarget.getAttribute('data-tenure');
247
  var tenure = e.currentTarget.getAttribute('data-tenure');
246
  bankName = bankName+'-'+tenure;
248
  bankName = bankName+'-'+tenure;
247
  if(typeof _gaq != "undefined" && _gaq != null)  {
249
  /*if(typeof _gaq != "undefined" && _gaq != null)  {
248
      _gaq.push(['_trackEvent', 'EMI', 'Plan Selection',bankName]);
250
      _gaq.push(['_trackEvent', 'EMI', 'Plan Selection',bankName]);
249
    }
251
    }*/
-
 
252
	ga('send', 'event', 'EMI', 'Plan Selection', bankName);
250
}
253
}
251
var netBankingInfo;
254
var netBankingInfo;
252
var prevClass;
255
var prevClass;
253
function changeNetBanking(e){
256
function changeNetBanking(e){
254
  
257
  
Line 283... Line 286...
283
  document.getElementById('pay-net').value = Id;
286
  document.getElementById('pay-net').value = Id;
284
  netBankingInfo = Id;
287
  netBankingInfo = Id;
285
  prevClass = e.currentTarget.className;
288
  prevClass = e.currentTarget.className;
286
  var title = e.currentTarget.getAttribute('data-parent');
289
  var title = e.currentTarget.getAttribute('data-parent');
287
  title = title+'-'+Id;
290
  title = title+'-'+Id;
288
  if(typeof _gaq != "undefined" && _gaq != null)  {
291
  /*if(typeof _gaq != "undefined" && _gaq != null)  {
289
      _gaq.push(['_trackEvent', 'Payment Option', 'Payment option tab-payoption selected',title]);
292
      _gaq.push(['_trackEvent', 'Payment Option', 'Payment option tab-payoption selected',title]);
290
    }
293
    }*/
-
 
294
	ga('send', 'event', 'Payment Option', 'Payment option tab-payoption selected', title);
291
}
295
}
292
var countryId;
296
var countryId;
293
function changeCountry(e){
297
function changeCountry(e){
294
  
298
  
295
  var Id = e.currentTarget.id;
299
  var Id = e.currentTarget.id;
Line 320... Line 324...
320
  }
324
  }
321
  document.getElementById('pay-credit').value = Id;
325
  document.getElementById('pay-credit').value = Id;
322
  previousCard = e.currentTarget;
326
  previousCard = e.currentTarget;
323
  var title = e.currentTarget.getAttribute('data-parent');
327
  var title = e.currentTarget.getAttribute('data-parent');
324
  title = title+'-'+Id;
328
  title = title+'-'+Id;
325
  if(typeof _gaq != "undefined" && _gaq != null)  {
329
  /*if(typeof _gaq != "undefined" && _gaq != null)  {
326
      _gaq.push(['_trackEvent', 'Payment Option', 'Payment option tab-payoption selected',title]);
330
      _gaq.push(['_trackEvent', 'Payment Option', 'Payment option tab-payoption selected',title]);
327
    }
331
    }*/
-
 
332
	ga('send', 'event', 'Payment Option', 'Payment option tab-payoption selected', title);
328
}
333
}
329
var previousDebit;
334
var previousDebit;
330
function selectDebitCard(e){
335
function selectDebitCard(e){
331
  
336
  
332
  var Id = e.currentTarget.id;
337
  var Id = e.currentTarget.id;
Line 339... Line 344...
339
  }
344
  }
340
  document.getElementById('pay-debit').value = Id;
345
  document.getElementById('pay-debit').value = Id;
341
  previousDebit = e.currentTarget;
346
  previousDebit = e.currentTarget;
342
  var title = e.currentTarget.getAttribute('data-parent');
347
  var title = e.currentTarget.getAttribute('data-parent');
343
  title = title+'-'+Id;
348
  title = title+'-'+Id;
344
  if(typeof _gaq != "undefined" && _gaq != null)  {
349
  /*if(typeof _gaq != "undefined" && _gaq != null)  {
345
      _gaq.push(['_trackEvent', 'Payment Option', 'Payment option tab-payoption selected',title]);
350
      _gaq.push(['_trackEvent', 'Payment Option', 'Payment option tab-payoption selected',title]);
346
    }
351
    }*/
-
 
352
	ga('send', 'event', 'Payment Option', 'Payment option tab-payoption selected', title);
347
}
353
}
348
var previousCC;
354
var previousCC;
349
function selectCashCard(e){
355
function selectCashCard(e){
350
  
356
  
351
  var Id = e.currentTarget.id;
357
  var Id = e.currentTarget.id;
Line 358... Line 364...
358
  }
364
  }
359
  document.getElementById('pay-cc').value = Id;
365
  document.getElementById('pay-cc').value = Id;
360
  previousCC = e.currentTarget;
366
  previousCC = e.currentTarget;
361
  var title = e.currentTarget.getAttribute('data-parent');
367
  var title = e.currentTarget.getAttribute('data-parent');
362
  title = title+'-'+Id;
368
  title = title+'-'+Id;
363
  if(typeof _gaq != "undefined" && _gaq != null)  {
369
  /*if(typeof _gaq != "undefined" && _gaq != null)  {
364
      _gaq.push(['_trackEvent', 'Payment Option', 'Payment option tab-payoption selected',title]);
370
      _gaq.push(['_trackEvent', 'Payment Option', 'Payment option tab-payoption selected',title]);
365
    }
371
    }*/
-
 
372
	ga('send', 'event', 'Payment Option', 'Payment option tab-payoption selected', title);
366
}
373
}
367
// function changeCaptcha(){
374
// function changeCaptcha(){
368
//   var url = base_url+'checkout/changeCaptcha';
375
//   var url = base_url+'checkout/changeCaptcha';
369
//     microAjax(url, function (res) {
376
//     microAjax(url, function (res) {
370
//         
377
//         
Line 416... Line 423...
416
  for(i=0;i<currentStore.length;i++){
423
  for(i=0;i<currentStore.length;i++){
417
    storeAddress +='<div class="pickup-spot" id="'+currentStore[i].id+'" data-key="'+currentStore[i].hotspotId+'" onclick=selectStore(event)><div>'+currentStore[i].name+'</div><div>'+currentStore[i].line1+'</div><div>'+currentStore[i].line2+'</div><div>'+currentStore[i].city+'</div><div>'+currentStore[i].state+'</div><div>Pin: '+currentStore[i].pin+'</div><div>Phone: '+currentStore[i].phone+'</div></div>'; 
424
    storeAddress +='<div class="pickup-spot" id="'+currentStore[i].id+'" data-key="'+currentStore[i].hotspotId+'" onclick=selectStore(event)><div>'+currentStore[i].name+'</div><div>'+currentStore[i].line1+'</div><div>'+currentStore[i].line2+'</div><div>'+currentStore[i].city+'</div><div>'+currentStore[i].state+'</div><div>Pin: '+currentStore[i].pin+'</div><div>Phone: '+currentStore[i].phone+'</div></div>'; 
418
  }
425
  }
419
 document.getElementById('appendData').innerHTML = storeAddress;
426
 document.getElementById('appendData').innerHTML = storeAddress;
420
 prevZone = value;
427
 prevZone = value;
421
 if(typeof _gaq != "undefined" && _gaq != null)  {
428
/* if(typeof _gaq != "undefined" && _gaq != null)  {
422
      _gaq.push(['_trackEvent', 'InStore Pickup Region', 'Store Zone',value]);
429
      _gaq.push(['_trackEvent', 'InStore Pickup Region', 'Store Zone',value]);
423
    }
430
    }*/
-
 
431
	ga('send', 'event', 'InStore Pickup Region', 'Store Zone', value);
424
 }
432
 }
425
}
433
}
426
var shopId;
434
var shopId;
427
var inStoreDelivery;
435
var inStoreDelivery;
428
function selectStore(e){
436
function selectStore(e){
Line 535... Line 543...
535
  });
543
  });
536
  }
544
  }
537
  if(type == 2){
545
  if(type == 2){
538
    if(pickupStore == true){
546
    if(pickupStore == true){
539
    if(inStoreDelivery == true){
547
    if(inStoreDelivery == true){
540
      if(typeof _gaq != "undefined" && _gaq != null)  {
548
      /*if(typeof _gaq != "undefined" && _gaq != null)  {
541
      _gaq.push(['_trackEvent', 'Delivery Type','In-Store Pickup']);
549
      _gaq.push(['_trackEvent', 'Delivery Type','In-Store Pickup']);
542
    }
550
    }*/
-
 
551
	ga('send', 'event', 'Delivery Type', 'In-Store Pickup');
543
    }else if(inStoreDelivery == false){
552
    }else if(inStoreDelivery == false){
544
      document.getElementById('error').style.display = "block";
553
      document.getElementById('error').style.display = "block";
545
      document.getElementById('error').innerHTML ="Please select a delivery store!" ;
554
      document.getElementById('error').innerHTML ="Please select a delivery store!" ;
546
      return false;
555
      return false;
547
    }
556
    }
548
  }else{
557
  }else{
549
      if(typeof _gaq != "undefined" && _gaq != null)  {
558
      /*if(typeof _gaq != "undefined" && _gaq != null)  {
550
      _gaq.push(['_trackEvent', 'Delivery Type','Deliver to address']);
559
      _gaq.push(['_trackEvent', 'Delivery Type','Deliver to address']);
-
 
560
    }*/
-
 
561
	ga('send', 'event', 'Delivery Type', 'Deliver to address');
551
    }
562
    }
552
    }
-
 
553
    if(typeof _gaq != "undefined" && _gaq != null)  {
563
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
554
      _gaq.push(['_trackEvent', 'Order','Proceed To Pay']);
564
      _gaq.push(['_trackEvent', 'Order','Proceed To Pay']);
555
    }
565
    }*/
-
 
566
	ga('send', 'event', 'Order', 'Proceed To Pay');
556
    if(locationServiceable == false){
567
    if(locationServiceable == false){
557
      document.getElementById('error').style.display = "block";
568
      document.getElementById('error').style.display = "block";
558
      document.getElementById('error').innerHTML ='Location not serviceable. Please specify a different address';
569
      document.getElementById('error').innerHTML ='Location not serviceable. Please specify a different address';
559
      return false;
570
      return false;
560
    }
571
    }
561
    window.location.href = base_url+'payment';
572
    window.location.href = base_url+'payment';
562
  }
573
  }
563
}else{
574
}else{
564
  if(pickupStore == true){
575
  if(pickupStore == true){
565
    if(inStoreDelivery == true){
576
    if(inStoreDelivery == true){
566
      if(typeof _gaq != "undefined" && _gaq != null)  {
577
      /*if(typeof _gaq != "undefined" && _gaq != null)  {
567
      _gaq.push(['_trackEvent', 'Delivery Type','In-Store Pickup']);
578
      _gaq.push(['_trackEvent', 'Delivery Type','In-Store Pickup']);
568
    }
579
    }*/
-
 
580
	ga('send', 'event', 'Delivery Type', 'In-Store Pickup');
569
    }else if(inStoreDelivery == false){
581
    }else if(inStoreDelivery == false){
570
      document.getElementById('error').style.display = "block";
582
      document.getElementById('error').style.display = "block";
571
      document.getElementById('error').innerHTML ="Please select a delivery store!" ;
583
      document.getElementById('error').innerHTML ="Please select a delivery store!" ;
572
      return false;
584
      return false;
573
    }
585
    }
574
  }else{
586
  }else{
575
      if(typeof _gaq != "undefined" && _gaq != null)  {
587
      /*if(typeof _gaq != "undefined" && _gaq != null)  {
576
      _gaq.push(['_trackEvent', 'Delivery Type','Deliver to address']);
588
      _gaq.push(['_trackEvent', 'Delivery Type','Deliver to address']);
-
 
589
    }*/
-
 
590
	ga('send', 'event', 'Delivery Type', 'Deliver to address');
577
    }
591
    }
578
    }
-
 
579
    if(typeof _gaq != "undefined" && _gaq != null)  {
592
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
580
      _gaq.push(['_trackEvent', 'Order','Proceed To Pay']);
593
      _gaq.push(['_trackEvent', 'Order','Proceed To Pay']);
581
    }
594
    }*/
-
 
595
	ga('send', 'event', 'Order', 'Proceed To Pay');
582
    if(locationServiceable == false){
596
    if(locationServiceable == false){
583
      document.getElementById('error').style.display = "block";
597
      document.getElementById('error').style.display = "block";
584
      document.getElementById('error').innerHTML ='Location not serviceable. Please specify a different address';
598
      document.getElementById('error').innerHTML ='Location not serviceable. Please specify a different address';
585
      return false;
599
      return false;
586
    }
600
    }
Line 595... Line 609...
595
      document.getElementById('error').style.display = "block";
609
      document.getElementById('error').style.display = "block";
596
          document.getElementById('error').innerHTML ='Please select payment method!';
610
          document.getElementById('error').innerHTML ='Please select payment method!';
597
          window.scrollTo(0,0); return false;
611
          window.scrollTo(0,0); return false;
598
    }
612
    }
599
    var paymentTitle = e.currentTarget.getAttribute('data-key');
613
    var paymentTitle = e.currentTarget.getAttribute('data-key');
600
    if(typeof _gaq != "undefined" && _gaq != null)  {
614
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
601
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
615
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
602
    }
616
    }*/
-
 
617
	ga('send', 'event', 'Payment Option', 'Form Submission',paymentTitle);
603
 
618
 
604
  }else if(Id == 'debitcard'){
619
  }else if(Id == 'debitcard'){
605
    if(previousDebit == undefined){
620
    if(previousDebit == undefined){
606
      document.getElementById('error').style.display = "block";
621
      document.getElementById('error').style.display = "block";
607
          document.getElementById('error').innerHTML ='Please select payment method!';
622
          document.getElementById('error').innerHTML ='Please select payment method!';
608
          window.scrollTo(0,0); return false;
623
          window.scrollTo(0,0); return false;
609
    }
624
    }
610
    var paymentTitle = e.currentTarget.getAttribute('data-key');
625
    var paymentTitle = e.currentTarget.getAttribute('data-key');
611
    if(typeof _gaq != "undefined" && _gaq != null)  {
626
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
612
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
627
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
613
    }
628
    }*/
-
 
629
	ga('send', 'event', 'Payment Option', 'Form Submission',paymentTitle);
614
  }else if(Id == 'netbanking'){
630
  }else if(Id == 'netbanking'){
615
    var payOption = document.getElementById('pay-net').value;
631
    var payOption = document.getElementById('pay-net').value;
616
    if(payOption == undefined || payOption ==""){
632
    if(payOption == undefined || payOption ==""){
617
      document.getElementById('error').style.display = "block";
633
      document.getElementById('error').style.display = "block";
618
          document.getElementById('error').innerHTML ='Please select payment method!';
634
          document.getElementById('error').innerHTML ='Please select payment method!';
619
          window.scrollTo(0,0); return false;
635
          window.scrollTo(0,0); return false;
620
    }
636
    }
621
    var paymentTitle = e.currentTarget.getAttribute('data-key');
637
    var paymentTitle = e.currentTarget.getAttribute('data-key');
622
    if(typeof _gaq != "undefined" && _gaq != null)  {
638
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
623
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
639
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
624
    }
640
    }*/
-
 
641
	ga('send', 'event', 'Payment Option', 'Form Submission',paymentTitle);
625
  }else if(Id == 'cashcards'){
642
  }else if(Id == 'cashcards'){
626
    if(previousCC == undefined){
643
    if(previousCC == undefined){
627
      document.getElementById('error').style.display = "block";
644
      document.getElementById('error').style.display = "block";
628
          document.getElementById('error').innerHTML ='Please select payment method!';
645
          document.getElementById('error').innerHTML ='Please select payment method!';
629
          window.scrollTo(0,0); return false;
646
          window.scrollTo(0,0); return false;
630
    }
647
    }
631
    var paymentTitle = e.currentTarget.getAttribute('data-key');
648
    var paymentTitle = e.currentTarget.getAttribute('data-key');
632
    if(typeof _gaq != "undefined" && _gaq != null)  {
649
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
633
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
650
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
634
    }
651
    }*/
-
 
652
	ga('send', 'event', 'Payment Option', 'Form Submission',paymentTitle);
635
  }else if(Id == 'emiform'){
653
  }else if(Id == 'emiform'){
636
    var payOption = document.getElementById('pay-emi').value;
654
    var payOption = document.getElementById('pay-emi').value;
637
    if(payOption == undefined || payOption ==""){
655
    if(payOption == undefined || payOption ==""){
638
      document.getElementById('error').style.display = "block";
656
      document.getElementById('error').style.display = "block";
639
          document.getElementById('error').innerHTML ='Please select payment method!';
657
          document.getElementById('error').innerHTML ='Please select payment method!';
640
          window.scrollTo(0,0); return false;
658
          window.scrollTo(0,0); return false;
641
    }
659
    }
642
    var paymentTitle = e.currentTarget.getAttribute('data-key');
660
    var paymentTitle = e.currentTarget.getAttribute('data-key');
643
    if(typeof _gaq != "undefined" && _gaq != null)  {
661
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
644
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
662
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
645
    }
663
    }*/
-
 
664
	ga('send', 'event', 'Payment Option', 'Form Submission',paymentTitle);
646
  }else if(Id == 'cashod'){
665
  }else if(Id == 'cashod'){
647
        if(document.getElementById('captcha_response_box').value == ''){
666
        if(document.getElementById('captcha_response_box').value == ''){
648
        // document.forms['recharge-confirm'].submit();
667
        // document.forms['recharge-confirm'].submit();
649
      // }else{
668
      // }else{
650
        var bRed = document.getElementById('captcha_response_box');
669
        var bRed = document.getElementById('captcha_response_box');
Line 657... Line 676...
657
          bRed.value = '';
676
          bRed.value = '';
658
        },3000);
677
        },3000);
659
        return false;
678
        return false;
660
      }
679
      }
661
    var paymentTitle = e.currentTarget.getAttribute('data-key');
680
    var paymentTitle = e.currentTarget.getAttribute('data-key');
662
    if(typeof _gaq != "undefined" && _gaq != null)  {
681
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
663
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
682
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
664
    }
683
    }*/
-
 
684
	ga('send', 'event', 'Payment Option', 'Form Submission',paymentTitle);
665
  }else if(Id == 'zod'){
685
  }else if(Id == 'zod'){
666
        if(document.getElementById('captcha_response_box').value == ''){
686
        if(document.getElementById('captcha_response_box').value == ''){
667
        // document.forms['recharge-confirm'].submit();
687
        // document.forms['recharge-confirm'].submit();
668
      // }else{
688
      // }else{
669
        var bRed = document.getElementById('captcha_response_box');
689
        var bRed = document.getElementById('captcha_response_box');
Line 676... Line 696...
676
          bRed.value = '';
696
          bRed.value = '';
677
        },3000);
697
        },3000);
678
        return false;
698
        return false;
679
      }
699
      }
680
    var paymentTitle = e.currentTarget.getAttribute('data-key');
700
    var paymentTitle = e.currentTarget.getAttribute('data-key');
681
    if(typeof _gaq != "undefined" && _gaq != null)  {
701
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
682
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
702
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
683
    }
703
    }*/
-
 
704
	ga('send', 'event', 'Payment Option', 'Form Submission',paymentTitle);
684
  }
705
  }
685
}
706
}
686
var url;
707
var url;
687
 url = document.URL;
708
 url = document.URL;
688
 if(url.indexOf('pay-success') != -1){
709
 if(url.indexOf('pay-success') != -1){
Line 693... Line 714...
693
    var orders = orderConfirmation['result']['orders'];
714
    var orders = orderConfirmation['result']['orders'];
694
    for(i=0;i<orders.length;i++){
715
    for(i=0;i<orders.length;i++){
695
      var amount = orders[i].totalAmount.replace(',','');
716
      var amount = orders[i].totalAmount.replace(',','');
696
      amount = parseFloat(amount).toFixed(2);
717
      amount = parseFloat(amount).toFixed(2);
697
      var orderId = orders[i].orderId;
718
      var orderId = orders[i].orderId;
-
 
719
/*
698
      _gaq.push(['_addTrans',
720
      _gaq.push(['_addTrans',
699
          orderId,                     // Transaction ID. Required.
721
          orderId,                     // Transaction ID. Required.
700
          storeName,   // Affiliation or store name.
722
          storeName,   // Affiliation or store name.
701
          amount,               // Grand Total.
723
          amount,               // Grand Total.
702
          '0',                  // Shipping.
724
          '0',                  // Shipping.
Line 711... Line 733...
711
          orders[i].itemName,                 // SKU/code.
733
          orders[i].itemName,                 // SKU/code.
712
          'Physical',         // Category or variation.
734
          'Physical',         // Category or variation.
713
          amount,                 // Unit price.
735
          amount,                 // Unit price.
714
          orders[i].quantity                   // Quantity.
736
          orders[i].quantity                   // Quantity.
715
      ]);
737
      ]);
-
 
738
*/
-
 
739
	ga('ecommerce:addTransaction', {
-
 
740
	  'id': orderId,                     // Transaction ID. Required
-
 
741
	  'affiliation': storeName,   // Affiliation or store name
-
 
742
	  'revenue': amount,               // Grand Total
-
 
743
	  'shipping': '0',                  // Shipping
-
 
744
	  'tax': '0'                     // Tax
-
 
745
	});
-
 
746
	// addItem should be called for every item in the shopping cart.
-
 
747
	ga('ecommerce:addItem', {
-
 
748
	  'id': orderId,                     // Transaction ID. Required
-
 
749
	  'name': orders[i].itemName,                // Product name. Required
-
 
750
	  'sku': orders[i].itemName,                    // SKU/code
-
 
751
	  'category': 'Physical',       // Category or variation
-
 
752
	  'price': amount,                 // Unit price
-
 
753
	  'quantity': orders[i].quantity                   // Quantity
-
 
754
	});
716
    }
755
    }
717
    _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
756
//    _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
-
 
757
	ga('ecommerce:send');      // Send transaction and item data to Google Analytics.
718
  }
758
  }
719
 }
759
 }