Subversion Repositories SmartDukaan

Rev

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

Rev 22092 Rev 22095
Line 350... Line 350...
350
		$("#cart_bar").find('span').text(Object.keys(bag).length);
350
		$("#cart_bar").find('span').text(Object.keys(bag).length);
351
	}
351
	}
352
}
352
}
353
 
353
 
354
function emptyBag(){
354
function emptyBag(){
355
	localStorage.removeItem("bag");
355
	localStorage.setItem("bag",JSON.stringify({}));
356
	$("#cart_bar").find('span').text(0);
356
	$("#cart_bar").find('span').text(0);
357
}
357
}
358
 
358
 
359
function loadCart(domId){
359
function loadCart(domId){
360
	jQuery.ajax({
360
	jQuery.ajax({
Line 367... Line 367...
367
    });  
367
    });  
368
}
368
}
369
 
369
 
370
function checkout(domId){
370
function checkout(domId){
371
	jQuery.ajax({
371
	jQuery.ajax({
372
        type : "POST",
372
        type : "GET",
373
        data: {"cartData":localStorage.getItem("bag")},
373
        data: {"cartData":localStorage.getItem("bag")},
374
        url : context+"/validate-cart",
374
        url : context+"/validate-cart",
375
        success : function(response) {
375
        success : function(response) {
376
        	var obj = JSON.parse(response);
376
        	var obj = JSON.parse(response);
377
        	redirectCart(obj.redirectUrl, obj.params, obj.method, "main-content");
377
        	redirectCart(obj.redirectUrl, obj.params, obj.method, "main-content");
-
 
378
        	$('#main-content').html(response);
378
        }
379
        }
379
    });  
380
    });  
380
}
381
}
381
 
382
 
382
function redirectCart(url, cartData, method, domId){
383
function redirectCart(url, cartData, method, domId){