Subversion Repositories SmartDukaan

Rev

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

Rev 17905 Rev 17907
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
	}
-
 
59
}
54
}
60
$(function(){
55
$(function(){
61
	loadCartDetails();
56
	loadCartDetails();
62
});
57
});
63
$(document).on('click','.number-spinner button',function(){
58
$(document).on('click','.number-spinner button',function(){
Line 100... Line 95...
100
			}
95
			}
101
		}else{
96
		}else{
102
			newVal = parseInt(oldValue);
97
			newVal = parseInt(oldValue);
103
			btn.prop("disabled", true);
98
			btn.prop("disabled", true);
104
		}
99
		}
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
		}
-
 
110
		totalCartQuantity = totalCartQuantity + inc;
100
		totalCartQuantity = totalCartQuantity + inc;
111
	} else {
101
	} else {
112
		if ( input.attr('min') == undefined || parseInt(input.val()) > parseInt(input.attr('min')) ) {
102
		if ( input.attr('min') == undefined || parseInt(input.val()) > parseInt(input.attr('min')) ) {
113
		    dec = 1;
103
		    dec = 1;
114
			newVal = parseInt(oldValue) - dec;
104
			newVal = parseInt(oldValue) - dec;
115
		}else{
105
		}else{
116
			btn.prop("disabled", true);
106
			btn.prop("disabled", true);
117
		}
107
		}
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
		}
-
 
123
		totalCartQuantity = totalCartQuantity - dec;
108
		totalCartQuantity = totalCartQuantity - dec;
124
	}
109
	}
125
    
110
    
126
	btn.closest('.number-spinner').find('input').val(newVal);
111
	btn.closest('.number-spinner').find('input').val(newVal);
127
	if(cartDetailsObj==undefined){
112
	if(cartDetailsObj==undefined){
Line 294... Line 279...
294
        'city'    			: $('#city').val(),
279
        'city'    			: $('#city').val(),
295
        'phone'				: $('#phone').val(),
280
        'phone'				: $('#phone').val(),
296
        'state'				: $('#state').val(),
281
        'state'				: $('#state').val(),
297
        'pin'				: $('#pin').val()
282
        'pin'				: $('#pin').val()
298
    };
283
    };
299
    console.log	(formData);
284
    debugger;
-
 
285
    if (!$myForm[0].checkValidity()) {
-
 
286
    	return;
-
 
287
    }
300
    payOption = $(this).data('name');
288
    payOption = $(this).data('name');
301
    $.ajax({
289
    $.ajax({
302
                method: "POST",
290
                method: "POST",
303
                url:  apihost + "shippings/submitcheck",
291
                url:  apihost + "shippings/submitcheck",
304
                data: formData,
292
                data: formData,
Line 316... Line 304...
316
            	}    	                    
304
            	}    	                    
317
            }); 
305
            }); 
318
	});
306
	});
319
 
307
 
320
function confirmPrepaid(addressid){
308
function confirmPrepaid(addressid){
321
	if (typeof addressid=="object"){
309
	if (typeof addressid=="undefined"){
322
		addressid=$("input.css-checkbox:checked").val();
310
		addressid=$("input.css-checkbox:checked").val();
323
	}
311
	}
324
	var url = apihost + 'checkout/?user_id='+me+'&cod=0';
312
	var url = apihost + 'checkout/?user_id='+me+'&cod=0';
325
    var newForm = $('<form>', {
313
    var newForm = $('<form>', {
326
        'action': url,
314
        'action': url,
Line 337... Line 325...
337
    newForm.submit();
325
    newForm.submit();
338
}
326
}
339
 
327
 
340
function confirmCheckout(addressid){
328
function confirmCheckout(addressid){
341
	var url = apihost + 'checkout/?user_id='+me+'&cod=1';
329
	var url = apihost + 'checkout/?user_id='+me+'&cod=1';
342
	if (typeof addressid=="object"){
330
	if (typeof addressid=="undefined"){
343
		addressid=$("input.css-checkbox:checked").val();
331
		addressid=$("input.css-checkbox:checked").val();
344
	}
332
	}
345
    var newForm = $('<form>', {
333
    var newForm = $('<form>', {
346
        'action': url,
334
        'action': url,
347
        'method':'post'
335
        'method':'post'