




<form method="post" name="redirect" action="https://secure.ccavenue.com/transaction/transaction.do?command=initiateTransaction" id="redirect_cc"> 
  <input type=hidden name=encRequest value="" id="encRequest">
<input type=hidden name=access_code value=AVEI29KC44BF28IEFB></form>


<script src="https://checkout.razorpay.com/v1/checkout.js"></script>
<script>
jQuery(document).ready(function () {
	
search_pincode();

 $('#city').on('input', function() {
    // Allow only alphabetical characters
    var inputValue = $(this).val();
    var sanitizedInput = inputValue.replace(/[^a-zA-Z]/g, '');
    $(this).val(sanitizedInput);
  });
  $('#state').on('input', function() {
    // Allow only alphabetical characters
    var inputValue = $(this).val();
    var sanitizedInput = inputValue.replace(/[^a-zA-Z]/g, '');
    $(this).val(sanitizedInput);
  });

jQuery('body').on('keyup', '#post_code', function(e) { 

				var form = new FormData();
				form.append('action',"search_pincode");
				form.append('pincode',jQuery('#post_code').val()); 
                jQuery.ajax({ 
					type:"POST",
					cache: false,
					contentType: false,
					processData: false,
					dataType: 'json',
					url:frontend_ajax_object.ajaxurl,
					data: form , 
					success: function(data){    
						 //jQuery("#city").val(data.city);   
						// jQuery("#state").val(data.state);   
						 //jQuery("#country").val(data.country);   
					} 	 				
				  }); 


         search_pincode(); 
 });
 
function search_pincode(){

	
       var totalLength = jQuery('#post_code').val().length; 
       var postcode = jQuery('#post_code').val();  
		if (totalLength != 6) {
			jQuery('#postcode_error').html("Code should be 6 digits");
			jQuery("#postcode_error").css({"color": "red"});
			jQuery("#shipping_razorpay").css({"display": "none"});
			
		} else  {
			jQuery("#shipping_razorpay").css({"display": "block"});
			jQuery('#postcode_error').html("");
			jQuery('#postcode_error').html("searching post code"); 
			 var form = new FormData();
			  form.append('action',"check_pincode");
			  form.append('pincode',jQuery('#post_code').val());
			  form.append('temple_pincode',jQuery('#temple_pincode').val());
			  form.append('weight',jQuery('#weight').val());
			  form.append('length',jQuery('#length').val());
			  form.append('width',jQuery('#width').val());
			  form.append('height',jQuery('#height').val());
			  form.append('sub_total',jQuery('#sub_total').val());
				  jQuery.ajax({ 
					type:"POST",
					cache: false,
					contentType: false,
					processData: false,
					dataType: 'json',
					url:frontend_ajax_object.ajaxurl,
					data: form ,
					 beforeSend: function() {
						   jQuery("#overlay").fadeIn(300);　
					  },  
					success: function(data){   
          console.log(data) 
						 if(data.status == '1'){ 



      var form = new FormData();
        form.append('total_amount',data.total);
        form.append('action',"get_total_amount");
          jQuery.ajax({ 
          type:"POST",
          cache: false,
          contentType: false,
          processData: false,
          dataType: 'json',
          url:frontend_ajax_object.ajaxurl,
          data: form ,
           beforeSend: function() {
               jQuery("#overlay").fadeIn(300);　
            },  
          success: function(data){ 


          console.log(data) 
         $('#order_id').val(data.id)


     jQuery("#order_amount").val(data.amount/100)
               
          },
          complete: function(){
               jQuery("#overlay").fadeOut(300);
          }         
          }); 



							 jQuery('#postcode_error').html("Shipping Available");
						     jQuery("#postcode_error").css({"color": "green"}); 
						      
							 jQuery("#tax_price").html('₹' + data.tax + '/-');
							 jQuery("#shp_price").html('₹' + data.shipping + '/-');
							 jQuery("#total_amount").html('₹' + data.total + '/-');
							 jQuery("#shipping").val(data.shipping);
							 jQuery("#tax").val(data.tax);
							 jQuery("#total").val(data.total); 
							 jQuery("#shipping_razorpay").css({"display": "block"});
						 } else if (data.status == '0'){
							 
							 jQuery('#postcode_error').html(postcode + " is a invalid Pincode,please try again");
					         jQuery("#postcode_error").css({"color": "red"});
							 jQuery("#shipping_razorpay").css({"display": "done"});   
							 jQuery("#post_code").val('');
							 
						 } else {
							 
							 swal("Alert",data.status, "warning");
							 jQuery('#postcode_error').html(data.status);
					         jQuery("#postcode_error").css({"color": "red"});
							 jQuery("#shipping_razorpay").css({"display": "none"});
							 jQuery("#post_code").val('');
							 
						 }   
					},
					complete: function(){
							 jQuery("#overlay").fadeOut(300);
					}					
				  }); 
		} 
 }

 
 jQuery('body').on('click', '#chamunda_pay', function(e) {

      e.preventDefault();   
     if (!jQuery('#Chamunda').parsley().validate()) {
        return false;
      }
     var total = jQuery('#post_code').val().length;  
     if (total != 6) {
      jQuery('#postcode_error').html("Code should be 6 digits");
      jQuery("#postcode_error").css({"color": "red"});
      return false;
    }

        var form = new FormData( jQuery("#Chamunda")[0] );
        form.append('action',"chamunda_payment");
        form.append('page_id',"");
         jQuery.ajax({
          type:"POST",
          cache: false,
          contentType: false,
          processData: false,
          dataType: 'json',
          url:frontend_ajax_object.ajaxurl,
          data: form , 
      beforeSend: function() {
        
         jQuery("#overlay").fadeIn(300);　
      },
     success: function(data){ 
          if (data.status==1) {
            jQuery("#encRequest").val(data.data)
            jQuery('#redirect_cc').submit();
          }else{

            alert(data.message)
          }
         

      },
      complete: function(){
       
         jQuery("#overlay").fadeOut(300);
       }
    });

  })
 
  /* Paypal initrazorpay Details */ 
 jQuery('body').on('click', '#shipping_razorpay', function(e) { 
  //alert();
    	e.preventDefault();   
	   if (!jQuery('#shipping_form').parsley().validate()) {
			  return false;
	    }
	   var total = jQuery('#post_code').val().length;  
		 if (total != 6) {
			jQuery('#postcode_error').html("Code should be 6 digits");
			jQuery("#postcode_error").css({"color": "red"});
			return false;
		} 
	       
   var final_amount_paid = jQuery('#total').val();
   var product_id = 'TempleKangra321';

    var options = {
        "key": "rzp_live_1dEp3ovTZ8XlPg",
        "amount": (final_amount_paid * 100).toFixed(0), // 2000 paise = INR 20
        "name": "Temple Kangra",
        "order_id": $("#order_id").val(),
        "image": "http://kangratemples.hp.gov.in/wp-content/uploads/2022/01/kangra-temple-logo.png",
        "handler": function(response) {
          
          console.log(response)
             $('#razorpay_payment_id').val(response.razorpay_payment_id);
             //$('#razorpay_signature').val(response.razorpay_signature);
			  jQuery('#shipping_form').submit();
        },
		 redirect: false,
        "prefill": {
            "name": "",
            "contact": "",
            "email": "",
        },
        "theme": {
            "color": "#00bcd4"
        }
    };
    var rzp1 = new Razorpay(options);
    rzp1.open();
    e.preventDefault();
     });
	 });
   </script>
   <script>
  window.onload = function() {
    var d = new Date().getTime();
    document.getElementById("tid").value = d;
    document.getElementById("order_ids").value = d;
  };
</script>
<form method="post" name="redirect" action="https://secure.ccavenue.com/transaction/transaction.do?command=initiateTransaction" id="redirect_cc"> 
  <input type=hidden name=encRequest value="" id="encRequest">
<input type=hidden name=access_code value=AVEI29KC44BF28IEFB></form>


<script src="https://checkout.razorpay.com/v1/checkout.js"></script>
<script>
jQuery(document).ready(function () {
	
search_pincode();

 $('#city').on('input', function() {
    // Allow only alphabetical characters
    var inputValue = $(this).val();
    var sanitizedInput = inputValue.replace(/[^a-zA-Z]/g, '');
    $(this).val(sanitizedInput);
  });
  $('#state').on('input', function() {
    // Allow only alphabetical characters
    var inputValue = $(this).val();
    var sanitizedInput = inputValue.replace(/[^a-zA-Z]/g, '');
    $(this).val(sanitizedInput);
  });

jQuery('body').on('keyup', '#post_code', function(e) { 

				var form = new FormData();
				form.append('action',"search_pincode");
				form.append('pincode',jQuery('#post_code').val()); 
                jQuery.ajax({ 
					type:"POST",
					cache: false,
					contentType: false,
					processData: false,
					dataType: 'json',
					url:frontend_ajax_object.ajaxurl,
					data: form , 
					success: function(data){    
						 //jQuery("#city").val(data.city);   
						// jQuery("#state").val(data.state);   
						 //jQuery("#country").val(data.country);   
					} 	 				
				  }); 


         search_pincode(); 
 });
 
function search_pincode(){

	
       var totalLength = jQuery('#post_code').val().length; 
       var postcode = jQuery('#post_code').val();  
		if (totalLength != 6) {
			jQuery('#postcode_error').html("Code should be 6 digits");
			jQuery("#postcode_error").css({"color": "red"});
			jQuery("#shipping_razorpay").css({"display": "none"});
			
		} else  {
			jQuery("#shipping_razorpay").css({"display": "block"});
			jQuery('#postcode_error').html("");
			jQuery('#postcode_error').html("searching post code"); 
			 var form = new FormData();
			  form.append('action',"check_pincode");
			  form.append('pincode',jQuery('#post_code').val());
			  form.append('temple_pincode',jQuery('#temple_pincode').val());
			  form.append('weight',jQuery('#weight').val());
			  form.append('length',jQuery('#length').val());
			  form.append('width',jQuery('#width').val());
			  form.append('height',jQuery('#height').val());
			  form.append('sub_total',jQuery('#sub_total').val());
				  jQuery.ajax({ 
					type:"POST",
					cache: false,
					contentType: false,
					processData: false,
					dataType: 'json',
					url:frontend_ajax_object.ajaxurl,
					data: form ,
					 beforeSend: function() {
						   jQuery("#overlay").fadeIn(300);　
					  },  
					success: function(data){   
          console.log(data) 
						 if(data.status == '1'){ 



      var form = new FormData();
        form.append('total_amount',data.total);
        form.append('action',"get_total_amount");
          jQuery.ajax({ 
          type:"POST",
          cache: false,
          contentType: false,
          processData: false,
          dataType: 'json',
          url:frontend_ajax_object.ajaxurl,
          data: form ,
           beforeSend: function() {
               jQuery("#overlay").fadeIn(300);　
            },  
          success: function(data){ 


          console.log(data) 
         $('#order_id').val(data.id)


     jQuery("#order_amount").val(data.amount/100)
               
          },
          complete: function(){
               jQuery("#overlay").fadeOut(300);
          }         
          }); 



							 jQuery('#postcode_error').html("Shipping Available");
						     jQuery("#postcode_error").css({"color": "green"}); 
						      
							 jQuery("#tax_price").html('₹' + data.tax + '/-');
							 jQuery("#shp_price").html('₹' + data.shipping + '/-');
							 jQuery("#total_amount").html('₹' + data.total + '/-');
							 jQuery("#shipping").val(data.shipping);
							 jQuery("#tax").val(data.tax);
							 jQuery("#total").val(data.total); 
							 jQuery("#shipping_razorpay").css({"display": "block"});
						 } else if (data.status == '0'){
							 
							 jQuery('#postcode_error').html(postcode + " is a invalid Pincode,please try again");
					         jQuery("#postcode_error").css({"color": "red"});
							 jQuery("#shipping_razorpay").css({"display": "done"});   
							 jQuery("#post_code").val('');
							 
						 } else {
							 
							 swal("Alert",data.status, "warning");
							 jQuery('#postcode_error').html(data.status);
					         jQuery("#postcode_error").css({"color": "red"});
							 jQuery("#shipping_razorpay").css({"display": "none"});
							 jQuery("#post_code").val('');
							 
						 }   
					},
					complete: function(){
							 jQuery("#overlay").fadeOut(300);
					}					
				  }); 
		} 
 }

 
 jQuery('body').on('click', '#chamunda_pay', function(e) {

      e.preventDefault();   
     if (!jQuery('#Chamunda').parsley().validate()) {
        return false;
      }
     var total = jQuery('#post_code').val().length;  
     if (total != 6) {
      jQuery('#postcode_error').html("Code should be 6 digits");
      jQuery("#postcode_error").css({"color": "red"});
      return false;
    }

        var form = new FormData( jQuery("#Chamunda")[0] );
        form.append('action',"chamunda_payment");
        form.append('page_id',"");
         jQuery.ajax({
          type:"POST",
          cache: false,
          contentType: false,
          processData: false,
          dataType: 'json',
          url:frontend_ajax_object.ajaxurl,
          data: form , 
      beforeSend: function() {
        
         jQuery("#overlay").fadeIn(300);　
      },
     success: function(data){ 
          if (data.status==1) {
            jQuery("#encRequest").val(data.data)
            jQuery('#redirect_cc').submit();
          }else{

            alert(data.message)
          }
         

      },
      complete: function(){
       
         jQuery("#overlay").fadeOut(300);
       }
    });

  })
 
  /* Paypal initrazorpay Details */ 
 jQuery('body').on('click', '#shipping_razorpay', function(e) { 
  //alert();
    	e.preventDefault();   
	   if (!jQuery('#shipping_form').parsley().validate()) {
			  return false;
	    }
	   var total = jQuery('#post_code').val().length;  
		 if (total != 6) {
			jQuery('#postcode_error').html("Code should be 6 digits");
			jQuery("#postcode_error").css({"color": "red"});
			return false;
		} 
	       
   var final_amount_paid = jQuery('#total').val();
   var product_id = 'TempleKangra321';

    var options = {
        "key": "rzp_live_1dEp3ovTZ8XlPg",
        "amount": (final_amount_paid * 100).toFixed(0), // 2000 paise = INR 20
        "name": "Temple Kangra",
        "order_id": $("#order_id").val(),
        "image": "http://kangratemples.hp.gov.in/wp-content/uploads/2022/01/kangra-temple-logo.png",
        "handler": function(response) {
          
          console.log(response)
             $('#razorpay_payment_id').val(response.razorpay_payment_id);
             //$('#razorpay_signature').val(response.razorpay_signature);
			  jQuery('#shipping_form').submit();
        },
		 redirect: false,
        "prefill": {
            "name": "",
            "contact": "",
            "email": "",
        },
        "theme": {
            "color": "#00bcd4"
        }
    };
    var rzp1 = new Razorpay(options);
    rzp1.open();
    e.preventDefault();
     });
	 });
   </script>
   <script>
  window.onload = function() {
    var d = new Date().getTime();
    document.getElementById("tid").value = d;
    document.getElementById("order_ids").value = d;
  };
</script>
{"id":1972,"date":"2022-02-25T10:30:46","date_gmt":"2022-02-25T10:30:46","guid":{"rendered":"https:\/\/kangratemples.hp.gov.in\/?page_id=1972"},"modified":"2022-09-07T13:07:17","modified_gmt":"2022-09-07T13:07:17","slug":"cart","status":"publish","type":"page","link":"http:\/\/kangratemples.hp.gov.in\/hi\/cart\/","title":{"rendered":"Cart"},"content":{"rendered":"<p>[et_pb_section fb_built=&#8221;1&#8243; admin_label=&#8221;Section&#8221; _builder_version=&#8221;4.14.2&#8243; _module_preset=&#8221;default&#8221; background_image=&#8221;https:\/\/kangratemples.hp.gov.in\/wp-content\/uploads\/2022\/08\/breadcrumb-head-1.jpg&#8221; locked=&#8221;off&#8221; collapsed=&#8221;off&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_row _builder_version=&#8221;4.14.2&#8243; _module_preset=&#8221;default&#8221; collapsed=&#8221;off&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.14.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_post_title meta=&#8221;off&#8221; featured_image=&#8221;off&#8221; _builder_version=&#8221;4.14.2&#8243; _module_preset=&#8221;default&#8221; title_text_align=&#8221;center&#8221; title_text_color=&#8221;#FFFFFF&#8221; title_font_size=&#8221;36px&#8221; text_orientation=&#8221;center&#8221; global_colors_info=&#8221;{}&#8221;][\/et_pb_post_title][\/et_pb_column][\/et_pb_row][\/et_pb_section][et_pb_section fb_built=&#8221;1&#8243; _builder_version=&#8221;4.14.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_row module_class=&#8221;cardclass&#8221; _builder_version=&#8221;4.14.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_column type=&#8221;4_4&#8243; _builder_version=&#8221;4.14.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;][et_pb_text _builder_version=&#8221;4.14.2&#8243; _module_preset=&#8221;default&#8221; global_colors_info=&#8221;{}&#8221;]\n                            <div class=\"row\">\n                                 \n                                <div class=\"col-lg-12 col-md-12 olp\">\n\t\t\t\t\t\t\t\t<div class=\"panel-inner-main\"> \n\t\t\t\t\t\t\t\t<div class=\"panel-inner-header\">\n\t\t\t\t\t\t\t\t\t<h4 class=\"panel-inner-header-text\">Cart details <\/h4>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<div class=\"panel-inner-body\">\n                                    <div class=\"msgdlt\"><\/div>\n\t\t\t\t\t\t\t\t\t<div class=\"pull-btn-right\"><a href=\"http:\/\/kangratemples.hp.gov.in\/hi\/\" class=\"btn btn-sm btn-success\">Add More Product to Cart<\/a><\/div>\n                                                <div class=\"table-responsive\">\n\t\t\t\t\t\t\t\t\t\t\t\t<table class=\"table table-bordered no-footer\"\" width=\"100%\" >\n                                                <thead>\n\t\t\t\t\t\t\t\t\t\t\t\t<tr> \n                                                  <th width=\"5%\"><\/th>\n                                                  <th width=\"10%\">Image<\/th>\n                                                  <th width=\"15%\">\u092e\u0902\u0926\u093f\u0930 \u0915\u093e \u0928\u093e\u092e<\/th>\n                                                  <th width=\"15%\">Product<\/th>\n\t\t\t\t\t\t\t\t\t\t\t\t  <th width=\"20%\">Product detail<\/th>\n                                                  <th width=\"10%\">Price<\/th>\n                                                  <th width=\"15%\">Quantity<\/th>\n                                                  <th width=\"10%\">Subtotal<\/th>\n                                                <\/tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<\/thead>\n                                                <tr><td colspan='5'><p style='color:red; text:center;'><b>Your Cart Is Empty.<\/b><\/p><td><\/tr> \n                                              <\/table>\n\t\t\t\t\t\t\t\t\t\t\t   <\/div>\n\t\t\t\t\t\t\t\t\t\t\t   <\/div>\n\t\t\t\t\t\t\t\t\t\t\t   <\/div>\n\t\n\t\n\n                                                \n                                                \n                                        \n                    <\/div>\n                <\/div>\n            <\/div>[\/et_pb_text][\/et_pb_column][\/et_pb_row][\/et_pb_section]<\/p>","protected":false},"excerpt":{"rendered":"<div class=\"row\">\n                                 \n                                <div class=\"col-lg-12 col-md-12 olp\">\n\t\t\t\t\t\t\t\t<div class=\"panel-inner-main\"> \n\t\t\t\t\t\t\t\t<div class=\"panel-inner-header\">\n\t\t\t\t\t\t\t\t\t<h4 class=\"panel-inner-header-text\">Cart details <\/h4>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<div class=\"panel-inner-body\">\n                                    <div class=\"msgdlt\"><\/div>\n\t\t\t\t\t\t\t\t\t<div class=\"pull-btn-right\"><a href=\"http:\/\/kangratemples.hp.gov.in\/hi\/\" class=\"btn btn-sm btn-success\">Add More Product to Cart<\/a><\/div>\n                                                <div class=\"table-responsive\">\n\t\t\t\t\t\t\t\t\t\t\t\t<table class=\"table table-bordered no-footer\"\" width=\"100%\" >\n                                                <thead>\n\t\t\t\t\t\t\t\t\t\t\t\t<tr> \n                                                  <th width=\"5%\"><\/th>\n                                                  <th width=\"10%\">Image<\/th>\n                                                  <th width=\"15%\">\u092e\u0902\u0926\u093f\u0930 \u0915\u093e \u0928\u093e\u092e<\/th>\n                                                  <th width=\"15%\">Product<\/th>\n\t\t\t\t\t\t\t\t\t\t\t\t  <th width=\"20%\">Product detail<\/th>\n                                                  <th width=\"10%\">Price<\/th>\n                                                  <th width=\"15%\">Quantity<\/th>\n                                                  <th width=\"10%\">Subtotal<\/th>\n                                                <\/tr>\n\t\t\t\t\t\t\t\t\t\t\t\t<\/thead>\n                                                <tr><td colspan='5'><p style='color:red; text:center;'><b>Your Cart Is Empty.<\/b><\/p><td><\/tr> \n                                              <\/table>\n\t\t\t\t\t\t\t\t\t\t\t   <\/div>\n\t\t\t\t\t\t\t\t\t\t\t   <\/div>\n\t\t\t\t\t\t\t\t\t\t\t   <\/div>\n\t\n\t\n\n                                                \n                                                \n                                        \n                    <\/div>\n                <\/div>\n            <\/div>","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"on","_et_pb_old_content":"","_et_gb_content_width":""},"acf":[],"_links":{"self":[{"href":"http:\/\/kangratemples.hp.gov.in\/hi\/wp-json\/wp\/v2\/pages\/1972"}],"collection":[{"href":"http:\/\/kangratemples.hp.gov.in\/hi\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/kangratemples.hp.gov.in\/hi\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/kangratemples.hp.gov.in\/hi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/kangratemples.hp.gov.in\/hi\/wp-json\/wp\/v2\/comments?post=1972"}],"version-history":[{"count":11,"href":"http:\/\/kangratemples.hp.gov.in\/hi\/wp-json\/wp\/v2\/pages\/1972\/revisions"}],"predecessor-version":[{"id":3057,"href":"http:\/\/kangratemples.hp.gov.in\/hi\/wp-json\/wp\/v2\/pages\/1972\/revisions\/3057"}],"wp:attachment":[{"href":"http:\/\/kangratemples.hp.gov.in\/hi\/wp-json\/wp\/v2\/media?parent=1972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}