Subversion Repositories SmartDukaan

Rev

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

Rev 27658 Rev 27754
Line 6... Line 6...
6
			return;
6
			return;
7
		}else {
7
		}else {
8
			loadCart("main-content", value);
8
			loadCart("main-content", value);
9
		}
9
		}
10
	}
10
	}
11
	$(".cart_icon_header").live('click', function() {
11
	$(document).on('click', ".cart_icon_header", function() {
12
		if(typeof hasGift=="undefined") {
12
		if(typeof hasGift=="undefined") {
13
			hasGift = false;
13
			hasGift = false;
14
		}
14
		}
15
		if(hasGift) {
15
		if(hasGift) {
16
			bootBoxObj = { 
16
			bootBoxObj = { 
Line 25... Line 25...
25
				loadCart('main-content', 0);
25
				loadCart('main-content', 0);
26
		}
26
		}
27
	});
27
	});
28
	
28
	
29
	
29
	
30
	$(".cart-checkout").live('click', function() {
30
	$(document).on('click', ".cart-checkout", function() {
31
		checkout("main-content");
31
		checkout("main-content");
32
	});
32
	});
33
	
33
	
34
	$(".add-bag-submit").live('click', function() {
34
	$(document).on('click', ".add-bag-submit", function() {
35
		added=false;
35
		added=false;
36
		$('#catalogModalBody').hide();
36
		$('#catalogModalBody').hide();
37
		var itemId = $(this).closest('tr').attr('data');
37
		var itemId = $(this).closest('tr').attr('data');
38
		$("#bagModel .itemId").val(itemId);
38
		$("#bagModel .itemId").val(itemId);
39
		$("#bagModel .quantity").val(0);
39
		$("#bagModel .quantity").val(0);
Line 70... Line 70...
70
		
70
		
71
	});
71
	});
72
	
72
	
73
	// addToBagButton
73
	// addToBagButton
74
	
74
	
75
	$("#addToBagButton").live('click', function() {
75
	$(document).on('click', "#addToBagButton", function() {
76
		var itemId = $("#bagModel .itemId").val();
76
		var itemId = $("#bagModel .itemId").val();
77
		var tempAvailability = $("#bagModel .availability").val();
77
		var tempAvailability = $("#bagModel .availability").val();
78
		var quantity = $("#bagModel .quantity").val();
78
		var quantity = $("#bagModel .quantity").val();
79
		imeiCount = $('h4.bagModalEarlyImeis').find('input').length;
79
		imeiCount = $('h4.bagModalEarlyImeis').find('input').length;
80
		if(imeiCount > 0) {
80
		if(imeiCount > 0) {
Line 109... Line 109...
109
		
109
		
110
		});	
110
		});	
111
		
111
		
112
	});
112
	});
113
	
113
	
114
	$(".cart-trash").live('click',function(){
114
	$(document).on('click', ".cart-trash",function(){
115
		var itemId = $(this).attr('data');
115
		var itemId = $(this).attr('data');
116
		removeItemFromLocalStorage(itemId);
116
		removeItemFromLocalStorage(itemId);
117
		$('div[itemId="' + itemId + '"]').remove();
117
		$('div[itemId="' + itemId + '"]').remove();
118
		if ($('#cart-details').html().trim() == ""){
118
		if ($('#cart-details').html().trim() == ""){
119
			$('#cart-details-empty').show();
119
			$('#cart-details-empty').show();
120
			$('#cart-checkout').hide();
120
			$('#cart-checkout').hide();
121
		}
121
		}
122
	});
122
	});
123
	
123
	
124
	
124
	
125
	$(".bill-now").live('click',function(){
125
	$(document).on('click', ".bill-now",function(){
126
		emptyBag();
126
		emptyBag();
127
		
127
		
128
		var itemId = $(this).data('itemid');
128
		var itemId = $(this).data('itemid');
129
		var imei = $(this).data('imei');
129
		var imei = $(this).data('imei');
130
		var bagObj = {itemId:itemId,displayName:"", quantity:1, imeis:[imei]} 
130
		var bagObj = {itemId:itemId,displayName:"", quantity:1, imeis:[imei]} 
131
		addItemInLocalStorage(bagObj);
131
		addItemInLocalStorage(bagObj);
132
		checkout('main-content');
132
		checkout('main-content');
133
	});
133
	});
134
	
134
	
135
	$(".cart-qty").live('change', function() {
135
	$(document).on('change', ".cart-qty", function() {
136
		var itemId = $(this).attr('data');
136
		var itemId = $(this).attr('data');
137
		var maxQty = $(this).attr('max');
137
		var maxQty = $(this).attr('max');
138
		var qty = $(this).val();
138
		var qty = $(this).val();
139
		if (!qty){
139
		if (!qty){
140
			qty = 0;
140
			qty = 0;