Subversion Repositories SmartDukaan

Rev

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