Subversion Repositories SmartDukaan

Rev

Rev 18734 | Rev 18749 | 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;?>
226
							<?php if($address['addresses'][$firstshowaddress[$i]]['taxInvoiceAvailable']):?>
18734 manish.sha 227
							<i class="glyphicon glyphicon-info-sign pull-right" style="font-size: 10px;color: #EB712D;"> 
228
							<span style="color: #EB712D;font-size: 10px;font-family: &quot;Helvetica Neue&quot;,Helvetica,Arial,sans-serif;">Tax Invoice</span>
229
							</i>
18745 manish.sha 230
							<?php endif;?>
17794 naman 231
 
18718 manish.sha 232
					</div>
233
					<hr style='margin: 0px; padding: 0px; border-color: #58d936;'>
234
					<?php //endif;?>
235
 
236
					<?php if($i>3 && $i==(count($firstshowaddress)-1)):?>
18633 manish.sha 237
				</div>
18718 manish.sha 238
				<!-- <center><button class='btn btn-default btn-xs' id='showmore'>Show More</button></center> -->
239
				<?php endif;?>
240
 
241
				<?php }?>
242
			</div>
243
		</div>
244
		<?php if(count($firstshowaddress)>3):?>
245
		<center>
246
			<div class='btn btn-default btn-xs' id='showmore'>Show More</div>
247
		</center>
248
		<?php endif;?>
249
	</div>
250
	<!-- End of address section -->
251
 
252
	<div class="modal fade" id="myModal">
253
		<div class="modal-dialog">
254
			<div class="modal-content"
255
				style="background-color: #f0f0f0; color: #555;">
256
				<div class="modal-body">
257
					<p id="confirmOrderText" addressId="" checkoutType="" style="color: #ff0000;" class="text-center"></p>
18633 manish.sha 258
				</div>
18718 manish.sha 259
				<div class="modal-footer">
260
					<button type="button" class="btn btn-md  pull-left" id="changeOption"
261
						style="background-color: #58d936; color: #fff;">
262
						<strong>Change Option<br>(विकल्प बदलें)</strong>
263
					</button>
264
					<button type="button" class="btn btn-md pull-right"
265
						id="orderNow" style="background-color: #58d936; color: #fff;">
266
						<strong>Order Now<br>(अभी खरीदें)</strong>
267
					</button>
268
				</div>
269
			</div>
270
			<!-- /.modal-content -->
271
		</div>
272
		<!-- /.modal-dialog -->
273
	</div>
274
	<!-- /.modal -->
18633 manish.sha 275
 
18718 manish.sha 276
	<!-- Cart section started -->
277
	<div class='row' style='padding: 0px;' id='footer'>
278
		<div class='col-xs-12'
279
			style='background-color: white; padding: 10px 20px 20px 20px; width: 100%;'>
280
			<h4 style="margin: 0px; margin-bottom: 8px;">
281
				Total payable Amount: <span style="color: #ff0000;"
282
					id="totalPayable"> &#8377; <?php echo number_format($totalPayable);?>
283
				</span>
284
			</h4>
285
			<?php if($creditorAssociated):?>
286
				<h5>Confirm Order: Choose Option</h5>
287
				<?php if($creditTicketSize<=$totalPayable):?>
288
					<?php if($creditLimit>=$totalPayable):?>
289
						<?php if($codAvailable):?>
290
						<div class="col-xs-12" style="margin-left: 20px;">
291
							<div class="col-xs-4">
292
								<button type="button" class="btn btn-md confirmprepaid"
293
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
294
							</div>
295
							<div class="col-xs-4">
296
								<button type="button" class="btn btn-md confirmcod"
297
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">COD</button>
298
							</div>
299
							<div class="col-xs-4" style="padding:0px;">
300
								<button type="button" class="btn btn-md confirmcredit"
301
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;padding-right: 30px;padding-left: 30px;">Credit</button>
302
								<br>
303
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
304
							</div>
305
						</div>
306
						<?php else:?>
307
						<div class="col-xs-12" style="margin-left: 20px;">
308
							<div class="col-xs-4">
309
								<span
310
									style='padding-right: 2px; color: red; font-size: 12px; " margin: 0px 10px 0px 0px;'>*COD
311
									Not Available</span>
312
							</div>
313
							<div class="col-xs-4">
314
								<button type="button" class="btn btn-md confirmprepaid"
315
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
316
							</div>
317
							<div class="col-xs-4" style="padding:0px;">
318
								<button type="button" class="btn btn-md confirmcredit"
319
									style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;padding-right: 30px;padding-left: 30px;">Credit</button>
320
								<br>
321
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
322
							</div>
323
						</div>
324
						<?php endif;?>
325
					<?php else:?>
326
							<span style='color: red; font-size: 11px; " margin: 0px 10px 0px 0px;'>* Your Credit Limit is less than Order Amount. <br>* आपकी उपलब्ध क्रेडिट लिमिट आर्डर राशि से कम है। </span>
327
							<?php if($codAvailable):?>
328
							<div class="col-xs-12" style="margin-left: 20px;">
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">
334
									<button type="button" class="btn btn-md confirmcod"
335
										style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">COD</button>
336
								</div>
337
								<div class="col-xs-4" style="padding:0px;">
338
									<button type="button" class="btn btn-md confirmcredit"
339
										style="margin: 10px 20px 0px 0px; background-color: #B4CAB4; color: #fff;padding-right: 30px;padding-left: 30px;"
340
										disabled="true">Credit</button>
341
									<br>
342
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
343
								</div>
344
							</div>
345
							<?php else:?>
346
							<div class="col-xs-12" style="margin-left: 20px;">
347
								<div class="col-xs-4">
348
									<span
349
										style='padding-right: 2px; color: red; font-size: 12px; " margin: 0px 10px 0px 0px;'>*COD
350
										Not Available</span>
351
								</div>
352
								<div class="col-xs-4">
353
									<button type="button" class="btn btn-md confirmprepaid"
354
										style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
355
								</div>
356
								<div class="col-xs-4" style="padding:0px;">
357
									<button type="button" class="btn btn-md confirmcredit"
358
										style="margin: 10px 20px 0px 0px; background-color: #B4CAB4; color: #fff;padding-right: 30px;padding-left: 30px;"
359
										disabled="true">Credit</button>
360
									<br>
361
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
362
								</div>
363
							</div>
364
							<?php endif;?>
365
					<?php endif;?>
366
				<?php else:?>
367
						<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>
368
							<?php if($codAvailable):?>
369
							<div class="col-xs-12" style="margin-left: 20px;">
370
								<div class="col-xs-4">
371
									<button type="button" class="btn btn-md confirmprepaid"
372
										style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
373
								</div>
374
								<div class="col-xs-4">
375
									<button type="button" class="btn btn-md confirmcod"
376
										style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">COD</button>
377
								</div>
378
								<div class="col-xs-4" style="padding:0px;">
379
									<button type="button" class="btn btn-md confirmcredit"
380
										style="margin: 10px 20px 0px 0px; background-color: #B4CAB4; color: #fff;padding-right: 30px;padding-left: 30px;"
381
										disabled="true">Credit</button>
382
									<br>
383
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
384
								</div>
385
							</div>
386
							<?php else:?>
387
							<div class="col-xs-12" style="margin-left: 20px;">
388
								<div class="col-xs-4">
389
									<span
390
										style='padding-right: 2px; color: red; font-size: 12px; " margin: 0px 10px 0px 0px;'>*COD
391
										Not Available</span>
392
								</div>
393
								<div class="col-xs-4">
394
									<button type="button" class="btn btn-md confirmprepaid"
395
										style="margin: 10px 20px 0px 0px; background-color: #5cb85c; color: #fff;">Other</button>
396
								</div>
397
								<div class="col-xs-4" style="padding:0px;">
398
									<button type="button" class="btn btn-md confirmcredit"
399
										style="margin: 10px 20px 0px 0px; background-color: #B4CAB4; color: #fff;padding-right: 30px;padding-left: 30px;"
400
										disabled="true">Credit</button>
401
									<br>
402
								<span style="font-size: 8px;">Credit Limit<span style="color:#ff0000;font-size:12px;"> &#8377; <?php echo number_format($creditLimit);?></span></span>
403
								</div>
404
							</div>
405
							<?php endif;?>
406
				<?php endif;?>
407
			<?php else:?>
408
				<?php if($codAvailable):?>
409
				<a href="#" style='padding-right: 2px; color: blue; font-size: 15px;'
410
					class="confirmprepaid"><u>Other Pay Option</u> </a>
411
				<button class="btn btn-success confirmcheckout pull-right">Confirm
412
					Order via COD</button>
413
				<?php else:?>
414
				<span style='padding-right: 2px; color: red; font-size: 15px;'>*COD
415
					Not Available</span>
416
				<button class="btn btn-success confirmprepaid pull-right">Other Pay
417
					Option</button>
418
				<?php endif;?>
419
			<?php endif;?>
17794 naman 420
 
18718 manish.sha 421
		</div>
422
	</div>
423
 
424
	<!-- Cart section end -->
17794 naman 425
</div>
426