Subversion Repositories SmartDukaan

Rev

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

Rev 17915 Rev 17916
Line 285... Line 285...
285
    }
285
    }
286
});
286
});
287
 
287
 
288
 
288
 
289
 
289
 
290
$(document).on('submit', '.submit_check', function(){
290
$(document).on('submit', '#form2', function(){
291
	var formData = {
291
	var formData = {
292
        'name'              : $('#name').val(),
292
        'name'              : $('#name').val(),
293
        'line1'             : $('#line1').val(),
293
        'line1'             : $('#line1').val(),
294
        'city'    			: $('#city').val(),
294
        'city'    			: $('#city').val(),
295
        'phone'				: $('#phone').val(),
295
        'phone'				: $('#phone').val(),
296
        'state'				: $('#state').val(),
296
        'state'				: $('#state').val(),
297
        'pin'				: $('#pin').val()
297
        'pin'				: $('#pin').val()
298
    };
298
    };
-
 
299
    
299
    debugger;
300
    /*debugger;
300
    if (!$("#form2")[0].checkValidity()) {
301
    if (!$("#form2")[0].checkValidity()) {
301
    	return;
302
    	return;
-
 
303
    }*/
302
    }
304
    
303
    payOption = $(this).data('name');
305
    payOption = $(this).data('name');
304
    $.ajax({
306
    $.ajax(
-
 
307
    	{
305
                method: "POST",
308
                method: "POST",
306
                url:  apihost + "shippings/submitcheck",
309
                url:  apihost + "shippings/submitcheck",
307
                data: formData,
310
                data: formData,
308
            },'json').done(function(msg){ 
311
        },'json')
309
            	console.log(msg);
312
        .done(function(msg){ 
310
            	if(msg=='')
313
    	if(msg==''){	
311
            	{	
-
 
312
            		window.location.replace(apihost + "shippings/index/"+msg);
314
    		window.location.replace(apihost + "shippings/index/"+msg);
313
            	} else {
315
    	} else {
314
            		if(payOption=='cod'){
316
    		if(payOption=='cod'){
315
            			confirmCheckout(msg);
317
    			confirmCheckout(msg);
316
            		} else if (payOption=='other_option'){
318
    		} else if (payOption=='other_option'){
317
            			confirmPrepaid(msg);
319
    			confirmPrepaid(msg);
318
            		}
320
    		}
319
            	}    	                    
321
    	}    	                    
320
            }); 
322
	}); 
321
	});
323
});
322
 
324
 
323
function confirmPrepaid(addressid){
325
function confirmPrepaid(addressid){
324
	if (typeof addressid=="object"){
326
	if (typeof addressid=="object"){
325
		addressid=$("input.css-checkbox:checked").val();
327
		addressid=$("input.css-checkbox:checked").val();
326
	}
328
	}