Subversion Repositories SmartDukaan

Rev

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