Subversion Repositories SmartDukaan

Rev

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

Rev 20826 Rev 20864
Line 1... Line 1...
1
<script type="text/javascript"
1
<script type="text/javascript" src="/js/checkout.js?v=<?php echo $staticversion;?>"></script>
2
	src="/js/checkout.js?v=<?php echo $staticversion;?>"></script>
2
<script type="text/javascript" src="/js/jquery-ui.min.js "></script>
3
<script type="text/javascript">
3
<script type="text/javascript">
4
$(document).ready(function(){
4
$(document).ready(function(){
5
	var alpad = " "+($('#footer').height()-45)+"px";
5
	var alpad = " "+($('#footer').height()-45)+"px";
6
	$('#addresslist').css("margin-bottom",alpad);
6
	$('#addresslist').css("margin-bottom",alpad);
7
 
7
 
Line 32... Line 32...
32
		$('button.confirmcheckout').prop( "disabled", false );
32
		$('button.confirmcheckout').prop( "disabled", false );
33
		$('.confirmprepaidDisabled').addClass('confirmprepaid').removeClass('confirmprepaidDisabled');
33
		$('.confirmprepaidDisabled').addClass('confirmprepaid').removeClass('confirmprepaidDisabled');
34
		$('button.confirmcredit').prop( "disabled", false );
34
		$('button.confirmcredit').prop( "disabled", false );
35
		$('button.confirmcod').prop( "disabled", false );
35
		$('button.confirmcod').prop( "disabled", false );
36
	}
36
	}
37
	var totalPayable = <?php echo $totalPayable;?>;
37
	totalPayable = <?php echo $totalPayable;?>;
38
	var creditLimit = <?php echo $creditLimit;?>;
38
	walletAmount = <?php echo $walletAmount;?>;
39
	var creditTicketSize = <?php echo $creditTicketSize;?>;
39
	walletPayable = Math.min(totalPayable, walletAmount);
40
	localStorage.removeItem('creditLimit');
40
	walletUsed = 0;
41
	localStorage.setItem('creditLimit', creditLimit);
-
 
42
	localStorage.removeItem('creditTicketSize');
-
 
43
	localStorage.setItem('creditTicketSize', creditTicketSize);
-
 
44
	localStorage.removeItem('totalPayable');
41
	localStorage.removeItem('totalPayable');
45
	localStorage.setItem('totalPayable', totalPayable);
42
	localStorage.setItem('totalPayable', totalPayable);
-
 
43
	localStorage.removeItem('walletAmount');
-
 
44
	localStorage.setItem('walletAmount', walletAmount);
46
	
45
	
47
	if(cart_details == undefined || creditTicketSize>totalPayable || totalPayable>=creditLimit){
46
	/*if(cart_details == undefined || creditTicketSize>totalPayable || totalPayable>=creditLimit){
48
		$('button.confirmcredit').prop( "disabled", true );
47
		$('button.confirmcredit').prop( "disabled", true );
49
	}else{
48
	}else{
50
		$('button.confirmcredit').prop( "disabled", false );
49
		$('button.confirmcredit').prop( "disabled", false );
51
		var creditAvailable = $("input.css-checkbox:checked").attr('credit_available');
50
		var creditAvailable = $("input.css-checkbox:checked").attr('credit_available');
52
	    if(creditAvailable=='true'){
51
	    if(creditAvailable=='true'){
Line 58... Line 57...
58
	        }
57
	        }
59
	    	$('span#CreditError').html('');
58
	    	$('span#CreditError').html('');
60
	    	$('button.confirmcredit').prop( "disabled", true );
59
	    	$('button.confirmcredit').prop( "disabled", true );
61
	    	$('button.confirmcredit').attr('style', 'margin: 10px 20px 0px 0px; background-color: #B4CAB4; color: #fff;');
60
	    	$('button.confirmcredit').attr('style', 'margin: 10px 20px 0px 0px; background-color: #B4CAB4; color: #fff;');
62
	    }
61
	    }
63
	}
62
	}*/
64
 
63
 
65
	if (window.history && window.history.pushState) {
64
	if (window.history && window.history.pushState) {
66
		$(window).on('popstate', function() {
65
		$(window).on('popstate', function() {
67
        	$('#myModal').modal('hide');
66
        	$('#myModal').modal('hide');
68
            $("#cartloader").addClass('hidden');
67
            $("#cartloader").addClass('hidden');
Line 226... Line 225...
226
						<input type="radio" class="css-checkbox"
225
						<input type="radio" class="css-checkbox"
227
							id='<?php echo $address['addresses'][$firstshowaddress[$i]]['id'];?>'
226
							id='<?php echo $address['addresses'][$firstshowaddress[$i]]['id'];?>'
228
							value='<?php echo $address['addresses'][$firstshowaddress[$i]]['id'];?>'
227
							value='<?php echo $address['addresses'][$firstshowaddress[$i]]['id'];?>'
229
							name="selectedaddress"
228
							name="selectedaddress"
230
							<?php if($defaultselectedaddress == $address['addresses'][$firstshowaddress[$i]]['id']){echo "checked";}?>
229
							<?php if($defaultselectedaddress == $address['addresses'][$firstshowaddress[$i]]['id']){echo "checked";}?>
231
							<?php if($creditorAssociated && $address['addresses'][$firstshowaddress[$i]]['creditOptionAvailable']):?> credit_available="true" <?php else: ?> credit_available="false"<?php endif;?> >
230
							credit_available="false">
232
 
231
 
233
						<label
232
						<label
234
							for="<?php echo $address['addresses'][$firstshowaddress[$i]]['id'];?>"
233
							for="<?php echo $address['addresses'][$firstshowaddress[$i]]['id'];?>"
235
							class="css-label radGroup2"
234
							class="css-label radGroup2"
236
							data-pin="<?php echo $address['addresses'][$firstshowaddress[$i]]['pin'];?>"
235
							data-pin="<?php echo $address['addresses'][$firstshowaddress[$i]]['pin'];?>"
237
							data-id="<?php echo $address['addresses'][$firstshowaddress[$i]]['id'];?>"
236
							data-id="<?php echo $address['addresses'][$firstshowaddress[$i]]['id'];?>"
238
							<?php if($creditorAssociated && $address['addresses'][$firstshowaddress[$i]]['creditOptionAvailable']):?> credit_available="true" <?php else: ?> credit_available="false"<?php endif;?>>
237
							credit_available="false">
239
							<?php
238
							<?php
240
							if(isset($address['addresses'][$firstshowaddress[$i]]['line1']) && !empty($address['addresses'][$firstshowaddress[$i]]['line1']))
239
							if(isset($address['addresses'][$firstshowaddress[$i]]['line1']) && !empty($address['addresses'][$firstshowaddress[$i]]['line1']))
241
							{echo "Address: ",$address['addresses'][$firstshowaddress[$i]]['line1'];}
240
							{echo "Address: ",$address['addresses'][$firstshowaddress[$i]]['line1'];}
242
							if(isset($address['addresses'][$firstshowaddress[$i]]['line2']) && !empty($address['addresses'][$firstshowaddress[$i]]['line2']))
241
							if(isset($address['addresses'][$firstshowaddress[$i]]['line2']) && !empty($address['addresses'][$firstshowaddress[$i]]['line2']))
243
							{echo ",",$address['addresses'][$firstshowaddress[$i]]['line2'];}
242
							{echo ",",$address['addresses'][$firstshowaddress[$i]]['line2'];}
Line 247... Line 246...
247
							{echo ", ",$address['addresses'][$firstshowaddress[$i]]['state'];}
246
							{echo ", ",$address['addresses'][$firstshowaddress[$i]]['state'];}
248
							if(isset($address['addresses'][$firstshowaddress[$i]]['pin']) && !empty($address['addresses'][$firstshowaddress[$i]]['pin']))
247
							if(isset($address['addresses'][$firstshowaddress[$i]]['pin']) && !empty($address['addresses'][$firstshowaddress[$i]]['pin']))
249
							{echo ",",$address['addresses'][$firstshowaddress[$i]]['pin'];}
248
							{echo ",",$address['addresses'][$firstshowaddress[$i]]['pin'];}
250
							?> 
249
							?> 
251
							<br>
250
							<br>
252
							<?php if($creditorAssociated):?>
-
 
253
							<?php if($address['addresses'][$firstshowaddress[$i]]['creditOptionAvailable']):?>
-
 
254
							<i class="glyphicon glyphicon-info-sign" style="font-size: 10px;color: #36BBD9;"> 
-
 
255
							<span style="color: #36BBD9;font-size: 10px;font-family: &quot;Helvetica Neue&quot;,Helvetica,Arial,sans-serif;">Credit Available</span>
-
 
256
							</i>
-
 
257
							<?php endif;?>
-
 
258
							<?php endif;?>
-
 
259
							<?php if($taxInvoiceEnabledUser):?>
251
							<?php if($taxInvoiceEnabledUser):?>
260
							<?php if($address['addresses'][$firstshowaddress[$i]]['taxInvoiceAvailable']):?>
252
							<?php if($address['addresses'][$firstshowaddress[$i]]['taxInvoiceAvailable']):?>
261
							<i class="glyphicon glyphicon-info-sign" style="font-size: 10px;color: #42A150;"> 
253
							<i class="glyphicon glyphicon-info-sign" style="font-size: 10px;color: #42A150;"> 
262
							<span style="color: #42A150;font-size: 10px;font-family: &quot;Helvetica Neue&quot;,Helvetica,Arial,sans-serif;">Tax Invoice Available</span>
254
							<span style="color: #42A150;font-size: 10px;font-family: &quot;Helvetica Neue&quot;,Helvetica,Arial,sans-serif;">Tax Invoice Available</span>
263
							</i>
255
							</i>
Line 308... Line 300...
308
		<!-- /.modal-dialog -->
300
		<!-- /.modal-dialog -->
309
	</div>
301
	</div>
310
	<!-- /.modal -->
302
	<!-- /.modal -->
311
 
303
 
312
	<!-- Cart section started -->
304
	<!-- Cart section started -->
313
	<div class='row' style='padding: 0px;' id='footer'>
305
	<div class="row" style="padding: 0px;" id="footer">
314
		<div class='col-xs-12'
-
 
315
			style='background-color: white; padding: 10px 20px 20px 20px; width: 100%;'>
306
		<div class="col-xs-12" style="background-color: white; padding: 10px 20px 20px 20px; width: 100%;">
316
			<h4 style="margin: 0px; margin-bottom: 8px;">
307
			<h5 style="margin: 0px; margin-bottom: 6px;">
317
				Total payable Amount: <span style="color: #ff0000;"
-
 
318
					id="totalPayable"> &#8377; <?php echo number_format($totalPayable);?>
308
				Total payable Amount: <span style="color: #ff0000;" id="totalPayable"> &#8377;<?php echo number_format($totalPayable);?>
319
				</span>
309
				</span>
320
			</h4>
310
			</h5>
321
			<?php if($creditorAssociated):?>
311
			<?php if($walletAmount > 0):?>
322
				<h5>Confirm Order: Choose Option</h5>
312
				<?php if($walletAmount < $totalPayable): ?>
323
				<?php if($creditTicketSize<=$totalPayable):?>
313
					<div style="margin: 0px; margin-bottom: 6px;">
-
 
314
						<a href="javascript:void(0);" style="font-size: 12px;width:97px" class="usewallet btn btn-success btn-xs">
-
 
315
							Use Wallet 	
-
 
316
						</a><span id="walletAmount">(&#8377;<?php echo number_format($walletAmount);?>)</span>
-
 
317
					</div>
-
 
318
					<h5 id="netpayable" style="margin: 0px; margin-bottom: 6px; visibility:hidden;">
-
 
319
						Net payable Amount: <span style="color: #ff0000;padding-left:9px" id="totalPayable"> &#8377;<?php echo number_format($totalPayable - $walletAmount);?></span>
-
 
320
					</h5>
324
					<?php if($creditLimit>=$totalPayable):?>
321
					<?php if($codAvailable):?>
-
 
322
					<a href="#" style="padding-right: 2px; color: blue; font-size: 15px;" class="confirmprepaid">
-
 
323
						<u>Other Pay Option</u> 
-
 
324
					</a>
-
 
325
					<button class="btn btn-success confirmcheckout pull-right">Confirm Order via COD</button>
-
 
326
					<?php else:?>
-
 
327
						<span style='padding-right: 2px; color: red; font-size: 15px;'>*COD Not Available</span>
-
 
328
						<button class="btn btn-success confirmprepaid pull-right">Other Pay Option</button>
-
 
329
					<?php endif;?>
-
 
330
				<?php else:?>
325
						<?php if($codAvailable):?>
331
					<?php if($codAvailable):?>
326
						<div class="col-xs-12" style="margin-left: 20px;">
332
						<div class="col-xs-12" style="margin-left: 20px;">
327
							<div class="col-xs-4">
333
							<div class="col-xs-4">
328
								<button type="button" class="btn btn-md confirmprepaid"
334
								<button type="button" class="btn btn-md confirmprepaid"
329
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
335
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
330
								<br>
336
								<br>
Line 335... Line 341...
335
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">COD</button>
341
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">COD</button>
336
								<br>
342
								<br>
337
									<span style="font-size: 8px;">&nbsp;<span style="color:#ff0000;font-size:12px;"> &nbsp;</span></span>
343
									<span style="font-size: 8px;">&nbsp;<span style="color:#ff0000;font-size:12px;"> &nbsp;</span></span>
338
							</div>
344
							</div>
339
							<div class="col-xs-4" style="padding:0px;">
345
							<div class="col-xs-4" style="padding:0px;">
340
								<button type="button" class="btn btn-md confirmcredit"
346
								<button type="button" class="btn btn-md confirmwallet"
341
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Credit</button>
347
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Use Wallet</button>
342
								<br>
348
								<br>
343
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
349
								<span style="font-size: 8px;">Wallet Amount<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($walletAmount);?></span></span>
344
							</div>
350
							</div>
345
						</div>
351
						</div>
346
						<?php else:?>
352
					<?php else:?>
347
						<div class="col-xs-12" style="margin-left: 20px;">
353
						<div class="col-xs-12" style="margin-left: 20px;">
348
							<div class="col-xs-4">
354
							<div class="col-xs-4">
349
								<span
355
								<span
350
									style='padding-right: 2px; color: red; font-size: 12px; " margin: 0px 10px 0px 0px;'>*COD
356
									style='padding-right: 2px; color: red; font-size: 12px; " margin: 0px 10px 0px 0px;'>*COD
351
									Not Available</span>
357
									Not Available</span>
Line 354... Line 360...
354
								<button type="button" class="btn btn-md confirmprepaid"
360
								<button type="button" class="btn btn-md confirmprepaid"
355
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
361
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
356
							</div>
362
							</div>
357
							<div class="col-xs-4" style="padding:0px;">
363
							<div class="col-xs-4" style="padding:0px;">
358
								<button type="button" class="btn btn-md confirmcredit"
364
								<button type="button" class="btn btn-md confirmcredit"
359
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;padding-right: 30px;padding-left: 30px;">Credit</button>
365
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;padding-right: 30px;padding-left: 30px;">Wallet</button>
360
								<br>
366
								<br>
361
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
367
								<span style="font-size: 8px;">Wallet Amout<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($walletAmount);?></span></span>
362
							</div>
368
							</div>
363
						</div>
369
						</div>
364
						<?php endif;?>
-
 
365
					<?php else:?>
-
 
366
							<span id="CreditError"  style='color: red; font-size: 11px; " margin: 0px 10px 0px 0px;'>* Your Credit Limit is less than Order Amount. <br>* आपकी उपलब्ध क्रेडिट लिमिट आर्डर राशि से कम है। </span>
-
 
367
							<?php if($codAvailable):?>
-
 
368
							<div class="col-xs-12" style="margin-left: 20px;">
-
 
369
								<div class="col-xs-4">
-
 
370
									<button type="button" class="btn btn-md confirmprepaid"
-
 
371
										style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
-
 
372
									<br>
-
 
373
									<span style="font-size: 8px;">&nbsp;<span style="color:#ff0000;font-size:12px;"> &nbsp;</span></span>
-
 
374
								</div>
-
 
375
								<div class="col-xs-4">
-
 
376
									<button type="button" class="btn btn-md confirmcod"
-
 
377
										style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">COD</button>
-
 
378
									<br>
-
 
379
									<span style="font-size: 8px;">&nbsp;<span style="color:#ff0000;font-size:12px;"> &nbsp;</span></span>
-
 
380
								</div>
-
 
381
								<div class="col-xs-4" style="padding:0px;">
-
 
382
									<button type="button" class="btn btn-md confirmcredit"
-
 
383
										style="margin: 10px 20px 0px 0px; background-color: #B4CAB4; color: #fff;"
-
 
384
										disabled="true">Credit</button>
-
 
385
									<br>
-
 
386
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
-
 
387
								</div>
-
 
388
							</div>
-
 
389
							<?php else:?>
-
 
390
							<div class="col-xs-12" style="margin-left: 20px;">
-
 
391
								<div class="col-xs-4">
-
 
392
									<span
-
 
393
										style='padding-right: 2px; color: red; font-size: 12px; " margin: 0px 10px 0px 0px;'>*COD
-
 
394
										Not Available</span>
-
 
395
								</div>
-
 
396
								<div class="col-xs-4">
-
 
397
									<button type="button" class="btn btn-md confirmprepaid"
-
 
398
										style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
-
 
399
								</div>
-
 
400
								<div class="col-xs-4" style="padding:0px;">
-
 
401
									<button type="button" class="btn btn-md confirmcredit"
-
 
402
										style="margin: 10px 20px 0px 0px; background-color: #B4CAB4; color: #fff;"
-
 
403
										disabled="true">Credit</button>
-
 
404
									<br>
-
 
405
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
-
 
406
								</div>
-
 
407
							</div>
-
 
408
							<?php endif;?>
-
 
409
					<?php endif;?>
370
					<?php endif;?>
410
				<?php else:?>
-
 
411
						<span id="CreditError"  style='color: red; font-size: 11px; " margin: 0px 10px 0px 0px;'>* Minimum Order Amount Should be  &#8377; <?php echo number_format($creditTicketSize);?> for Credit <br>* क्रेडिट के लिए न्यूनतम आर्डर राशि  &#8377; <?php echo number_format($creditTicketSize);?> होनी चाहिए ।</span>
-
 
412
							<?php if($codAvailable):?>
-
 
413
							<div class="col-xs-12" style="margin-left: 20px;">
-
 
414
								<div class="col-xs-4">
-
 
415
									<button type="button" class="btn btn-md confirmprepaid"
-
 
416
										style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
-
 
417
									<br>
-
 
418
									<span style="font-size: 8px;">&nbsp;<span style="color:#ff0000;font-size:12px;"> &nbsp;</span></span>
-
 
419
								</div>
-
 
420
								<div class="col-xs-4">
-
 
421
									<button type="button" class="btn btn-md confirmcod"
-
 
422
										style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">COD</button>
-
 
423
										<br>
-
 
424
									<span style="font-size: 8px;">&nbsp;<span style="color:#ff0000;font-size:12px;"> &nbsp;</span></span>
-
 
425
								</div>
-
 
426
								<div class="col-xs-4" style="padding:0px;">
-
 
427
									<button type="button" class="btn btn-md confirmcredit"
-
 
428
										style="margin: 10px 20px 0px 0px; background-color: #B4CAB4; color: #fff;"
-
 
429
										disabled="true">Credit</button>
-
 
430
									<br>
-
 
431
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
-
 
432
								</div>
-
 
433
							</div>
-
 
434
							<?php else:?>
-
 
435
							<div class="col-xs-12" style="margin-left: 20px;">
-
 
436
								<div class="col-xs-4">
-
 
437
									<span
-
 
438
										style='padding-right: 2px; color: red; font-size: 12px; " margin: 0px 10px 0px 0px;'>*COD Not Available</span>
-
 
439
								</div>
-
 
440
								<div class="col-xs-4">
-
 
441
									<button type="button" class="btn btn-md confirmprepaid"
-
 
442
										style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
-
 
443
								</div>
-
 
444
								<div class="col-xs-4" style="padding:0px;">
-
 
445
									<button type="button" class="btn btn-md confirmcredit"
-
 
446
										style="margin: 10px 20px 0px 0px; background-color: #B4CAB4; color: #fff;"
-
 
447
										disabled="true">Credit</button>
-
 
448
									<br>
-
 
449
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
-
 
450
								</div>
-
 
451
							</div>
-
 
452
							<?php endif;?>
-
 
453
				<?php endif;?>
371
				<?php endif;?>				
454
			<?php else:?>
372
			<?php else:?>
-
 
373
				<div style="margin: 0px; margin-bottom: 6px;">
455
				<?php if($codAvailable):?>
374
					<?php if($codAvailable):?>
456
				<a href="#" style='padding-right: 2px; color: blue; font-size: 15px;'
375
						<a href="#" style="padding-right: 2px; color: blue; font-size: 15px;" class="confirmprepaid">
457
					class="confirmprepaid"><u>Other Pay Option</u> </a>
376
							<u>Other Pay Option</u> 
-
 
377
						</a>
458
				<button class="btn btn-success confirmcheckout pull-right">Confirm Order via COD</button>
378
						<button class="btn btn-success confirmcheckout pull-right">Confirm Order via COD</button>
459
				<?php else:?>
379
					<?php else:?>
460
				<span style='padding-right: 2px; color: red; font-size: 15px;'>*COD Not Available</span>
380
						<span style='padding-right: 2px; color: red; font-size: 15px;'>*COD Not Available</span>
461
				<button class="btn btn-success confirmprepaid pull-right">Other Pay Option</button>
381
						<button class="btn btn-success confirmprepaid pull-right">Other Pay Option</button>
462
				<?php endif;?>
382
					<?php endif;?>
-
 
383
				</div>
463
			<?php endif;?>
384
			<?php endif;?>
464
 
-
 
465
		</div>
385
		</div>
466
	</div>
386
	</div>
467
 
387
 
468
	<!-- Cart section end -->
388
	<!-- Cart section end -->
469
</div>
389
</div>