Subversion Repositories SmartDukaan

Rev

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