Subversion Repositories SmartDukaan

Rev

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