Subversion Repositories SmartDukaan

Rev

Rev 18817 | Rev 18821 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
18718 manish.sha 1
<script type="text/javascript"
2
	src="/js/checkout.js?v=<?php echo $staticversion;?>"></script>
17959 manish.sha 3
<script type="text/javascript">
4
$(document).ready(function(){
5
	var cart_details = localStorage.getItem("cart_details");
6
	if(cart_details == undefined){
7
		$('span#totalPayable').text(' ₹ 0');
8
		$('button.confirmcheckout').prop( "disabled", true );
17967 manish.sha 9
		$('.confirmprepaid').addClass('confirmprepaidDisabled').removeClass('confirmprepaid');
18633 manish.sha 10
		$('button.confirmcredit').prop( "disabled", true );
18718 manish.sha 11
		$('button.confirmcod').prop( "disabled", true );
18819 manish.sha 12
		$('span#CreditError').html('');
17959 manish.sha 13
	}else{
14
		$('button.confirmcheckout').prop( "disabled", false );
17967 manish.sha 15
		$('.confirmprepaidDisabled').addClass('confirmprepaid').removeClass('confirmprepaidDisabled');
18633 manish.sha 16
		$('button.confirmcredit').prop( "disabled", false );
18718 manish.sha 17
		$('button.confirmcod').prop( "disabled", false );
17959 manish.sha 18
	}
18718 manish.sha 19
	var totalPayable = <?php echo $totalPayable;?>;
20
	var creditLimit = <?php echo $creditLimit;?>;
21
	var creditTicketSize = <?php echo $creditTicketSize;?>;
18773 manish.sha 22
	localStorage.removeItem('creditLimit');
23
	localStorage.setItem('creditLimit', creditLimit);
18768 manish.sha 24
	localStorage.removeItem('creditTicketSize');
18775 manish.sha 25
	localStorage.setItem('creditTicketSize', creditTicketSize);
18768 manish.sha 26
	localStorage.removeItem('totalPayable');
27
	localStorage.setItem('totalPayable', totalPayable);
28
 
18718 manish.sha 29
	if(cart_details == undefined || creditTicketSize>totalPayable || totalPayable>=creditLimit){
30
		$('button.confirmcredit').prop( "disabled", true );
31
	}else{
32
		$('button.confirmcredit').prop( "disabled", false );
18768 manish.sha 33
		var creditAvailable = $("input.css-checkbox:checked").attr('credit_available');
34
	    if(creditAvailable=='true'){
35
	    	$('button.confirmcredit').prop( "disabled", false );
36
	    	$('button.confirmcredit').attr('style', 'background-color: #5cb85c;color: #fff');
37
	    }else{
38
	    	$('button.confirmcredit').prop( "disabled", true );
39
	    	$('button.confirmcredit').attr('style', 'background-color: #B4CAB4');
40
	    }
18718 manish.sha 41
	}
42
 
43
	if (window.history && window.history.pushState) {
44
		$(window).on('popstate', function() {
45
        	$('#myModal').modal('hide');
46
            $("#cartloader").addClass('hidden');
47
            if(typeof history.checkoutForm != "undefined"){
48
                history.checkoutForm.submit();
49
            }
50
        });
51
    }
17959 manish.sha 52
});
53
</script>
18718 manish.sha 54
<link rel="stylesheet" href="/css/hexdots.css" type="text/css">
17794 naman 55
<style>
17840 manish.sha 56
#footer {
57
	position: fixed;
58
	/*height:50px;*/
59
	/*background-color:red;*/
60
	bottom: 0px;
61
	left: 0px;
62
	right: 0px;
63
	margin-bottom: 0px;
17794 naman 64
}
65
 
17840 manish.sha 66
#message,#message_success {
67
	position: fixed;
68
	/*height:50px;*/
69
	/*background-color:red;*/
70
	/*background-color: white;*/
71
	top: 0px;
72
	left: 0px;
73
	right: 0px;
74
	margin-top: 0px;
75
	z-index: 10;
17794 naman 76
}
77
 
17840 manish.sha 78
.addressselect {
79
	background-color: #D9FACF;
17794 naman 80
}
17840 manish.sha 81
 
17794 naman 82
input[type=radio].css-checkbox {
17840 manish.sha 83
	position: absolute;
84
	z-index: -1000;
85
	left: -1000px;
86
	overflow: hidden;
87
	clip: rect(0, 0, 0, 0);
88
	height: 1px;
89
	width: 1px;
90
	margin: -1px;
91
	padding: 0;
92
	border: 0;
93
}
17794 naman 94
 
17840 manish.sha 95
input[type=radio].css-checkbox+label.css-label {
96
	padding-left: 21px;
18718 manish.sha 97
	padding-bottom: 10px;
17840 manish.sha 98
	height: 16px;
99
	display: inline-block;
100
	line-height: 16px;
101
	background-repeat: no-repeat;
102
	background-position: 0 0;
103
	/*font-size:16px;*/
104
	vertical-align: middle;
105
	cursor: pointer;
106
}
17794 naman 107
 
17840 manish.sha 108
input[type=radio].css-checkbox:checked+label.css-label {
109
	background-position: 0 -16px;
110
}
17794 naman 111
 
17840 manish.sha 112
label.css-label {
113
	background-image: url(../img/radio.png);
114
	-webkit-touch-callout: none;
115
	-webkit-user-select: none;
116
	-khtml-user-select: none;
117
	-moz-user-select: none;
118
	-ms-user-select: none;
119
	user-select: none;
17794 naman 120
}
17882 naman 121
 
18718 manish.sha 122
.custom_class {
123
	color: red;
124
}
125
#cartloader{
126
    position:absolute;
127
    /*top:40%;*/
128
    left:50%;
129
    z-index:2001;
130
}
17794 naman 131
</style>
17882 naman 132
<?php
18718 manish.sha 133
if($message != null){?>
134
<script>
17882 naman 135
            $(document).ready(function(){
136
                 $('#message').empty();
137
                 $('#message').append("Location is not serviceable...");
138
                 $('#message').removeClass('hidden');
139
 
140
                 setTimeout(function() {
141
                    $('#message').addClass('hidden');
142
                }, 2000);  
143
            });
144
        </script>
145
<?php }?>
146
<div class="modal fade" id="loadingModal">
18718 manish.sha 147
	<div class="modal-dialog">
148
		<div class="modal-content">
149
			<div class="modal-body">
150
				<div class="text-center">
151
					<img src="/img/ajax-loader.gif" />
152
				</div>
153
			</div>
154
		</div>
155
		<!-- /.modal-content -->
156
	</div>
157
	<!-- /.modal-dialog -->
17882 naman 158
</div>
18718 manish.sha 159
<div
160
	class="alert alert-danger hidden" id="message"></div>
161
<div
162
	class="alert alert-success hidden" id="message_success"></div>
17794 naman 163
 
18718 manish.sha 164
<div class="text-center hidden" id="cartloader">
165
	<br><br>
166
    <div class="hexdots-loader"></div>         
167
</div>
168
<div
169
	class='container' style='margin-bottom: 50px;'>
17794 naman 170
 
171
 
172
 
173
 
18718 manish.sha 174
	<div class='row' style="padding-bottom: 55px;">
17794 naman 175
 
176
 
18718 manish.sha 177
		<div class='row'>
178
			<div class='col-xs-12'
179
				style="background-color: white; margin-top: 5px;">
18734 manish.sha 180
 
18718 manish.sha 181
				<h4>
182
					Shipping Address: <a
183
						href="<?php echo $base_url;?>shippings/add/<?php echo $user_name.'/'.$user_contact;?>"
184
						class='btn btn-success btn-xs' style='float: right;'>Add New
185
						Address</a>
186
				</h4>
187
				<br>
17882 naman 188
 
18718 manish.sha 189
			</div>
190
		</div>
191
		<div class='col-xs-12'
192
			style='background-color: white; padding: 40px; padding: 3px 20px;'>
17882 naman 193
 
18718 manish.sha 194
			<div style='background-color: #f8f8f8; padding: 5px;'>
195
			<?php
196
			for($i=0;$i<count($firstshowaddress);$i++){?>
17794 naman 197
 
18718 manish.sha 198
			<?php if($i==3):?>
199
				<div id='showmoreaddressdropdown' style='display: none;'>
200
				<?php endif;?>
201
				<?php //if(count($firstshowaddress)>$i):?>
202
					<div style='min-height: 80px; padding: 4px;'
203
						id="address<?php echo $address['addresses'][$firstshowaddress[$i]]['id'];?>"
204
						class='myaddress <?php if($defaultselectedaddress == $address['addresses'][$firstshowaddress[$i]]['id']){echo "addressselect";}?>'>
17794 naman 205
 
18718 manish.sha 206
						<input type="radio" class="css-checkbox"
207
							id='<?php echo $address['addresses'][$firstshowaddress[$i]]['id'];?>'
208
							value='<?php echo $address['addresses'][$firstshowaddress[$i]]['id'];?>'
209
							name="selectedaddress"
18745 manish.sha 210
							<?php if($defaultselectedaddress == $address['addresses'][$firstshowaddress[$i]]['id']){echo "checked";}?>
18768 manish.sha 211
							<?php if($creditorAssociated && $address['addresses'][$firstshowaddress[$i]]['creditOptionAvailable']):?> credit_available="true" <?php else: ?> credit_available="false"<?php endif;?> >
17794 naman 212
 
18718 manish.sha 213
						<label
214
							for="<?php echo $address['addresses'][$firstshowaddress[$i]]['id'];?>"
215
							class="css-label radGroup2"
216
							data-pin="<?php echo $address['addresses'][$firstshowaddress[$i]]['pin'];?>"
18777 manish.sha 217
							data-id="<?php echo $address['addresses'][$firstshowaddress[$i]]['id'];?>"
218
							<?php if($creditorAssociated && $address['addresses'][$firstshowaddress[$i]]['creditOptionAvailable']):?> credit_available="true" <?php else: ?> credit_available="false"<?php endif;?>>
18718 manish.sha 219
							<?php
220
							if(isset($address['addresses'][$firstshowaddress[$i]]['line1']) && !empty($address['addresses'][$firstshowaddress[$i]]['line1']))
221
							{echo "Address: ",$address['addresses'][$firstshowaddress[$i]]['line1'];}
222
							if(isset($address['addresses'][$firstshowaddress[$i]]['line2']) && !empty($address['addresses'][$firstshowaddress[$i]]['line2']))
223
							{echo ",",$address['addresses'][$firstshowaddress[$i]]['line2'];}
224
							if(isset($address['addresses'][$firstshowaddress[$i]]['city']) && !empty($address['addresses'][$firstshowaddress[$i]]['city']))
225
							{echo "<br>",$address['addresses'][$firstshowaddress[$i]]['city'];}
226
							if(isset($address['addresses'][$firstshowaddress[$i]]['state']) && !empty($address['addresses'][$firstshowaddress[$i]]['state']))
227
							{echo ", ",$address['addresses'][$firstshowaddress[$i]]['state'];}
228
							if(isset($address['addresses'][$firstshowaddress[$i]]['pin']) && !empty($address['addresses'][$firstshowaddress[$i]]['pin']))
229
							{echo ",",$address['addresses'][$firstshowaddress[$i]]['pin'];}
230
							?> </label>
18768 manish.sha 231
							<?php if($creditorAssociated):?>
18745 manish.sha 232
							<?php if($address['addresses'][$firstshowaddress[$i]]['creditOptionAvailable']):?>
18734 manish.sha 233
							<i class="glyphicon glyphicon-info-sign pull-right" style="font-size: 10px;color: #36BBD9;"> 
234
							<span style="color: #36BBD9;font-size: 10px;font-family: &quot;Helvetica Neue&quot;,Helvetica,Arial,sans-serif;">Credit Available</span>
235
							</i>
18745 manish.sha 236
							<?php endif;?>
18768 manish.sha 237
							<?php endif;?>
238
							<?php if($taxInvoiceEnabledUser):?>
18749 manish.sha 239
							<br>
18745 manish.sha 240
							<?php if($address['addresses'][$firstshowaddress[$i]]['taxInvoiceAvailable']):?>
18752 manish.sha 241
							<i class="glyphicon glyphicon-info-sign pull-right" style="font-size: 10px;color: #42A150;"> 
18768 manish.sha 242
							<span style="color: #42A150;font-size: 10px;font-family: &quot;Helvetica Neue&quot;,Helvetica,Arial,sans-serif;">Tax Invoice Available</span>
18734 manish.sha 243
							</i>
18745 manish.sha 244
							<?php endif;?>
18768 manish.sha 245
							<?php endif;?>
17794 naman 246
 
18718 manish.sha 247
					</div>
248
					<hr style='margin: 0px; padding: 0px; border-color: #58d936;'>
249
					<?php //endif;?>
250
 
251
					<?php if($i>3 && $i==(count($firstshowaddress)-1)):?>
18633 manish.sha 252
				</div>
18718 manish.sha 253
				<!-- <center><button class='btn btn-default btn-xs' id='showmore'>Show More</button></center> -->
254
				<?php endif;?>
255
 
256
				<?php }?>
257
			</div>
258
		</div>
259
		<?php if(count($firstshowaddress)>3):?>
260
		<center>
261
			<div class='btn btn-default btn-xs' id='showmore'>Show More</div>
262
		</center>
263
		<?php endif;?>
264
	</div>
265
	<!-- End of address section -->
266
 
267
	<div class="modal fade" id="myModal">
268
		<div class="modal-dialog">
269
			<div class="modal-content"
270
				style="background-color: #f0f0f0; color: #555;">
271
				<div class="modal-body">
18768 manish.sha 272
					<p id="confirmOrderText" addressId="" checkoutType="" style="color: #555;" class="text-center"></p>
18633 manish.sha 273
				</div>
18718 manish.sha 274
				<div class="modal-footer">
275
					<button type="button" class="btn btn-md  pull-left" id="changeOption"
276
						style="background-color: #58d936; color: #fff;">
277
						<strong>Change Option<br>(विकल्प बदलें)</strong>
278
					</button>
279
					<button type="button" class="btn btn-md pull-right"
280
						id="orderNow" style="background-color: #58d936; color: #fff;">
281
						<strong>Order Now<br>(अभी खरीदें)</strong>
282
					</button>
283
				</div>
284
			</div>
285
			<!-- /.modal-content -->
286
		</div>
287
		<!-- /.modal-dialog -->
288
	</div>
289
	<!-- /.modal -->
18633 manish.sha 290
 
18718 manish.sha 291
	<!-- Cart section started -->
292
	<div class='row' style='padding: 0px;' id='footer'>
293
		<div class='col-xs-12'
294
			style='background-color: white; padding: 10px 20px 20px 20px; width: 100%;'>
295
			<h4 style="margin: 0px; margin-bottom: 8px;">
296
				Total payable Amount: <span style="color: #ff0000;"
297
					id="totalPayable"> &#8377; <?php echo number_format($totalPayable);?>
298
				</span>
299
			</h4>
300
			<?php if($creditorAssociated):?>
301
				<h5>Confirm Order: Choose Option</h5>
302
				<?php if($creditTicketSize<=$totalPayable):?>
303
					<?php if($creditLimit>=$totalPayable):?>
304
						<?php if($codAvailable):?>
305
						<div class="col-xs-12" style="margin-left: 20px;">
306
							<div class="col-xs-4">
307
								<button type="button" class="btn btn-md confirmprepaid"
308
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
309
							</div>
310
							<div class="col-xs-4">
311
								<button type="button" class="btn btn-md confirmcod"
312
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">COD</button>
313
							</div>
314
							<div class="col-xs-4" style="padding:0px;">
315
								<button type="button" class="btn btn-md confirmcredit"
316
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;padding-right: 30px;padding-left: 30px;">Credit</button>
317
								<br>
318
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
319
							</div>
320
						</div>
321
						<?php else:?>
322
						<div class="col-xs-12" style="margin-left: 20px;">
323
							<div class="col-xs-4">
324
								<span
325
									style='padding-right: 2px; color: red; font-size: 12px; " margin: 0px 10px 0px 0px;'>*COD
326
									Not Available</span>
327
							</div>
328
							<div class="col-xs-4">
329
								<button type="button" class="btn btn-md confirmprepaid"
330
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
331
							</div>
332
							<div class="col-xs-4" style="padding:0px;">
333
								<button type="button" class="btn btn-md confirmcredit"
334
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;padding-right: 30px;padding-left: 30px;">Credit</button>
335
								<br>
336
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
337
							</div>
338
						</div>
339
						<?php endif;?>
340
					<?php else:?>
18768 manish.sha 341
							<span id="CreditError"  style='color: red; font-size: 11px; " margin: 0px 10px 0px 0px;'>* Your Credit Limit is less than Order Amount. <br>* आपकी उपलब्ध क्रेडिट लिमिट आर्डर राशि से कम है। </span>
18718 manish.sha 342
							<?php if($codAvailable):?>
343
							<div class="col-xs-12" style="margin-left: 20px;">
344
								<div class="col-xs-4">
345
									<button type="button" class="btn btn-md confirmprepaid"
346
										style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
347
								</div>
348
								<div class="col-xs-4">
349
									<button type="button" class="btn btn-md confirmcod"
350
										style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">COD</button>
351
								</div>
352
								<div class="col-xs-4" style="padding:0px;">
353
									<button type="button" class="btn btn-md confirmcredit"
354
										style="margin: 10px 20px 0px 0px; background-color: #B4CAB4; color: #fff;padding-right: 30px;padding-left: 30px;"
355
										disabled="true">Credit</button>
356
									<br>
357
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
358
								</div>
359
							</div>
360
							<?php else:?>
361
							<div class="col-xs-12" style="margin-left: 20px;">
362
								<div class="col-xs-4">
363
									<span
364
										style='padding-right: 2px; color: red; font-size: 12px; " margin: 0px 10px 0px 0px;'>*COD
365
										Not Available</span>
366
								</div>
367
								<div class="col-xs-4">
368
									<button type="button" class="btn btn-md confirmprepaid"
369
										style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
370
								</div>
371
								<div class="col-xs-4" style="padding:0px;">
372
									<button type="button" class="btn btn-md confirmcredit"
373
										style="margin: 10px 20px 0px 0px; background-color: #B4CAB4; color: #fff;padding-right: 30px;padding-left: 30px;"
374
										disabled="true">Credit</button>
375
									<br>
376
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
377
								</div>
378
							</div>
379
							<?php endif;?>
380
					<?php endif;?>
381
				<?php else:?>
18768 manish.sha 382
						<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>
18718 manish.sha 383
							<?php if($codAvailable):?>
384
							<div class="col-xs-12" style="margin-left: 20px;">
385
								<div class="col-xs-4">
386
									<button type="button" class="btn btn-md confirmprepaid"
387
										style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
388
								</div>
389
								<div class="col-xs-4">
390
									<button type="button" class="btn btn-md confirmcod"
391
										style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">COD</button>
392
								</div>
393
								<div class="col-xs-4" style="padding:0px;">
394
									<button type="button" class="btn btn-md confirmcredit"
395
										style="margin: 10px 20px 0px 0px; background-color: #B4CAB4; color: #fff;padding-right: 30px;padding-left: 30px;"
396
										disabled="true">Credit</button>
397
									<br>
398
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
399
								</div>
400
							</div>
401
							<?php else:?>
402
							<div class="col-xs-12" style="margin-left: 20px;">
403
								<div class="col-xs-4">
404
									<span
405
										style='padding-right: 2px; color: red; font-size: 12px; " margin: 0px 10px 0px 0px;'>*COD
406
										Not Available</span>
407
								</div>
408
								<div class="col-xs-4">
409
									<button type="button" class="btn btn-md confirmprepaid"
410
										style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
411
								</div>
412
								<div class="col-xs-4" style="padding:0px;">
413
									<button type="button" class="btn btn-md confirmcredit"
414
										style="margin: 10px 20px 0px 0px; background-color: #B4CAB4; color: #fff;padding-right: 30px;padding-left: 30px;"
415
										disabled="true">Credit</button>
416
									<br>
417
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
418
								</div>
419
							</div>
420
							<?php endif;?>
421
				<?php endif;?>
422
			<?php else:?>
423
				<?php if($codAvailable):?>
424
				<a href="#" style='padding-right: 2px; color: blue; font-size: 15px;'
425
					class="confirmprepaid"><u>Other Pay Option</u> </a>
426
				<button class="btn btn-success confirmcheckout pull-right">Confirm
427
					Order via COD</button>
428
				<?php else:?>
429
				<span style='padding-right: 2px; color: red; font-size: 15px;'>*COD
430
					Not Available</span>
431
				<button class="btn btn-success confirmprepaid pull-right">Other Pay
432
					Option</button>
433
				<?php endif;?>
434
			<?php endif;?>
17794 naman 435
 
18718 manish.sha 436
		</div>
437
	</div>
438
 
439
	<!-- Cart section end -->
17794 naman 440
</div>
441