Subversion Repositories SmartDukaan

Rev

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

Rev 14939 Rev 15740
Line 600... Line 600...
600
    }
600
    }
601
    window.location.href = base_url+'payment';
601
    window.location.href = base_url+'payment';
602
}
602
}
603
}
603
}
604
function paymentValidation(e){
604
function paymentValidation(e){
-
 
605
  	if(typeof clickedFlag != "undefined" && clickedFlag){
-
 
606
		return false;
-
 
607
	}
-
 
608
  clickedFlag=true;
-
 
609
  var Id = e.currentTarget.id;
605
  
610
  
606
  var Id = e.currentTarget.id;
611
  var Id = e.currentTarget.id;
607
  if(Id == 'creditcard'){
612
  if(Id == 'creditcard'){
608
    if(previousCard == undefined){
613
    if(previousCard == undefined){
609
      document.getElementById('error').style.display = "block";
614
      document.getElementById('error').style.display = "block";
610
          document.getElementById('error').innerHTML ='Please select payment method!';
615
          document.getElementById('error').innerHTML ='Please select payment method!';
611
          window.scrollTo(0,0); return false;
616
          window.scrollTo(0,0);clickedFlag=false; return false;
612
    }
617
    }
613
    var paymentTitle = e.currentTarget.getAttribute('data-key');
618
    var paymentTitle = e.currentTarget.getAttribute('data-key');
614
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
619
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
615
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
620
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
616
    }*/
621
    }*/
Line 618... Line 623...
618
 
623
 
619
  }else if(Id == 'debitcard'){
624
  }else if(Id == 'debitcard'){
620
    if(previousDebit == undefined){
625
    if(previousDebit == undefined){
621
      document.getElementById('error').style.display = "block";
626
      document.getElementById('error').style.display = "block";
622
          document.getElementById('error').innerHTML ='Please select payment method!';
627
          document.getElementById('error').innerHTML ='Please select payment method!';
623
          window.scrollTo(0,0); return false;
628
          window.scrollTo(0,0);clickedFlag=false; return false;
624
    }
629
    }
625
    var paymentTitle = e.currentTarget.getAttribute('data-key');
630
    var paymentTitle = e.currentTarget.getAttribute('data-key');
626
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
631
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
627
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
632
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
628
    }*/
633
    }*/
Line 630... Line 635...
630
  }else if(Id == 'netbanking'){
635
  }else if(Id == 'netbanking'){
631
    var payOption = document.getElementById('pay-net').value;
636
    var payOption = document.getElementById('pay-net').value;
632
    if(payOption == undefined || payOption ==""){
637
    if(payOption == undefined || payOption ==""){
633
      document.getElementById('error').style.display = "block";
638
      document.getElementById('error').style.display = "block";
634
          document.getElementById('error').innerHTML ='Please select payment method!';
639
          document.getElementById('error').innerHTML ='Please select payment method!';
635
          window.scrollTo(0,0); return false;
640
          window.scrollTo(0,0);clickedFlag=false; return false;
636
    }
641
    }
637
    var paymentTitle = e.currentTarget.getAttribute('data-key');
642
    var paymentTitle = e.currentTarget.getAttribute('data-key');
638
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
643
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
639
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
644
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
640
    }*/
645
    }*/
641
	ga('send', 'event', 'Payment Option', 'Form Submission',paymentTitle);
646
	ga('send', 'event', 'Payment Option', 'Form Submission',paymentTitle);
642
  }else if(Id == 'cashcards'){
647
  }else if(Id == 'cashcards'){
643
    if(previousCC == undefined){
648
    if(previousCC == undefined){
644
      document.getElementById('error').style.display = "block";
649
      document.getElementById('error').style.display = "block";
645
          document.getElementById('error').innerHTML ='Please select payment method!';
650
          document.getElementById('error').innerHTML ='Please select payment method!';
646
          window.scrollTo(0,0); return false;
651
          window.scrollTo(0,0);clickedFlag=false; return false;
647
    }
652
    }
648
    var paymentTitle = e.currentTarget.getAttribute('data-key');
653
    var paymentTitle = e.currentTarget.getAttribute('data-key');
649
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
654
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
650
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
655
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
651
    }*/
656
    }*/
Line 653... Line 658...
653
  }else if(Id == 'emiform'){
658
  }else if(Id == 'emiform'){
654
    var payOption = document.getElementById('pay-emi').value;
659
    var payOption = document.getElementById('pay-emi').value;
655
    if(payOption == undefined || payOption ==""){
660
    if(payOption == undefined || payOption ==""){
656
      document.getElementById('error').style.display = "block";
661
      document.getElementById('error').style.display = "block";
657
          document.getElementById('error').innerHTML ='Please select payment method!';
662
          document.getElementById('error').innerHTML ='Please select payment method!';
658
          window.scrollTo(0,0); return false;
663
          window.scrollTo(0,0);clickedFlag=false; return false;
659
    }
664
    }
660
    var paymentTitle = e.currentTarget.getAttribute('data-key');
665
    var paymentTitle = e.currentTarget.getAttribute('data-key');
661
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
666
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
662
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
667
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
663
    }*/
668
    }*/
Line 673... Line 678...
673
        setTimeout(function(){
678
        setTimeout(function(){
674
          bRed.style.border = '';
679
          bRed.style.border = '';
675
          bRed.style.color = '';
680
          bRed.style.color = '';
676
          bRed.value = '';
681
          bRed.value = '';
677
        },3000);
682
        },3000);
678
        return false;
683
        clickedFlag=false;return false;
679
      }
684
      }
680
    var paymentTitle = e.currentTarget.getAttribute('data-key');
685
    var paymentTitle = e.currentTarget.getAttribute('data-key');
681
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
686
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
682
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
687
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
683
    }*/
688
    }*/
Line 693... Line 698...
693
        setTimeout(function(){
698
        setTimeout(function(){
694
          bRed.style.border = '';
699
          bRed.style.border = '';
695
          bRed.style.color = '';
700
          bRed.style.color = '';
696
          bRed.value = '';
701
          bRed.value = '';
697
        },3000);
702
        },3000);
698
        return false;
703
        clickedFlag=false;return false;
699
      }
704
      }
700
    var paymentTitle = e.currentTarget.getAttribute('data-key');
705
    var paymentTitle = e.currentTarget.getAttribute('data-key');
701
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
706
    /*if(typeof _gaq != "undefined" && _gaq != null)  {
702
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
707
      _gaq.push(['_trackEvent', 'Payment Option', 'Form Submission',paymentTitle]);
703
    }*/
708
    }*/