Subversion Repositories SmartDukaan

Rev

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

Rev 17907 Rev 17909
Line 49... Line 49...
49
		$(".pmfooter span.badge").text('0');
49
		$(".pmfooter span.badge").text('0');
50
		$(".pmfooter span.carttotalitemsval").text('0');
50
		$(".pmfooter span.carttotalitemsval").text('0');
51
		$(".pmfooter").addClass('hidden');
51
		$(".pmfooter").addClass('hidden');
52
	}
52
	}
53
	}
53
	}
-
 
54
	if(!$('div.pmfooter').hasClass('hidden')) { 
-
 
55
		$('div.content').attr('style', 'margin-bottom: 42px');
-
 
56
	}else{
-
 
57
		$('div.content').attr('style', 'margin-bottom: 0px');
-
 
58
	}
54
}
59
}
55
$(function(){
60
$(function(){
56
	loadCartDetails();
61
	loadCartDetails();
57
});
62
});
58
$(document).on('click','.number-spinner button',function(){
63
$(document).on('click','.number-spinner button',function(){
Line 95... Line 100...
95
			}
100
			}
96
		}else{
101
		}else{
97
			newVal = parseInt(oldValue);
102
			newVal = parseInt(oldValue);
98
			btn.prop("disabled", true);
103
			btn.prop("disabled", true);
99
		}
104
		}
-
 
105
		if(newVal==parseInt(input.attr('max'))){
-
 
106
			input.attr('style', 'border: 2px solid #ff0000');
-
 
107
		}else{
-
 
108
			input.attr('style', 'border: 1px solid #CCCCCC');
-
 
109
		}
100
		totalCartQuantity = totalCartQuantity + inc;
110
		totalCartQuantity = totalCartQuantity + inc;
101
	} else {
111
	} else {
102
		if ( input.attr('min') == undefined || parseInt(input.val()) > parseInt(input.attr('min')) ) {
112
		if ( input.attr('min') == undefined || parseInt(input.val()) > parseInt(input.attr('min')) ) {
103
		    dec = 1;
113
		    dec = 1;
104
			newVal = parseInt(oldValue) - dec;
114
			newVal = parseInt(oldValue) - dec;
105
		}else{
115
		}else{
106
			btn.prop("disabled", true);
116
			btn.prop("disabled", true);
107
		}
117
		}
-
 
118
		if(newVal==parseInt(input.attr('min'))){
-
 
119
			input.attr('style', 'border: 2px solid #5bc0de');
-
 
120
		}else{
-
 
121
			input.attr('style', 'border: 1px solid #CCCCCC');
-
 
122
		}
108
		totalCartQuantity = totalCartQuantity - dec;
123
		totalCartQuantity = totalCartQuantity - dec;
109
	}
124
	}
110
    
125
    
111
	btn.closest('.number-spinner').find('input').val(newVal);
126
	btn.closest('.number-spinner').find('input').val(newVal);
112
	if(cartDetailsObj==undefined){
127
	if(cartDetailsObj==undefined){
Line 304... Line 319...
304
            	}    	                    
319
            	}    	                    
305
            }); 
320
            }); 
306
	});
321
	});
307
 
322
 
308
function confirmPrepaid(addressid){
323
function confirmPrepaid(addressid){
309
	if (typeof addressid=="undefined"){
324
	if (typeof addressid=="object"){
310
		addressid=$("input.css-checkbox:checked").val();
325
		addressid=$("input.css-checkbox:checked").val();
311
	}
326
	}
312
	var url = apihost + 'checkout/?user_id='+me+'&cod=0';
327
	var url = apihost + 'checkout/?user_id='+me+'&cod=0';
313
    var newForm = $('<form>', {
328
    var newForm = $('<form>', {
314
        'action': url,
329
        'action': url,
Line 325... Line 340...
325
    newForm.submit();
340
    newForm.submit();
326
}
341
}
327
 
342
 
328
function confirmCheckout(addressid){
343
function confirmCheckout(addressid){
329
	var url = apihost + 'checkout/?user_id='+me+'&cod=1';
344
	var url = apihost + 'checkout/?user_id='+me+'&cod=1';
330
	if (typeof addressid=="undefined"){
345
	if (typeof addressid=="object"){
331
		addressid=$("input.css-checkbox:checked").val();
346
		addressid=$("input.css-checkbox:checked").val();
332
	}
347
	}
333
    var newForm = $('<form>', {
348
    var newForm = $('<form>', {
334
        'action': url,
349
        'action': url,
335
        'method':'post'
350
        'method':'post'