Subversion Repositories SmartDukaan

Rev

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

Rev 17893 Rev 17905
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 301... Line 316...
301
            	}    	                    
316
            	}    	                    
302
            }); 
317
            }); 
303
	});
318
	});
304
 
319
 
305
function confirmPrepaid(addressid){
320
function confirmPrepaid(addressid){
306
	if (typeof addressid=="undefined"){
321
	if (typeof addressid=="object"){
307
		addressid=$("input.css-checkbox:checked").val();
322
		addressid=$("input.css-checkbox:checked").val();
308
	}
323
	}
309
	var url = apihost + 'checkout/?user_id='+me+'&cod=0';
324
	var url = apihost + 'checkout/?user_id='+me+'&cod=0';
310
    var newForm = $('<form>', {
325
    var newForm = $('<form>', {
311
        'action': url,
326
        'action': url,
Line 322... Line 337...
322
    newForm.submit();
337
    newForm.submit();
323
}
338
}
324
 
339
 
325
function confirmCheckout(addressid){
340
function confirmCheckout(addressid){
326
	var url = apihost + 'checkout/?user_id='+me+'&cod=1';
341
	var url = apihost + 'checkout/?user_id='+me+'&cod=1';
327
	if (typeof addressid=="undefined"){
342
	if (typeof addressid=="object"){
328
		addressid=$("input.css-checkbox:checked").val();
343
		addressid=$("input.css-checkbox:checked").val();
329
	}
344
	}
330
    var newForm = $('<form>', {
345
    var newForm = $('<form>', {
331
        'action': url,
346
        'action': url,
332
        'method':'post'
347
        'method':'post'