Subversion Repositories SmartDukaan

Rev

Rev 20826 | Rev 20978 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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