| 10582 |
lgm |
1 |
<?php
|
|
|
2 |
if(isset($product_details->entity) && !empty($product_details->entity)){
|
|
|
3 |
$product_detail = $product_details->entity;
|
|
|
4 |
if(isset($product_detail->items) && !empty($product_detail->items)) {
|
|
|
5 |
$i=0;
|
|
|
6 |
foreach ($product_detail->items as $item){
|
|
|
7 |
if(isset($item->color) && !empty($item->color)){
|
|
|
8 |
$color[$i]['color'] = $item->color;
|
|
|
9 |
$color[$i]['id'] = $item->id;
|
|
|
10 |
$i++;
|
|
|
11 |
}
|
|
|
12 |
}
|
|
|
13 |
}
|
|
|
14 |
$colorCount = sizeof($product_detail->items);
|
|
|
15 |
$authorized = $this->session->userdata('authorized');
|
| 10783 |
lgm |
16 |
if(isset($authorized['pincode']) && !empty($authorized['pincode'])){
|
| 10582 |
lgm |
17 |
$pinCode = $authorized['pincode'];
|
|
|
18 |
}
|
|
|
19 |
elseif (isset($product_detail->pinCode) & !empty($product_detail->pinCode)) {
|
|
|
20 |
$pinCode = $product_detail->pinCode;
|
|
|
21 |
}
|
|
|
22 |
$authorized = $this->session->userdata('authorized');
|
|
|
23 |
if(isset($authorized['email']) && !empty($authorized['email'])){
|
|
|
24 |
if(strpos($authorized['email'], 'anonymous') == false){
|
|
|
25 |
$email = $authorized['email'];
|
|
|
26 |
}
|
|
|
27 |
}
|
| 10725 |
lgm |
28 |
//print_r($product_detail);
|
| 10582 |
lgm |
29 |
?>
|
|
|
30 |
<div id="error" class="error_msg" style="display:none"></div>
|
|
|
31 |
<div class="pd_name">
|
| 10907 |
lgm |
32 |
<div><?php echo $product_detail->name;?></div>
|
| 11190 |
lgm |
33 |
<?php if(isset($product_detail->warranty) && !empty($product_detail->warranty)){?>
|
| 11250 |
lgm |
34 |
<div><?php echo $product_detail->warranty;?></div><?php } ?>
|
| 10582 |
lgm |
35 |
</div><!--pd-name-->
|
|
|
36 |
<?php if(count($product_detail->images) == 1){?>
|
| 11250 |
lgm |
37 |
<div class="pd-images tcenter rec-hldr" id="swipe_0">
|
| 10582 |
lgm |
38 |
<div class="pd-wrapper">
|
|
|
39 |
<div class="pd-image" style="background:url('<?php echo $product_detail->images[0]->url;?>')no-repeat center center;background-size:contain;"></div>
|
|
|
40 |
</div>
|
|
|
41 |
</div><!--pd-images-->
|
|
|
42 |
<?php } else{ ?>
|
|
|
43 |
<div class="pd-images">
|
|
|
44 |
<div class="pd-wrapper">
|
|
|
45 |
<?php foreach($product_detail->images as $image){?>
|
|
|
46 |
<div class="pd-image" style="background:url('<?php echo $image->url;?>')no-repeat center center;background-size:contain;"></div>
|
|
|
47 |
<?php } ?>
|
|
|
48 |
</div>
|
|
|
49 |
</div><!--pd-images-->
|
|
|
50 |
<?php } ?>
|
|
|
51 |
<div class="pd-price-cont clearfix">
|
|
|
52 |
<div class="btn-hldr clearfix">
|
| 10614 |
lgm |
53 |
<?php if(isset($color) && !empty($color) && count($color)>1){?>
|
|
|
54 |
<div class="color-count">Choose Color(<?php echo $colorCount; ?>):</div>
|
| 10582 |
lgm |
55 |
<?php if(isset($color) && !empty($color)){?>
|
|
|
56 |
<select id="color" onchange="updateColor(event)">
|
|
|
57 |
<?php
|
|
|
58 |
foreach ($color as $key => $value) { ?>
|
|
|
59 |
<option value="<?php echo $value['id'];?>"><?php echo $value['color']; ?></option>
|
|
|
60 |
<?php } ?>
|
|
|
61 |
</select>
|
| 10614 |
lgm |
62 |
<?php } }elseif(isset($color) && !empty($color) && count($color)==1){?>
|
|
|
63 |
<p class="tcenter">Available in <?php print_r($color[0]['color']);?> color</p>
|
|
|
64 |
<?php }?>
|
| 10582 |
lgm |
65 |
</div>
|
|
|
66 |
<div class="price-hldr">
|
| 10725 |
lgm |
67 |
<?php if(isset($product_detail->items[0]->mrp) || isset($product_detail->items[0]->sellingPrice)){?>
|
| 10794 |
lgm |
68 |
<span id="rs">Rs</span><?php }?>
|
| 10725 |
lgm |
69 |
<span id='mrp'><?php if(isset($product_detail->items[0]->mrp) && $product_detail->items[0]->mrp != 0){echo $product_detail->items[0]->mrp;} else { echo '';}?></span>
|
|
|
70 |
<span id='sellingPrice'><?php if(isset($product_detail->items[0]->sellingPrice) && $product_detail->items[0]->sellingPrice != 0){echo $product_detail->items[0]->sellingPrice;} else { echo '';}?></span>
|
| 10582 |
lgm |
71 |
<?php if(isset($product_detail->items[0]->discount) && !empty($product_detail->items[0]->discount)){?>
|
|
|
72 |
<span id='discount'>(<?php echo $product_detail->items[0]->discount;?>% off)</span><?php } ?>
|
|
|
73 |
<?php if(isset($product_detail->items[0]->minEmi)){?>
|
|
|
74 |
<div id='emi'>EMI from Rs. <?php echo $product_detail->items[0]->minEmi;?> per month</div><?php } ?>
|
| 10725 |
lgm |
75 |
<div id='comingSoon' style="display:<?php if(isset($product_detail->items[0]->comingSoon) && $product_detail->items[0]->comingSoon == 1){echo 'block';} else {echo 'none';};?>;color:red;">Coming Soon</div>
|
| 10582 |
lgm |
76 |
<?php if(isset($product_detail->offerText)){?>
|
|
|
77 |
<div class="pd-offer clearfix"><div>offer</div><div><?php echo $product_detail->offerText; ?></div></div><?php } ?>
|
|
|
78 |
</div><!--price-hldr-->
|
|
|
79 |
</div><!--pd-price-cont-->
|
| 11250 |
lgm |
80 |
<input type="text" id="email" onFocus="clearError()" value="<?php if(isset($email) && !empty($email)) {echo $email;}?>" style="display:<?php if(strcasecmp($product_detail->items[0]->buttonText, 'notify me') == 0){ echo 'block';} else{ echo 'none';}?>" placeholder="Enter email address to recieve notification">
|
| 10582 |
lgm |
81 |
<div id="buy" onclick="addToCart()"class="buy-now btn">
|
|
|
82 |
<?php echo $product_detail->items[0]->buttonText; ?>
|
|
|
83 |
</div>
|
|
|
84 |
<div class="check-aval">
|
|
|
85 |
<!-- <div>Check delivery time for Area PIN Code</div> -->
|
|
|
86 |
<div class="clearfix">
|
|
|
87 |
<input type="text" id="pincode" placeholder="Enter Pin Code.." value="<?php if(isset($pinCode) && !empty($pinCode)) echo $pinCode;?>"/>
|
|
|
88 |
<div class="btn-blue btn" onclick="checkShipping()">
|
|
|
89 |
Check Delivery Time
|
|
|
90 |
</div>
|
|
|
91 |
</div>
|
|
|
92 |
</div><!--check-aval-->
|
|
|
93 |
<div id="service" class="info-div">
|
| 11250 |
lgm |
94 |
|
| 10582 |
lgm |
95 |
<?php if($product_detail->logisticsInfo->delivery_estimate)?>
|
| 11250 |
lgm |
96 |
<p>Free Delivery by <span id="delivery"><?php if(isset($product_detail->items[0]->comingSoon) && $product_detail->items[0]->comingSoon == 1){echo $product_detail->logisticsInfo->delivery_estimate.' after arrival';}else{ echo $product_detail->logisticsInfo->delivery_estimate; }?></span></p>
|
|
|
97 |
|
| 10582 |
lgm |
98 |
<?php if(isset($product_detail->logisticsInfo->is_cod_available_for_location) && ($product_detail->logisticsInfo->is_cod_available_for_location) == 1)?>
|
| 11250 |
lgm |
99 |
<p>You can pay by <span id="cod">Cash on Delivery</span></p>
|
|
|
100 |
<div id="otg" class="clearfix" style="display:<?php if(isset($product_detail->logisticsInfo->on_time_guarantee) && !empty($product_detail->logisticsInfo->on_time_guarantee)) {echo 'block';} else { echo 'none';} ?>"><p>On Time Guarantee <span id="guarantee">Available</span></p></div>
|
| 10582 |
lgm |
101 |
</div><!--info-div-->
|
| 11250 |
lgm |
102 |
<div style="display:none" id="error"class="info-div"><div class="clearfix"><span>This loction is not serviceable</span></div></div>
|
| 10582 |
lgm |
103 |
|
|
|
104 |
|
|
|
105 |
|
|
|
106 |
|
|
|
107 |
<div class="pd-tab clearfix" >
|
|
|
108 |
<span>Highlights</span>
|
|
|
109 |
<!-- <span>+</span> -->
|
|
|
110 |
</div>
|
|
|
111 |
|
|
|
112 |
<div class="pd-tab-open" id="tab1">
|
|
|
113 |
<div class="detail-div">
|
|
|
114 |
<?php foreach ($product_detail->keySpecs as $key => $value) {?>
|
|
|
115 |
<div>
|
|
|
116 |
<?php echo $value;?>
|
|
|
117 |
</div>
|
|
|
118 |
<?php } ?>
|
|
|
119 |
</div>
|
|
|
120 |
</div><!--pd-tab-open-->
|
|
|
121 |
|
|
|
122 |
|
|
|
123 |
<div class="pd-tab clearfix" onclick="togglelist(event,'tab2')";>
|
|
|
124 |
<span>Detailed Specifications</span>
|
|
|
125 |
<span>+</span>
|
|
|
126 |
</div>
|
|
|
127 |
|
|
|
128 |
<div class="pd-tab-open" id="tab2" style="display:none;">
|
|
|
129 |
<?php foreach ($product_detail->detailedSpecs as $specs) {?>
|
|
|
130 |
<table>
|
|
|
131 |
<tr>
|
|
|
132 |
<th colspan="2"><?php echo $specs->title; ?></th>
|
|
|
133 |
</tr>
|
|
|
134 |
<?php foreach ($specs->specs as $item) {?>
|
|
|
135 |
<tr>
|
|
|
136 |
<td><?php echo $item->name;?></td>
|
|
|
137 |
<td><?php echo implode('',$item->values);?></td>
|
|
|
138 |
</tr>
|
|
|
139 |
<?php }?>
|
|
|
140 |
</table>
|
|
|
141 |
<?php } ?>
|
|
|
142 |
|
|
|
143 |
</div><!--pd-tab-open-->
|
| 11245 |
anikendra |
144 |
|
|
|
145 |
<?php if(isset($product_detail->packageContents) && !empty($product_detail->packageContents)):?>
|
|
|
146 |
<div class="pd-tab clearfix" onclick="togglelist(event,'tab4')";>
|
|
|
147 |
<span>Package Contents</span>
|
|
|
148 |
<span>+</span>
|
|
|
149 |
</div>
|
|
|
150 |
<div class="pd-tab-open" id="tab4" style="display:none;">
|
|
|
151 |
<div class="detail-div">
|
|
|
152 |
<?php foreach ($product_detail->packageContents as $key => $value) :?>
|
|
|
153 |
<div>
|
|
|
154 |
<?php echo $value;?>
|
|
|
155 |
</div>
|
|
|
156 |
<?php endforeach; ?>
|
|
|
157 |
</div>
|
|
|
158 |
</div><!--pd-tab-open-->
|
|
|
159 |
<?php endif;?>
|
|
|
160 |
|
| 10582 |
lgm |
161 |
<?php if(isset($product_detail->expertReviews) && !empty($product_detail->expertReviews)){?>
|
|
|
162 |
<div class="pd-tab clearfix" onclick="togglelist(event,'tab3')";>
|
|
|
163 |
<span>What experts say</span>
|
|
|
164 |
<span>+</span>
|
|
|
165 |
</div>
|
|
|
166 |
<div id="tab3" class="pd-tab-open expert-review" style="display:none;">
|
|
|
167 |
<?php foreach ($product_detail->expertReviews as $review) {?>
|
|
|
168 |
<?php echo $review->review; ?>
|
|
|
169 |
<div><?php echo $review->source; ?></div>
|
|
|
170 |
<?php }?>
|
|
|
171 |
</div>
|
|
|
172 |
<?php } ?>
|
|
|
173 |
<?php if(isset($product_detail->reocmmendedAccessories) && !empty($product_detail->reocmmendedAccessories)){?>
|
|
|
174 |
<div class="recommended-pd">
|
|
|
175 |
<div class="head">
|
|
|
176 |
<div>Recommended Accessories</div>
|
|
|
177 |
</div>
|
| 11250 |
lgm |
178 |
<div class="rec-hldr" id="swipe_1">
|
| 10582 |
lgm |
179 |
<div class="rec-wrapper">
|
|
|
180 |
<?php foreach ($product_detail->reocmmendedAccessories as $item) { ?>
|
|
|
181 |
<a class="rec-product" href="<?php echo $item->url;?>" onclick="trackAccessories('<?php echo $item->title;?>')">
|
|
|
182 |
<img src="<?php echo $item->image_url; ?>" alt="recomended" />
|
|
|
183 |
<div class="pd-name"><?php echo $item->title; ?> </div>
|
| 10907 |
lgm |
184 |
<div class="pd-price"><span>Rs <?php if(isset($item->price)){echo $item->price;}else{echo '';}?></span><span>Rs <?php if(isset($item->mrp)){echo $item->mrp;}else{echo '';} ?></span></div>
|
| 10582 |
lgm |
185 |
</a><!--rec-product-->
|
|
|
186 |
<?php } ?>
|
|
|
187 |
</div>
|
|
|
188 |
</div><!--rec-hldr-->
|
|
|
189 |
</div><!--recomended-pd-->
|
|
|
190 |
<?php } } ?>
|
|
|
191 |
<script type="text/javascript">
|
|
|
192 |
var items = <?php echo json_encode($product_detail->items);?>
|
| 11200 |
anikendra |
193 |
</script>
|
| 11250 |
lgm |
194 |
<script type="text/javascript">
|
|
|
195 |
|
|
|
196 |
var isIE10 = false;
|
|
|
197 |
|
|
|
198 |
/*@cc_on
|
|
|
199 |
|
|
|
200 |
if (/^10/.test(@_jscript_version)) {
|
|
|
201 |
|
|
|
202 |
isIE10 = true;
|
|
|
203 |
|
|
|
204 |
}
|
|
|
205 |
|
|
|
206 |
@*/
|
|
|
207 |
|
|
|
208 |
var iOS = navigator.userAgent.match(/(iPad|iPhone|iPod)/g);
|
|
|
209 |
|
|
|
210 |
var ua = navigator.userAgent;
|
|
|
211 |
|
|
|
212 |
var userAgent = navigator.userAgent.toLowerCase();
|
|
|
213 |
|
|
|
214 |
if (isIE10) {
|
|
|
215 |
var a = document.getElementsByClassName('rec-hldr');
|
|
|
216 |
|
|
|
217 |
for (var i = 0; i < a.length; i++) {
|
|
|
218 |
|
|
|
219 |
a[i].style.overflowX = 'auto';
|
|
|
220 |
|
|
|
221 |
}
|
|
|
222 |
|
|
|
223 |
}
|
|
|
224 |
|
|
|
225 |
else if (ua.indexOf("Android") >= 0) {
|
|
|
226 |
|
|
|
227 |
var androidversion = parseFloat(ua.slice(ua.indexOf("Android") + 8));
|
|
|
228 |
|
|
|
229 |
if (androidversion < 3.0) {
|
|
|
230 |
|
|
|
231 |
var script = document.createElement("script");
|
|
|
232 |
|
|
|
233 |
script.type = "text/javascript";
|
|
|
234 |
|
|
|
235 |
script.src = base_url+'assets/js/iscroll.js'
|
|
|
236 |
|
|
|
237 |
document.body.appendChild(script);
|
|
|
238 |
|
|
|
239 |
script.onload = function() {
|
|
|
240 |
|
|
|
241 |
var point, pointStartX, pointStartY, deltaX, deltaY;
|
|
|
242 |
|
|
|
243 |
var i, scroller = [], len = document.getElementsByClassName('rec-hldr').length;
|
|
|
244 |
|
|
|
245 |
var scrollerArray = document.getElementsByClassName('rec-hldr');
|
|
|
246 |
|
|
|
247 |
for ( i = 0; i < scrollerArray.length; i++) {
|
|
|
248 |
|
|
|
249 |
var length = scrollerArray[i].children.length;
|
|
|
250 |
|
|
|
251 |
scroller[i] = new iScroll("swipe_"+ i, {
|
|
|
252 |
|
|
|
253 |
bounce : true,
|
|
|
254 |
|
|
|
255 |
momentum : true,
|
|
|
256 |
|
|
|
257 |
//hScroll: true,
|
|
|
258 |
|
|
|
259 |
vScroll : false,
|
|
|
260 |
|
|
|
261 |
hScrollbar : false,
|
|
|
262 |
|
|
|
263 |
vScrollbar : false,
|
|
|
264 |
|
|
|
265 |
snap : true,
|
|
|
266 |
|
|
|
267 |
onBeforeScrollStart : function(e) {
|
|
|
268 |
|
|
|
269 |
console.log("onBeforeScrollStart");
|
|
|
270 |
|
|
|
271 |
point = e.touches[0];
|
|
|
272 |
|
|
|
273 |
pointStartX = point.pageX;
|
|
|
274 |
|
|
|
275 |
pointStartY = point.pageY; null;
|
|
|
276 |
|
|
|
277 |
},
|
|
|
278 |
|
|
|
279 |
onBeforeScrollMove : function(e) {
|
|
|
280 |
|
|
|
281 |
console.log(e);
|
|
|
282 |
|
|
|
283 |
point = e.touches[0];
|
|
|
284 |
|
|
|
285 |
//alert("onBeforeScrollMove");
|
|
|
286 |
|
|
|
287 |
deltaX = Math.abs(point.pageX - pointStartX);
|
|
|
288 |
|
|
|
289 |
deltaY = Math.abs(point.pageY - pointStartY);
|
|
|
290 |
|
|
|
291 |
if (deltaX >= deltaY) {
|
|
|
292 |
e.preventDefault();
|
|
|
293 |
|
|
|
294 |
// alert("horizontal");
|
|
|
295 |
|
|
|
296 |
} else {
|
|
|
297 |
|
|
|
298 |
//alert("vertical");
|
|
|
299 |
|
|
|
300 |
null;
|
|
|
301 |
|
|
|
302 |
}
|
|
|
303 |
|
|
|
304 |
}
|
|
|
305 |
});
|
|
|
306 |
|
|
|
307 |
|
|
|
308 |
|
|
|
309 |
setTimeout(function() {
|
|
|
310 |
|
|
|
311 |
for ( i = 0; i < len; i++) {
|
|
|
312 |
|
|
|
313 |
scroller[i].refresh();
|
|
|
314 |
|
|
|
315 |
}
|
|
|
316 |
|
|
|
317 |
}, 100);
|
|
|
318 |
}
|
|
|
319 |
|
|
|
320 |
}
|
|
|
321 |
}else {
|
|
|
322 |
|
|
|
323 |
var a = document.getElementsByClassName('rec-hldr');
|
|
|
324 |
|
|
|
325 |
for (var i = 0; i < a.length; i++) {
|
|
|
326 |
|
|
|
327 |
a[i].style.overflowX = 'auto';
|
|
|
328 |
|
|
|
329 |
a[i].style.webkitOverflowScrolling = 'touch';
|
|
|
330 |
|
|
|
331 |
}
|
|
|
332 |
|
|
|
333 |
}
|
|
|
334 |
|
|
|
335 |
}else if (iOS) {
|
|
|
336 |
|
|
|
337 |
if (navigator.userAgent.match(/(iPad|iPhone|iPod|iPod touch);.*CPU.*OS (6|7)_\d/i) ? true : false) {
|
|
|
338 |
|
|
|
339 |
var a = document.getElementsByClassName('rec-hldr');
|
|
|
340 |
for (var i = 0; i < a.length; i++) {
|
|
|
341 |
a[i].style.overflowX = 'auto';
|
|
|
342 |
a[i].style.overflowY = 'hidden';
|
|
|
343 |
a[i].style.webkitOverflowScrolling = 'touch';
|
|
|
344 |
}
|
|
|
345 |
|
|
|
346 |
}else{
|
|
|
347 |
|
|
|
348 |
var script = document.createElement("script");
|
|
|
349 |
|
|
|
350 |
script.type = "text/javascript";
|
|
|
351 |
|
|
|
352 |
script.src = base_url+'assets/js/iscroll.js'
|
|
|
353 |
|
|
|
354 |
document.body.appendChild(script);
|
|
|
355 |
|
|
|
356 |
script.onload = function() {
|
|
|
357 |
|
|
|
358 |
var point, pointStartX, pointStartY, deltaX, deltaY;
|
|
|
359 |
|
|
|
360 |
var i, scroller = [], len = document.getElementsByClassName('rec-wrapper').length;
|
|
|
361 |
|
|
|
362 |
var scrollerArray = document.getElementsByClassName('rec-wrapper');
|
|
|
363 |
|
|
|
364 |
|
|
|
365 |
|
|
|
366 |
//var length = scrollerArray[i].children.length;
|
|
|
367 |
|
|
|
368 |
scroller[i] = new iScroll(swipe_1, {
|
|
|
369 |
|
|
|
370 |
bounce : true,
|
|
|
371 |
|
|
|
372 |
momentum : true,
|
|
|
373 |
|
|
|
374 |
//hScroll: true,
|
|
|
375 |
|
|
|
376 |
vScroll : false,
|
|
|
377 |
|
|
|
378 |
hScrollbar : false,
|
|
|
379 |
|
|
|
380 |
vScrollbar : false,
|
|
|
381 |
|
|
|
382 |
snap : true,
|
|
|
383 |
|
|
|
384 |
onBeforeScrollStart : function(e) {
|
|
|
385 |
|
|
|
386 |
console.log("onBeforeScrollStart");
|
|
|
387 |
|
|
|
388 |
point = e.touches;
|
|
|
389 |
|
|
|
390 |
pointStartX = point.pageX;
|
|
|
391 |
|
|
|
392 |
pointStartY = point.pageY; null;
|
|
|
393 |
|
|
|
394 |
},
|
|
|
395 |
|
|
|
396 |
onBeforeScrollMove : function(e) {
|
|
|
397 |
|
|
|
398 |
console.log(e);
|
|
|
399 |
|
|
|
400 |
point = e.touches;
|
|
|
401 |
|
|
|
402 |
//alert("onBeforeScrollMove");
|
|
|
403 |
|
|
|
404 |
deltaX = Math.abs(point.pageX - pointStartX);
|
|
|
405 |
|
|
|
406 |
deltaY = Math.abs(point.pageY - pointStartY);
|
|
|
407 |
|
|
|
408 |
if (deltaX >= deltaY) {
|
|
|
409 |
e.preventDefault();
|
|
|
410 |
|
|
|
411 |
// alert("horizontal");
|
|
|
412 |
|
|
|
413 |
} else {
|
|
|
414 |
|
|
|
415 |
//alert("vertical");
|
|
|
416 |
|
|
|
417 |
null;
|
|
|
418 |
|
|
|
419 |
}
|
|
|
420 |
|
|
|
421 |
}
|
|
|
422 |
});
|
|
|
423 |
|
|
|
424 |
}
|
|
|
425 |
|
|
|
426 |
}
|
|
|
427 |
|
|
|
428 |
}else if (ua.indexOf("BlackBerry") >= 0 || ua.indexOf("BB10") >= 0) {
|
|
|
429 |
|
|
|
430 |
var a = document.getElementsByClassName('rec-hldr');
|
|
|
431 |
|
|
|
432 |
for (var i = 0; i < a.length; i++) {
|
|
|
433 |
|
|
|
434 |
a[i].style.overflowX = 'auto';
|
|
|
435 |
|
|
|
436 |
a[i].style.webkitOverflowScrolling = 'touch';
|
|
|
437 |
}
|
|
|
438 |
|
|
|
439 |
}
|
|
|
440 |
|
|
|
441 |
</script>
|